So I've been rebuilding the core parts of my main performance max patch slowly and I've finally come to the gnarliest part of my code, that needs the most amount of reworking. The main looper/sampler.
I've been using a groove/poke combo for a few years now as the main looper and it kind of does what I want, but it's not perfect and adding some new features puts me into new territory for me, so I decided to ask the forum for help here.
First, what the basic spec is:
-a varispeed dynamically sized looper than can overdub
-can change speed/direction while recording
-can jump arbitrarily while recording
So my looper does that now, though it doesn't declick all of those things.
Things I want to add, and have no idea how to approach:
-oversampled (so halfspeed still sounds crisp)
-play "past zero" (as in play forward from 0.9 to 0.1 in a loop)
-not click anywhere (at start/end, while jumping/recording)
-The undo layers I have literally now idea how to go about that. I'm presuming you record to separate buffers and have them playback simultaneously but that seems quite messy and hard to sync.
-Oversampling I kind of understand, just stick it in a poly~, but where I'm fuzzy about is the math. In my looper below I'm driving poke via groove's sync outlet by multiplying it by the total samples in the buffer. When oversampling, do you put the buffer inside the poly~ and adjust the math so it's twice as much? (ie a 1sec buffer would have 88200 samples in it?).
-The "play past zero" thing has kicked my butt for a bit as groove does not work that way at all, which leads me to believe that I need a different playback/interpolator. But which?
-The 'declicking' is a multilayered problem, so no clear answer here.
Any help/suggestions in terms of objects/approaches would be welcome.
Here's a basic version of the looper I use. This is quite old and the code has changed a bit since then, but it's so entangled with other bits of code it's easier to just put this isolated code here.