MATLAB: FreeverbReverberator example Plugin error

audio pluginAudio Toolboxfreeverbreverberator

Hi
I´m trying to use the FreeverbReverberator as part of a more complex plugin. When I test it through audioTestBench as MatlabCode everything ok, but when I try to validate it for plugin creation, the following error appears:
"Unable to perform assignment because the left and right sides have a different number of elements.
Error in audioexample.FreeverbReverberator/parallelComb (line 261)
in(1:end) = sum(drySignal,2); "
Debugging the FreeverbReverberator code, I could verify that this missmatch in number of elements happens after the 1st cycle. So I have two questions:
1) Why this doesn´t happen when running as .m?
2) Is there any way to fix it for plugin creation porpouse?
If someone can shed light on this, I´d appretiatted.
Thanks
Pablo
PS: Follows the simple code, just in case you want to reproduce the issue described above. Bear in mind the error is refered to FreeverbReverberator code.
classdef Freeverb < audioPlugin
properties
RoomSize=0.6
WetDryMix = 1;
end
properties (Access = private)
preverb
end
properties (Constant)
PluginInterface = audioPluginInterface('PluginName','Ambience Creator','VendorName','Orion',......
audioPluginParameter('RoomSize',...
'DisplayName','',...
'Mapping',{'lin',0,1},...
'Label','m',...
'Style', 'hslider'),...
audioPluginParameter('WetDryMix',...
'DisplayName','',...
'Mapping',{'lin',0,1},...
'Label','m',...
'Style', 'hslider'));
end
methods
function plugin=Freeverb
plugin.preverb=audioexample.FreeverbReverberator;
end
function out = process(plugin, in)
outrev=plugin.preverb(in);
out=outrev;
end
%%
function set.RoomSize(plugin, val)
plugin.RoomSize = val;
calculatesize(plugin)
end
function set.WetDryMix(plugin, val)
plugin.WetDryMix = val;
calculatesize(plugin)
end
function calculatesize(plugin)
plugin.preverb.RoomSize=plugin.RoomSize;
plugin.preverb.WetDryMix=plugin.WetDryMix;
end
%%
function reset(plugin)
reset(plugin.preverb);
end
end
end

Best Answer

Hi Pablo,
Audio plugin API requires plugins to support variable-sized input. The audioexample.FreeverbReverberator does not support variable-sized input. The validateAudioPlugin function exercises the plugin by inputting different size inputs, which is how you hit that error.
Consider using the reverberator object instead. You can use it within another audio plugin, or use createAudioPluginClass to convert it to an audio plugin.