cross-platform Ambisonic VST, LV2 plug-ins with variable order for use in Digital Audio Workstations like Reaper or Ardour or as Jack standalone applications
GNU General Public License v2.0
235
stars
34
forks
source link
"ambiX warp" crashes when ambi I/O order is set to zero #31
after building the plug-in and loading it in Reaper the plug-in crashes Reaper when either the "Ambi In order" or "Ambi Out order" is set to 0. I think there is a bug in the "ShChebyshev.cpp" (for me line 52 and 53):
sinus(1) = -sin(phi); // for mtx_sph_h compatibility use -sin
cosinus(1) = cos(phi);
If order is 0 there will be no 1st but only the 0th element since sinus and cosinus are defined as an n_max+1 = 1-length-array:
Could I just wrap it inside a condition catching the case order 0 or will this change something dramatically in further computations? The code would be:
sinus(0) = 0.f;
cosinus(0) = 1.f;
if (n_max > 0){
sinus(1) = -sin(phi); // for mtx_sph_h compatibility use -sin
cosinus(1) = cos(phi);
// chebyshev recursion for multiples of argument
for (int i = 2; i <= n_max; i++) {
cosinus(i) = 2 * cosinus(1) * cosinus(i-1) - cosinus(i-2);
sinus(i) = 2 * cosinus(1) * sinus(i-1) - sinus(i-2);
}
}
Hi,
after building the plug-in and loading it in Reaper the plug-in crashes Reaper when either the "Ambi In order" or "Ambi Out order" is set to
0
. I think there is a bug in the "ShChebyshev.cpp" (for me line 52 and 53):If order is
0
there will be no 1st but only the 0th element sincesinus
andcosinus
are defined as ann_max+1 = 1
-length-array:Could I just wrap it inside a condition catching the case order
0
or will this change something dramatically in further computations? The code would be:Thank you!
Best, Nils
PS: Crash report: