smoothing discontinuities in continuously writing buffer

Jason Charney's icon

Hi everyone,

I'm building an effect that writes live audio input from a saxophone to a [buffer~] continuously and then outputs grains of varying size (using Nathan Wolek's [grain.pulse~] from his granular toolkit http://www.nathanwolek.com/tag/granular-toolkit/).

The problem is that if a new grain is selected and it happens to be where the buffer is writing, there could be huge jumps in amplitude/across zero crossings and create audible pops.

I've used this effect before but in pieces that didn't have continuous sound coming in (IE percussion pieces) so the effect was masked or not an issue.

I'm at a loss to think of an elegant way to get random sized grains and while smoothing the discontinuity in the continuously-updating buffer…any ideas?

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

Sample attached with [bpatcher demosound] as input.

antialias's icon

I'm working with a system that uses two buffers that are alternately filled by two record objects. Two play objects refer to these buffers. When buffer 1 is being written into, play object 2 plays and vice versa. The outputs from these play objects are crossfaded, triggered by the the sync outs from the record~ objects and edge~. I can post a somewhat messy and uncommented patch if you like…

Jason Charney's icon

Antialias, that sounds like a good solution. Would you mind posting your patch?
thanks!

antialias's icon

here you go-- attaching all necessary abstractions and 3rd parties i think...

crossfade-buffers-140423.maxpat
Max Patch
play180-140412-1.maxpat
Max Patch
mixer20.maxpat
Max Patch
3rd-party.zip
zip
antialias's icon

plus the crossfader courtesy Gerhard Eckel

crossfader.maxpat
Max Patch
Roman Thilenius's icon

or build it based on tapin~ instead of buffer~.