oops please delete :)

ianjojo's icon

I had this idea for a realtime granular device that would record using record~ @loop 1 into a buffer that's, say, a 1/16th note long. And then to have a granular gen patch which is listening to the same buffer and spitting out grains. It works, in theory, but of course due to the buffer constantly being overwritten by new data, I'm getting some strange metallic glitchy distorted sounds occasionally.

I'm trying to wrap my head around the best way to accomplish this without these glitches.

Started imagining a ping-pong system where I have two buffers (A & B) and one of them is recording while the other is playing back, and then they swap their roles, but I can't seem to figure out an eloquent way to make this work.

Or perhaps, am I missing something and there is perhaps a way to do this without the double buffer system? I spent some time tonight messing with the sync out from record~ thinking maybe I could detect the edge there and use that to smooth out the glitches. I also can't be sure that the glitches are only occurring at the end or beginning of the buffer.

A stripped down version of this idea is attached in the form of a max4live patch. Any advice would be greatly appreciated! You'll just need to turn up the Grain Size and send some audio out from Ableton to hear what I'm talking about. It's exceptionally noticeable if you scrub around via the position slider.