VST Code generation issues with element-wise multiplication
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The following code produces audible discontinuities when compiled to a VST:
gains = [0.5, 0.725];
out = in .* gains;
But this works fine
gains = [0.5, 0.725];
out = [in(:,1) * gains(1), in(:,2) * gains(2)];
Is this a known issue with code generation?
0 Kommentare
Antworten (1)
VBBV
am 11 Nov. 2022
gains = [0.5, 0.725];
in = rand(8)
out = [in(:,1) * gains(1), in(:,2) * gains(2)]
out = in .* gains % check the matrix multiplication rule
3 Kommentare
Jimmy Lapierre
am 11 Nov. 2022
I was able to reproduce the issue. I will investigate further.
>> p=loadAudioPlugin('GainTest.dll')
p =
VST plugin 'GainTest' 2 in, 2 out
>> process(p,ones(4,2))
ans =
0.5000 0.7250
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
Please use the workaround in the meantime.
p.s. modifying the input in-place is allowed, so it could look like this:
function x = process(~,x)
gains = [0.5, 0.725];
x(:,1) = gains(1)*x(:,1);
x(:,2) = gains(2)*x(:,2);
end
Siehe auch
Kategorien
Mehr zu Audio Plugin Creation and Hosting finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!