#
Generating Artificial Reverberation via Genetic Algorithms for Real-Time Applications^{ †}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Background

#### 2.1. Reverberation Techniques

#### 2.2. Genetic Algorithms

#### 2.2.1. Genetic Algorithms in Sound and Audio

#### 2.2.2. Simulating The Impulse Response of a Box-Shaped Room

## 3. Method

#### 3.1. Genetic Algorithm

#### 3.1.1. Initialization

- Reduce the gain of the entire signal by a constant amount (a random factor between $0.2$ and $0.7$). This is to introduce some variation in regards to how much of the sound is absorbed by the enclosure.
- Change the value of certain samples to be closer to $\pm 1$. The probability that a sample is chosen at time t (in s) is$$P\left(t\right)=1-{p}^{t}$$
- Apply exponential decay to the gain of the entire IR (the rate of which is inversely proportional to the input ${T}_{60}$ value), simulating the absorption of sound from the surrounding walls.
- Apply a second-order Butterworth band-pass filter, where the cutoff frequencies of this filter are randomly chosen (31.25–500 Hz for the lower and 0.5–8 kHz for the upper bound). Such a filter is normally applied to recorded IRs as well [24].

#### 3.1.2. Fitness

#### 3.1.3. Genetic Operations

#### 3.1.4. Termination

- The fitness value of the best IR found is below a certain threshold value,
- The fitness value of the best IR found does not decrease after a certain number of generations (specified by a “plateau length” parameter) has passed, or
- A predetermined limit on the total number of generations to execute has been reached.

#### 3.2. Implementation

## 4. Evaluation

#### 4.1. Objective Evaluation

`tic`/

`toc`functions) were used to record the execution times of the GA.

#### Results

#### 4.2. Subjective Evaluation

#### Results

`emmeans`library [33], with the degrees of freedom being asymptotically computed for this analysis. Tukey’s test showed that, regardless of quality setting, the rate of correct answers for the drum riff was significantly higher than that of speech ($z=5.926,p<0.001$). Additionally, regardless of “program,” the rate of correct answers given “High” quality IRs was significantly higher than that of “Max” quality IRs ($z=2.414,p=0.016$). These findings are summarized in Figure 6a, which shows the mean and $95\%$ confidence interval of the probability of a correct answer by quality setting and program. We can also conclude from Figure 6a that the subjective responses were significantly different from random, since the rate of correct responses is significantly higher than $50\%$ in all cases.

## 5. Discussion

#### 5.1. Objective Evaluation

#### 5.2. Subjective Evaluation

#### 5.3. Limitations

## 6. Conclusions

## Supplementary Materials

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

AI | Artificial Intelligence |

ANOVA | Analysis of Variance |

AU | Audio Units |

BR | Bass Ratio |

BRIR | Binaural Room Impulse Response |

CPU | Central Processing Unit |

DF | Degrees of Freedom |

DFT | Discrete Fourier Transform |

DSP | Digital Signal Processing |

EDT | Early Decay Time |

EMMs | Estimated Marginal Means |

FFT | Fast Fourier Transform |

GA | Genetic Algorithm |

GLMM | Generalized Linear Mixed Model |

GP | Genetic Programming |

GPU | Graphics Processing Unit |

GUI | Graphical User Interface |

HRIR | Head-Related Impulse Response |

HSD | Honest Significant Difference |

ILD | Interaural Level Difference |

IQR | Interquartile Range |

IR | Impulse Response |

ISO | International Organization for Standardization |

ITD | Interaural Time Difference |

ITDG | Initial Time Delay Gap |

JND | Just Noticeable Difference |

MFCCs | Mel-Frequency Cepstral Coefficients |

MT-CGP | Mixed-Typed Cartesian Genetic Programming |

Pd | Pure Data |

RIR | Room Impulse Response |

RMS | Root Mean Square |

SLF | Sonic Localization Field |

VST | Virtual Studio Technology |

WAV | Waveform Audio File Format |

## References

