Convolution Reverb audio plugin
7 views (last 30 days)
My idea is to create a simple convolution reverb audio plugin. I have chosen a nice Impulse response and I wrote a function script. It works and I would convert the function script in an audio plugin. For the moment I'm working with mono audio, but I will convert to stereo.
My only problem is that I have to specify also the Impulse Response as input in the function. I would find a way to "store" the IR (or more than one IR) inside the function in order to give only the audio and the parameters as input.
The IR is a too long vector and I can't explicitly write in the function code, I actually have it as a variable.
Have you any idea?
function y = ConvReverb(IR, Audio_Input, Input_Gain, Output_Gain, DryWet)
% Input and Output gain between 0 and 1. If you put 1 the volume is not
% Dry/Wet percentage between 0 and 1
% "length(IR)+length(Audio_Input)-1" is the conv length between x and h
x = Input_Gain*Audio_Input;
d = DryWet;
wet = d*x;
dry = (1-d)*x;
H = fft(IR, length(IR)+length(Audio_Input)-1);
DRY = fft(dry, length(IR)+length(Audio_Input)-1);
WET = fft(wet, length(IR)+length(Audio_Input)-1);
y_time = ifft(Y);
y = Output_Gain*y_time;
Brian Hemmat on 9 Jun 2021
My understanding is that you are developing a function but eventually want to convert it to an audioPlugin object. In that case:
Take a look at the pattern in audiopluginexample.FastConvolver. It defines a property to hold the impulse response. In general, the plugins in the plugin gallery cover a number of common patterns: