A VST 2 audio effect plugin written in MATLAB that uses a genetic algorithm to generate a random impulse response describing the reverberation of an artificial room, and uses the impulse response to apply convolution reverb to an audio signal in real-time.
A MATLAB script version (in scripts/main.m
) is also available, which accepts a WAV audio file as input instead.
The input is combined with the impulse response via convolution, applying the reverb effect to the pre-recorded audio.
Since no two impulse responses will ever be the same, both the script and the plugin are also able to save the generated impulse responses to new files as well. You can then load the generated impulse response files into other programs such as my simple IR Reverb Pure Data patch or the Convolution Reverb device in Ableton Live to perform the same reverb effect.
This plugin was also featured in the following conferences and journals:
- 147th AES Convention in New York 2019, October 16-19
- Finalist, MATLAB Plugin Student Competition
- EvoMUSART 2020 (9th International Conference on Artificial Intelligence in Music, Sound, Art and Design), April 15-17
- Entropy Special Issue "Artificial Intelligence and Complexity in Art, Music, Games and Design" (November 2020)
If you wish to cite this project, please refer to the latter article.
A video explaining and demonstrating the plugin is below. Please note that the video refers to an outdated version of the plugin.
I also used the plugin to create an entire demo track, which you can listen to and download here: https://soundcloud.com/9646/inner-space.
You can start using the plugin right away (without the need to compile from source code) by extracting the contents of the provided .zip
file and then copying the desired file(s) into the plugins directory specified by your VST host application.
The included plugins, however, do not have the ability to save the generated impulse responses at this time.
The plugin is available in the following formats:
- Windows
GeneticReverb_x86.dll
(32-bit VST Plugin)GeneticReverb_x64.dll
(64-bit VST Plugin)GeneticReverb.exe
(Standalone Executable)
- macOS
GeneticReverb.vst
(VST Plugin)GeneticReverb.component
(AU Plugin)GeneticReverb.app
(Standalone Executable)
- MATLAB (version R2020a or later)
- Audio Toolbox
- DSP System Toolbox
- Signal Processing Toolbox
- Statistics and Machine Learning Toolbox
- (Windows) Microsoft Visual C++ 2017 (or higher)
- (macOS) Xcode 9.x (or higher)
First ensure that the GeneticReverb.m
class file is visible to MATLAB by adding the components
directory to the MATLAB path or directly changing to the components
directory, running addpath components
or cd components
, respectively, in the MATLAB command window.
Then validate the plugin with validateAudioPlugin GeneticReverb
and generate the plugin with generateAudioPlugin GeneticReverb
.
You can also specify the output directory when generating the plugin with generateAudioPlugin -outdir path/to/folder/ GeneticReverb
.
Note 1: Running
validateAudioPlugin GeneticReverb
will generate and save hundreds of binary files in the current directory as part of the validation. You can safely delete these files (or convert them to audio files and peruse them to your liking, see note 2).
Listed below are the current user parameters of the plugin. You can change the impulse response parameters freely before generating the impulse responses using the "Generate Room" switch. Due to the spike in CPU usage that this can cause, you may experience a delay before the genetic algorithm is completed and the impulse response(s) can be convolved with the input signal. Adding automation to any of the parameters (other than "Dry/Wet" and "Output Gain") is also not recommended for this reason.
- Impulse Response Parameters
- Decay Time - Specifies the amount of time it takes for the impulse response to decay 60 dB from the initial amplitude.
- Early Decay Time - Specifies the amount of time it takes for the impulse response to decay 10 dB from the initial amplitude, expressed as a percentage of the total decay time.
- Clarity - Specifies the difference in energy levels (in decibels) of early reflections compared to late reflections. Higher values increase the prominence of early reflections and thus increase the impulse response's rate of decay.
- Warmth - Specifies the difference in energy levels (in decibels) of low-frequency (125-500 Hz) content compared to mid-frequency (500-2000 Hz) content. A value of 0 dB represents a 1:1 ratio (flat response), and increasing or decreasing this value makes the impulse response more "warm" or "brilliant", respectively.
- Predelay - Specifies the amount of time delay before the arrival of the direct sound in the impulse response. Higher values contribute to the impression of taller or wider rooms.
- Mono/Stereo - Setting this to "mono" mode means that the genetic algorithm will generate only one impulse response to be used for both the left and right audio channels, while "stereo" mode makes the genetic algorithm generate two instead, one for each stereo channel to create a binaural effect.
- Normalize - If set to "On", adjusts the gain of the two impulse responses so that their RMS levels are equal. Otherwise, the difference in RMS levels will only be limited by the maximum possible ILD (Interaural Level Difference, assumed to be 20 dB in the plugin). Works in "stereo" mode only.
- Quality - Specifies the quality of the reverb by changing the amount of time given to the genetic algorithm to produce an impulse response (more specifically, changing various parameters in the genetic algorithm such as the population size or the maximum number of generations to execute). The higher the quality, the closer the output IR(s) will be to the values specified by the user for the above parameters.
- Post-Processing Parameters
- Output Gain - Adjusts the gain of the wet signal before being mixed with the dry input signal.
- Dry/Wet - Adjusts the balance between the dry input signal and the wet processed signal.
- Special Parameters
- Generate Room - Toggling the switch triggers the genetic algorithm in the plugin, using the current parameter values to generate new impulse responses.
- Toggle To Save - Toggling the switch triggers the plugin to save the current impulse response as a binary (
.bin
) file in the same directory as the plugin. Useful if the plugin generates an impulse response you like and want to save it for later.
Note 2: Due to limitations with MATLAB code generation, the plugin is unable to save impulse responses directly as audio files at this time, but you can convert the binary files that the plugin creates to WAV files with the provided
bin2wav
orbins2wav
MATLAB scripts. In addition, saving will not work unless you specify the full path to the desired directory via theSAVE_IR_PATH
property value incomponents/@GeneticReverb/GeneticReverb.m
. Make sure that the plugin has write access to the specified directory as well.
See LICENSE for details.
18 November 2020