- Lochner, J.; Burger, J. The intelligibility of speech under reverberant conditions. Acta Acust. United Acust.
**1961**, 11, 195–200. [Google Scholar] - Valimaki, V.; Parker, J.D.; Savioja, L.; Smith, J.O.; Abel, J.S. Fifty years of artificial reverberation. IEEE Trans. Audio Speech Lang. Process.
**2012**, 20, 1421–1448. [Google Scholar] [CrossRef] - Ly, E.; Villegas, J. Genetic Reverb: Synthesizing Artificial Reverberant Fields via Genetic Algorithms. In Proceedings of the Artificial Intelligence in Music, Sound, Art and Design, Seville, Spain, 15–17 April 2020; Romero, J., Ekárt, A., Martins, T., Correia, J., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 90–103. [Google Scholar] [CrossRef]
- Zölzer, U. (Ed.) DAFX—Digital Audio Effects, 2nd ed.; John Wiley & Sons: New York, NY, USA, 2011. [Google Scholar]
- Gardner, W.G. Efficient convolution without input/output delay. Proc. Audio Eng. Soc. Conv.
**1994**, 97, 3897. [Google Scholar] - Darwin, C. On the Origin of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life; Murray, J., Ed.; Oxford University Press: Oxford, UK, 1859. [Google Scholar]
- Mitchell, M. An Introduction to Genetic Algorithms; MIT Press: Cambridge, MA, USA, 1996. [Google Scholar]
- Todd, S.; Latham, W. The mutation of growth of art by computers. In Evolutionary Design by Computers; Bentley, P., Ed.; Morgan Kaufmann: San Francisco, CA, USA, 1999. [Google Scholar]
- Koza, J.; Rice, J. Genetic Programming: On the Programming of Computers by Means of Natural Selection; MIT Press: Cambridge, MA, USA, 1992. [Google Scholar]
- Macret, M.; Pasquier, P. Automatic design of sound synthesizers as pure data patches using coevolutionary mixed-typed cartesian genetic programming. In Proceedings of the 2014 Annual Conference on Genetic and Evolutionary Computation, Vancouver, BC, Canada, 12–14 July 2014; pp. 309–316. [Google Scholar]
- Puckette, M.S. Pure Data. Software. 2020. Available online: https://puredata.info/ (accessed on 11 November 2020).
- Collins, N. Experiments with a new customisable interactive evolution framework. Organ. Sound
**2002**, 7, 267–273. [Google Scholar] [CrossRef] [Green Version] - McCartney, J. SuperCollider. Software. 2020. Available online: https://supercollider.github.io/ (accessed on 11 November 2020).
- Fornari, J.; Maia, A.; Manzolli, J. Interactive Soundscape Design with Evolutionary sound Processing. In Proceedings of the International Computer Music Conference, Copenhagen, Denmark, 27–31 August 2007. [Google Scholar]
- Villegas, J. Locating virtual sound sources at arbitrary distances in real-time binaural reproduction. Virtual Real.
**2015**, 19, 201–212. [Google Scholar] [CrossRef] - Best, V.; Baumgartner, R.; Lavandier, M.; Majdak, P.; Kopčo, N. Sound externalization: A review of recent research. Trends Hear.
**2020**, 24. [Google Scholar] [CrossRef] [PubMed] - Allen, J.B.; Berkley, D.A. Image method for efficiently simulating small-room acoustics. J. Acoust. Soc. Am.
**1979**, 65, 943–950. [Google Scholar] [CrossRef] - Habets, E. Room Impulse Response Generator. 2006. Available online: https://www.researchgate.net/profile/Emanuel_Habets/publication/259991276_Room_Impulse_Response_Generator/links/5800ea5808ae1d2d72eae2a0/Room-Impulse-Response-Generator.pdf (accessed on 11 November 2020).
- Mathworks. Matlab. Software. 2020. Available online: www.mathworks.com (accessed on 11 November 2020).
- Kristiansen, U.; Krokstad, A.; Follestad, T. Extending the image method to higher-order reflections. Appl. Acoust.
**1993**, 38, 195–206. [Google Scholar] [CrossRef] - McGovern, S. Fast image method for impulse response calculations of box-shaped rooms. Appl. Acoust.
**2009**, 70, 182–189. [Google Scholar] [CrossRef] - International Organization for Standardization. Acoustics—Measurement of Room Acoustic Parameters—Part 1: Performance Spaces; ISO 3382-1:2009; ISO: Geneva, Switzerland, 2009. [Google Scholar]
- Beranek, L. Concert Halls and Opera Houses: Music, Acoustics, and Architecture, 2nd ed.; Springer: New York, NY, USA, 2004. [Google Scholar]
- Murphy, D.; Rees-Jones, J. Open Acoustic Impulse Response (OpenAIR) Library. Available online: https://openairlib.net/ (accessed on 11 November 2020).
- Cecchi, S.; Carini, A.; Spors, S. Room response equalization—A review. Appl. Sci.
**2018**, 8, 16. [Google Scholar] [CrossRef] [Green Version] - Smith, J.O. Physical Audio Signal Processing. W3K Publishing. 2010. Available online: http://www.w3k.org/ (accessed on 11 November 2020).
- Poli, R.; Langdon, W.B.; McPhee, N.F. A Field Guide to Genetic Programming; Lulu: Morrisville, NC, USA, 2008; p. 250. [Google Scholar]
- Pulkki, V.; Karjalainen, M. Communication Acoustics: An Introduction to Speech, Audio and Psychoacoustics, 1st ed.; John Wiley & Sons: Chichester, West Sussex, UK, 2015. [Google Scholar]
- Hintze, J.L.; Nelson, R.D. Violin Plots: A Box Plot-Density Trace Synergism. Am. Stat.
**1998**, 52, 181–184. [Google Scholar] [CrossRef] - Bech, S.; Zacharov, N. Perceptual Audio Evaluation—Theory, Method and Application; John Wiley & Sons: Chichester, West Sussex, UK, 2006. [Google Scholar]
- R Foundation. R: The R Project for Statistical Computing. Software. 2020. Available online: https://www.r-project.org/ (accessed on 11 November 2020).
- Ferrari, A.; Comelli, M. A comparison of methods for the analysis of binomial clustered outcomes in behavioral research. J. Neurosci. Methods
**2016**, 274, 131–140. [Google Scholar] [CrossRef] [PubMed] - Lenth, R. emmeans: Estimated Marginal Means, aka Least-Squares Means. R Package Version 1.5.0-5. 2019. Available online: https://github.com/rvlenth/emmeans (accessed on 11 November 2020).
- Hak, C.C.J.M.; Wenmaekers, R.H.C.; van Luxemburg, L.C.J. Measuring Room Impulse Responses: Impact of the Decay Range on Derived Room Acoustic Parameters. Acta Acust. United Acust.
**2012**, 98, 907–915. [Google Scholar] [CrossRef] [Green Version] - Ableton. Live. Software. 2020. Available online: https://www.ableton.com/ (accessed on 11 November 2020).

