Stereo Convolution Reverb (VST audio plugin)

130 次查看(过去 30 天)
Dear everyone
I am trying to generate vst, simple convolution reverb.
What is wrong?
classdef Stereo_Convolver_Basic < audioPlugin
properties (Constant)
% audioPluginInterface manages the number of input/output channels
% and uses audioPluginParameter to generate plugin UI parameters.
PluginInterface = audioPluginInterface(...
'InputChannels',2,...
'OutputChannels',2,...
'PluginName','Stereo Convolver'...
);
IR = audioread('./IR/st_georges_far.wav');
PartitionSize = 1024;
end
properties(Access = private)
pFIR_L = dsp.FrequencyDomainFIRFilter('Numerator', plugin.IR(:,1).', ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
pFIR_R = dsp.FrequencyDomainFIRFilter('Numerator', plugin.IR(:,2).', ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
end
methods
function y = process(plugin,u)
x = u(:,1)+u(:,2);
x = x * 0.5;
yL = step(plugin.pFIR_L,x);
yR = step(plugin.pFIR_R,x);
y = [yL,yR];
end
end
end
  1 个评论
Satoshi Suzuki
Satoshi Suzuki 2018-9-17
This is the Error Message
Error using audio.ui.AudioTestBenchModel/setupSUT
Input to audioTestBench must be a valid class on the MATLAB path.
Error in audio.ui.AudioTestBenchModel
Error in audioTestBench (line 73)
singleInstance =
audio.ui.AudioTestBenchModel(plugin,inputname(1));

请先登录,再进行评论。

回答(1 个)

jibrahim
jibrahim 2018-12-10
Hi Satoshi,
You can't set your FIR filters in the private properties block like that. One way to do this is to set them in an object constructor instead:
classdef Stereo_Convolver_Basic < audioPlugin
properties (Constant)
% audioPluginInterface manages the number of input/output channels
% and uses audioPluginParameter to generate plugin UI parameters.
PluginInterface = audioPluginInterface(...
'InputChannels',2,...
'OutputChannels',2,...
'PluginName','Stereo Convolver'...
);
IR = audioread('./IR/st_georges_far.wav');
PartitionSize = 1024;
end
properties(Access = private)
pFIR_L
pFIR_R
end
methods
function plugin = Stereo_Convolver_Basic
plugin.pFIR_L = dsp.FrequencyDomainFIRFilter('Numerator', plugin.IR(:,1).', ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
plugin.pFIR_R = dsp.FrequencyDomainFIRFilter('Numerator', plugin.IR(:,2).', ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
end
function y = process(plugin,u)
x = u(:,1)+u(:,2);
x = x * 0.5;
yL = step(plugin.pFIR_L,x);
yR = step(plugin.pFIR_R,x);
y = [yL,yR];
end
end
end

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by