Hello!
I like to use [vcf~] as a ringing/decaying oscillator, so I made a patch (attached) to analyse [vcf~], in the hope of feeding the analysis data to some surface-fitting software to find an equation for decay-time and peak amplitude from filter frequency and Q settings.
The patch is designed to be run in batch mode like:
$ pd -r 44100 -batch -open vcf_analyser.pd
with the output saved to "vcf_analysis.txt", so if you want to check out how it works then load it with 'pd -noloadbang'. On my machine it takes a few minutes to analyse a few hours of audio.
But the output was really rather strange, with peaks and troughs where I didn't expect to see any (red in the attached graph of decay time in ms vs frequency in midi note numbers).
I suspected accumulating floating point rounding error might be to blame, so I did further testing, and it turns out that rounding error is indeed the cause: with a [vcf~] using 'double' internally instead of 'float', the graph is *much* more regular (green in the attached graph).
Attached is the source code 'vcf~.c' modified from 'pd-0.42-5/src/d_osc.c' source code, I compiled it on Linux with:
$ gcc -std=c99 -Wall -pedantic -O3 -fPIC -shared -o vcf~.pd_linux vcf~.c -lm
If you are using a version of Pd that supports aliasing internal objects (like recent Pd 'vanilla', but not Pd 'extended'), you can just use it by adding '-lib vcf~' to your Pd start command (or prefs).