Code generation error while using the Audio Toolbox
Mostra commenti meno recenti
Hello,
I was wondering if someone could help me understanding why I get the following error while trying to generate the standalone executable of an audio plugin using the Audio Test Bench.

I am using features from the Audio Toolbox and the DSP Toolbox. In particular, I am using the dsp.FilterCascade function, and I get this error:
"Changing the size on input 1 of Sysremobject dsp.FilterCascade is not allowed without first calling the release() method."
In the considered implementation EQ1 is a property,
properties (Access = private)
width = 2.75;
flag = 1;
sizePre = 0;
EQ1 = [];
EQ2 = [];
DRC = [];
DRL = [];
end
and then is set as a dsp.FilterCascade.
plugin.EQ1 = dsp.FilterCascade(highpass, lowshelf, parametric, ...
highshelf, lowpass);
The line giving the error is the following one:
y_EQ1 = plugin.EQ1(x);
This line is inside the plugin process function:
function out = process(plugin, in)
...
...
y_EQ1 = plugin.EQ1(x);
...
end
As suggested by the error message, I have tried to call the release method just before evaluating y_EQ1 = plugin.EQ1(x),
function out = process(plugin, in)
...
...
release(plugin.EQ1);
y_EQ1 = plugin.EQ1(x);
...
end
but I get another error message and the plugin now produces a crackle. I am supposing this is due to the fact that it cannot work in real time with such modification.
The error message printed on the command window while trying to generate the standalone executable is the following one:
??? Cannot compute constant value for argument #2 for this System object constructor. All
arguments to the constructor of this System object must be constants for code generation.
One way to supply a constant value is to pass it to the main function using Simulink
non-tunable parameters (for MATLAB Function block) or coder.Constant(...) (for MATLAB
Coder).
Error in ==> PiezoSoundEnhancerV3 Line: 172 Column: 24
Code generation failed: View Error Report
This is line 172:
[B, A] = designVarSlopeFilter(slopeHighpass, ...
cutoffHighpass, "hi", "Orientation", "row");
highpass = dsp.SOSFilter('Numerator',B,'Denominator',A);
Thanks a lot for your help.
Best Regards,
1 Commento
Denis Gurchenkov
il 7 Ott 2022
Hi Alberto, this behavior does not look correct, though it is hard to say something definitive without seeing the entire example. I wonder if you could contact MathWorks technical support and open a ticket?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Audio Plugin Creation and Hosting in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!