massively stuck with circular buffer reverse real time sound thingy

Mike S's icon

i can't quite get this right in my head, i am sure there is a way to do this with just buffer~ count~ poke~ index~ but i cannae quite get there captain

had a look at some of the tapin/tapout things but can't figure them out, i'd like to understand them, not just copy paste.

any help greatly appreciated

Gregory Taylor's icon

Did "having a look at some of the things" include a little quality time with MSP tutorials 26 and 27 on delay lines? I think they're quite clear at explaining what's going on, and might at least provide a decent baseline for your next questions....

Tim Lloyd's icon

You can do the reversing with a [!-~ ] right before index~. Just send the length of the circular buffer into its right inlet and it will output the reverse sample index. I've made a couple of circular buffer patches with count~ poke~ and index~, and I've found them very interesting with modulated feedback loops (I'm still not entirely sure I couldn't do it all more simply just with tapin/out~, but ne'er mind.......it's interesting to experiment). You will run into clicking problems if the "record head" crosses the "play head" so to speak, which is likely with reverse stuff.

Gregory Taylor's icon

...but those clicks are features, not bugs.

Tim Lloyd's icon

: ) a bit of nicely timed glitch can sound great

Mike S's icon
Max Patch
Copy patch and select New From Clipboard in Max.

here's what i'm messing about with

Mike S's icon

Hi Raja thanks for taking the time to look at it

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

I've highlighted the problem with the clicks, most of the time this isn't that evident but with a sine tone its easy to hear

sixtin's icon

Hi Mike,

I can't get your patch to click/pop either. I created a simplified version here and I still can't get it to glitch:

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

Mike S's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hi Sixtin, this is my code from above with the sine wave but this time with a loadbang! I definitely hear clicking in the reversed (right) channel, which must be from the write head crossing the read head or something like that. i have on one occasion had no clicking but i presume that was a fluke as i've tried many combinations of vector sizes. obviously doing this with the count~ method is going to require a bit more than this simple approach

jonnyfive's icon

Cool patch!

At least some of your clicking (that at the "loop points") is simply caused by waveform discontinuities, which are exaggerated by the choice of such a pure source, I tried a few samples in your original patch and did not here any clicking.