**Figure 1.**Flowchart outlining each step of the Genetic Algorithm (GA) used to generate an Impulse Response (IR).

**Figure 4.**Violin plots of (

**a**) loss values and (

**b**) computation times for IRs generated with random acoustic parameter settings (lower is better). The center white dots and surrounding gray bars in these and other violin plots indicate the mean and interquartile range (IQR), respectively, of each distribution.

**Figure 5.**Violin plots of (

**a**) loss values and (

**b**) computation times for IRs generated with fixed settings (lower is better).

**Figure 6.**Means (dots) and 95% confidence intervals (error bars) for the rates of correct responses by quality setting and program: (

**a**) for all subjects, and (

**b**) after removing responses from subjects classified as “super-classifiers”.

**Table 1.**Acoustic parameters used in our solution, along with their colloquial names and definitions.

Parameter | Common Name | Definition |
---|---|---|

${T}_{60}$ | Decay Time, Reverberation Time | Time for sound pressure level of the IR to decay by 60 dB from the initial magnitude |

Early Decay Time (EDT) | Reverberance | Time for sound pressure level of the IR to decay by 10 dB from the initial magnitude |

${C}_{80}$ | Clarity | Ratio (in dB) between sound pressure levels of direct sound plus early reflections ($<\phantom{\rule{-0.166667em}{0ex}}80$ ms after direct sound) vs. late reflections ($\ge \phantom{\rule{-0.166667em}{0ex}}80$ ms after direct sound) |

Initial Time Delay Gap (ITDG) | Predelay, Intimacy | Time between the arrival of the direct sound and the arrival of the first reflection. |

Bass Ratio (BR) | Warmth | Ratio between ${T}_{60}$ times in low-frequency (125–500 Hz) and mid-frequency ($0.5$–$2.0$ kHz) octave bands |

**Table 2.**Parameter values used in the genetic algorithm within our solution depending on reverb quality. Selection rate, fitness threshold, and mutation probability were constant at $0.4$, $0.1$, and $0.001$, respectively.

Parameter | Quality | |||
---|---|---|---|---|

Low | Med | High | Max | |

Population Size | 25 | 25 | 50 | 50 |

Max. Number of Generations | 20 | 50 | 50 | 100 |

Plateau Length | 4 | 10 | 10 | 20 |

Parameter | Valid Range | Description |
---|---|---|

Decay Time | $[0.4,10]$ s | ${T}_{60}$ of the desired IR |

Early Decay Time | $[5,25]$ % | EDT of the desired IR (as a percentage of ${T}_{60}$) |

Clarity | $[-30,30]$ dB | ${C}_{80}$ of the desired IR |

Warmth | $[-10,10]$ dB | BR of the desired IR |

Predelay | $[0.5,200]$ ms | ITDG of the desired IR |

