I would like to create an averaging filter that takes the last x samples and output their mean/average value.
Can this be done in vanilla?
Would the overlap factor of block~/switch~ be usefull? (What is its use generally speaking?)
Is there a way to run this filter with the use of a gaussian or another arbitrary curve to calculate the average output?
Any help welcomed!
block~/switch~ overlap and averaging filter
@barbouze The [env~] object provides the RMS value of one block of audio data scaled 0 to 100
in dB (the average of the block), while [snapshot~] gives the instantaneous value of the last sample in the
So the average given by [env~] depends on the block size. Normally 64, it can be reduced even to 1 (in theory), and then [snapshot~] could be used, but that is not what you are looking for.
See 2.4.4 in https://puredata.info/docs/manuals/pd/x2.htm
Well, I didn't think of using [env~] this way but theoretically this could work (and be computationally expensive) if:
- I set [block~] in a way that it produce 64 blocks sent per block received, with each block sent delayed by one sample. Would that be [block~ 64 64 1], [block~ 64 64 64] or [block 4096 64 64]?
- [env~ 64] could then process the average of those 1 block/64 samples received and at the same time keep up at sample rate as it is under heavy fire then I could use [snapshot~] to get the polarity right, as [env~] only sends [0-1]. Not sure if this would be nice to hear though.
Anyway, I think it's time for me to let go the rule I set for myself about vanilla only/no externals as there is exactly what I need in cyclone with [buffir~]
Thanks for your insight!