Overdubbing with a buffer that stretches on playback

leemorgan's icon

I've built a sampler that records a bar of music, loops it, and with each repetition plays back slightly slower.

It's been easy until now: just using record~ and ~groove with timestretch decoupled as per the maxhelp file. Works fine.

BUT - I'd like to be able to then overdub new sounds onto the loop as it plays - that are heard live (once) then in their increasingly stretched version (on each subsequent repetition of the loop), building up in a sound-on-sound kind of way.

I don't mind if, rather than the stretching of the loop being smooth, it jumps by a certain amount with each whole repetition. If that helps? At the moment it's a smooth stretch, via line 0: but I'm happy for it not to me.

I've read lots on the forum that seems to insist on using ~poke and ~index - but is there no easier way? These objects frighten me.

I'm also messing around with swapping between two different buffers that are recording into one another - is that more sensible?

I'd be glad of some advice of which road to go down...or directions to a better road, if I'm over-complicating the problem.

Thanks,

Lee

Andrew Pask's icon

I tend to do this sort of thing in the poly~ object. 1 voice for each loop recorded into a polybuffer~, along with an initial "realtime" recorded length somehow ( in a dict?) so you know how to adjust playback speed when you want to match them all up.

This way you get the flexibility of being able to change the total playback speed relative to any of your loops rather than get stuck with something which has been overdubbed or mixed into a single track.

Cheers

-A

leemorgan's icon

Thanks Andrew - that's really kind of you, but perhaps it's too complicated for me: if I promised to be more than happy with one loop, and be stuck with whatever I overdub onto it, is there an easier way?

Or is it definitely an advantage to have 100 buffers (or more) in a polybuffer~ even if they're only played once each, and never looped?

I guess the complication is: recording on to a buffer whilst it's being read (and stretched) is impossible, so whatever I do will HAVE to involve more than one buffer, and bouncing between them - or even bucket-brigading them. Is that right?

Andrew Pask's icon

Yeah, you will need to mix and record into another buffer. It's exactly this process which led me to the polybuffer~ way of doing it. Once you start overdubbing into a single buffer you lose control of the mix. With voices in a poly~ and polybuffer~ you can do gain control and limiting or whatever per loop voice, mute single loops, do individual pans and playback speed controls and the like. It is a bit more fiddly, but not much.

Lemme see if I can unspaghetti-ize this thing.

-A

leemorgan's icon

Thanks Andrew - yes, it's the invisibility of poly~ / ~polybuffer that baffles me a little. I like to see what's attached to what....