Convolution Reverb audio plugin
20 views (last 30 days)
Show older comments
Lorenzo Lellini
on 9 Jun 2021
Commented: Lorenzo Lellini
on 12 Jun 2021
Hello.
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
% affected
%
% 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=H.*WET+DRY;
y_time = ifft(Y);
y = Output_Gain*y_time;
end
0 Comments
Accepted Answer
Brian Hemmat
on 9 Jun 2021
Hi Lorenzo,
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:
Best,
Brian
0 Comments
More Answers (1)
See Also
Categories
Find more on Audio Plugin Creation and Hosting in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!