VST Code generation issues with element-wise multiplication
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
VBBV
le 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 commentaires
Jimmy Lapierre
le 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
Voir également
Catégories
En savoir plus sur Audio Plugin Creation and Hosting dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!