SVF~ Gen filter examples differ from MSP counterparts

AudioMatt's icon

I just tested svf~ against the gen example of svf hoping they would phase. The pitch of the filters is actually different. Maybe a quartertone or so?

I'm attempting to port a patch to gen and I'm wondering if the MSP filter algorithms could be made open source? Anyone have any clue why they're so different?

Max Patch
Copy patch and select New From Clipboard in Max.

Graham Wakefield's icon

Wow nice find -- it's a bug in the gen~ SVF gen expr code. Fixed in the next whatsit. In the meantime, instead of

2*sin(pi*freq/samplerate);

it should be:

sin(2*pi*freq/samplerate);
toothpaste's icon

as of 7.3.5
the line is still:
2*sin(pi*freq/samplerate);
from this it is evident that 'whatsit' means the next century

slo ~|•'s icon

As of 8.0.2
the line is: f1 = sin(twopi*freq/samplerate);
so, the next century is here, if unevenly distributed

AudioMatt's icon

FWIW, to anyone still troubleshooting this, the gen version uses a Q that's off by an order of magnitude from the original.

[svf~ 100 .4] should be svf(100 4) in gen... at least I think.