Quality | {“Low,” “Medium,” “High,” “Max”} | Sets various parameters for the GA (see Table 2) |

Mono/Stereo | {“Mono,” “Stereo”} | Generate either one IR for both channels (mono) or a different one for each channel (stereo) |

Normalize | {“On,” “Off”} | In “stereo” mode, forces the RMS level difference in IRs to be zero (“On”) or at most 20 dB (“Off”) |

Dry/Wet | $[0,100]$% | Balance between the dry input signal (0%) and the processed one (100%) |

Output Gain | $[-60,20]$ dB | Gain of the mixed dry/wet signal |

Generate Room | N/A | Pressing this button generates a new IR using the current parameters |

Toggle To Save | N/A | Pressing this button saves the current IR as a binary file in the plugin directory |

**Table 4.**Chi-squared test statistics—including ${\chi}^{2}$ values, degrees of freedom (DF), and p-values— obtained from pairwise comparison of various Generalized Linear Mixed Models (GLMMs) defined by various formulas and fitted to experiment data. The terms

`hit ∼ (1|id)`have been abbreviated to

`∼`. Significant p-values at a $95\%$ confidence level are highlighted in bold.

Model 1 | Model 2 | ${\mathit{\chi}}^{2}$ | DF | p |
---|---|---|---|---|

∼ | ∼ + (1|sex) | $0.014$ | 1 | $0.905$ |

∼ | ∼ + (1|age) | $0.008$ | 1 | $0.928$ |

∼ | ∼ + (1|exp) | 0 | 1 | $0.994$ |

∼ | ∼ + (1|rep) | 0 | 1 | $0.999$ |

∼ | ∼ + program | $41.483$ | 1 | $<\mathbf{0.001}$ |

∼ + program | ∼ + program + quality | $5.732$ | 1 | $\mathbf{0.017}$ |

∼ + program + quality | ∼ + program + quality + x.type | $0.338$ | 1 | $0.561$ |

∼ + program + quality | ∼ + program + quality + program:quality | $0.191$ | 1 | $0.662$ |

∼ + program + quality | ∼ + program + quality + program:x.type | $0.848$ | 2 | $0.654$ |

∼ + program + quality | ∼ + program + quality + quality:x.type | $0.378$ | 2 | $0.828$ |

∼ + program + quality | ∼ + program + quality + program:quality:x.type | $3.671$ | 5 | $0.598$ |

**Table 5.**Chi-squared test statistics obtained from pairwise comparison of various GLMMs defined by various formulas and fitted to experiment data without super-classifiers. The terms

`hit ∼ (1|id)`have been abbreviated to

`∼`. Significant p-values at a $95\%$ confidence level are highlighted in bold.

Model 1 | Model 2 | ${\mathit{\chi}}^{2}$ | DF | p |
---|---|---|---|---|

∼ | ∼ + (1|sex) | 0 | 1 | $1.000$ |

∼ | ∼ + (1|age) | 0 | 1 | $1.000$ |

∼ | ∼ + (1|exp) | 0 | 1 | $1.000$ |

∼ | ∼ + (1|rep) | 0 | 1 | $1.000$ |

∼ | ∼ + program | $34.151$ | 1 | $<\mathbf{0.001}$ |

∼ + program | ∼ + program + quality | $4.212$ | 1 | $\mathbf{0.040}$ |

∼ + program + quality | ∼ + program + quality + x.type | $0.192$ | 1 | $0.661$ |

∼ + program + quality | ∼ + program + quality + program:quality | $0.326$ | 1 | $0.568$ |

∼ + program + quality | ∼ + program + quality + program*x.type | $0.527$ | 2 | $0.769$ |

∼ + program + quality | ∼ + program + quality + quality*x.type | $0.201$ | 2 | $0.904$ |

∼ + program + quality | ∼ + program + quality + program*quality*x.type | $3.535$ | 5 | $0.618$ |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ly, E.; Villegas, J.
Generating Artificial Reverberation via Genetic Algorithms for Real-Time Applications. *Entropy* **2020**, *22*, 1309.
https://doi.org/10.3390/e22111309

**AMA Style**

Ly E, Villegas J.
Generating Artificial Reverberation via Genetic Algorithms for Real-Time Applications. *Entropy*. 2020; 22(11):1309.
https://doi.org/10.3390/e22111309

**Chicago/Turabian Style**

Ly, Edward, and Julián Villegas.
2020. "Generating Artificial Reverberation via Genetic Algorithms for Real-Time Applications" *Entropy* 22, no. 11: 1309.
https://doi.org/10.3390/e22111309