pCompiledNumChannels error in audio plugin generation
显示 更早的评论
Hi
I´m trying to use crossoverFilter function as part of a more elaborated signal process plugin, but I find the following error message when I try to generate the audio plugin:
"Failed to compute constant value for nontunable property 'pCompiledNumChannels'. In code generation,nontunable properties can only be assigned constant values".
No issues at all when I run it through audioTestBench, but it does when I try to compile.
The code is really long, but as an example, I reproduce the same with a basic code attached. So, even when this one is not useful at all, I think help to reproduce the error easily.
classdef (StrictDefaults)CrossTest < matlab.System & audioPlugin
% CrossOver plugin test
properties
FCross=100;
end
properties (Constant, Hidden)
% Define the plugin interface
PluginInterface = audioPluginInterface( ...
'InputChannels',2,...
'OutputChannels',2,...
'PluginName','CrossOver Test',...
audioPluginParameter('FCross', ...
'DisplayName', 'Frequency Cutoff', ...
'Mapping', { 'int', 20, 18000}, ...
'Style', 'rotaryknob'))
end
properties (Access = private)
xFilt;
NumCrossovers = 1;
hpf;
pSR;
end
methods
% Constructor
function plugin = CrossTest
fs = getSampleRate(plugin);
plugin.xFilt=crossoverFilter("SampleRate",fs,"NumCrossovers",1,"CrossoverFrequencies",100,"CrossoverSlopes",6);
plugin.hpf=dsp.HighpassFilter('FilterType','IIR','PassbandFrequency',300,'StopbandFrequency',100,'StopbandAttenuation',40); % <<--- Agregado
end
function set.FCross (plugin,val)
plugin.FCross=val;
plugin.crossdesign;
end
end
methods(Access = protected)
%% OUT
function out = stepImpl(plugin, in)
infilt=plugin.hpf(in); % Filter the input signal
[O1,O2]=plugin.xFilt(infilt); % CrossOver the filtered Signal
out=O1+O2;
end
function resetImpl(plugin)
reset(plugin.xFilt);
end
end
methods (Access = private)
function crossdesign(plugin)
plugin.xFilt.CrossoverFrequencies=plugin.FCross;
end
end
end
I would really appreciate if someone give me a hint about how to overcome this.
Thanks
Pablo
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Audio Plugin Creation and Hosting 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
