Arrays and For loops for DSP in genExpr
In the following forum post, I found a Schroeder Reverb written completely in genExpr:
and I saw that the allpass filters and comb filters are described in the following way:
ap1 = allpass(sig, 0.7, 347 * size);
ap2 = allpass(ap1, 0.7, 113 * size);
ap3 = allpass(ap2, 0.7, 37 * size);
fc1 = fbcomb(ap3, 0.773, 1687);
fc2 = fbcomb(ap3, 0.802, 1601);
fc3 = fbcomb(ap3, 0.753, 2053);
fc4 = fbcomb(ap3, 0.733, 2251);
I see this kind of approach in all genExpr codes. But can't we write this something similar to this? (ignore vec since it doesn't work in gen dsp apparently, take it as a pseudo-code):
dtimes_AP = vec(347, 113, 37);
gains_Comb = vec(0.773, 0.802, 0.753, 0.733);
dtimes_Comb = vec(1687, 1601, 2053, 2251);
fc = vec();
for(i=0; i<=2; i+=1) {
sig = allpass(sig, 0.7, dtimes_AP(i) * size);
}
for(i=0; i<=3; i+=1) {
fc(i) = fbcomb(sig, gains_Comb(i), dtimes_Comb(i));
}
In addition, array structures are not available on genExpr. Doesn't this create an extreme handicap, how do you all overcome this?
Sidenote: I also would appreciate if anyone has an online resource for genExpr Syntax. The documentation doesn't seem to cover all the capabilities.