Stumped with Gen~ problem

Nov 24, 2011 at 8:23pm

Stumped with Gen~ problem

I’m driving a system with a phasor~ and I’d like to live-record a loop. I’m thinking something similar to ableton live where you hit record and when the phasor~ rolls around to 0 it starts recording, then when the phasor~ rolls around to 0 again it stops recording and starts playing.

***I’m @#$%ing stumped***

I could probably fake it in MSP but I’m trying to learn gen~.

This seems very tough to do in a sample accurate way. Any ideas?

Nov 25, 2011 at 7:57am

Somethin like this maybe, (though there’s probably more efficient ways… i’m thinking), at least it’ll help get started:

– Pasted Max Patch, click to expand. –

Other ideas:
•Maybe you want it to play through while it’s recording, then you probably could use 2 buffer~s and swap them around
•If you’d prefer to only record, not continuously on and off as in the above patch, but based on a trigger that waits for the next phasor~ ramp, you could incorporate sah within gen~
•Overdubbing would be a simple matter of building a version of the ‘endless resampling’ patch directly within gen~:
•If you’d prefer the phasor~ reside outside of gen~ for better modularity, you could use an external master phasor~ that triggers different rate~ objects or triggers count~ at the beginning of a ramp

Always good to see ya, Matt! Would love to see whatever you come up with. :)

Nov 25, 2011 at 6:07pm

This is some interesting work. The trick (for me) is getting this all to happen once and not repeat. You’ve given me ideas. I’ll update you soon.

Nov 27, 2011 at 7:59pm

This is not a gen~ solution, so it won’t help you in your quest to learn gen~, but this patch does what you describe in straight MSP. Note that for the phasor~ to truly lock to the transport, the scheduler has to be in Audio Interrupt mode (which is the function of the set_dsp_takeover subpatch). You could make adjustable-length loops with just a little modification, but I hard-coded this example to record one measure of 4/4 for simplicity’s sake.

– Pasted Max Patch, click to expand. –
Nov 29, 2011 at 7:14am

Hi there,

Here’s a gen~ based bar-synchronized looper. Have fun tweaking it!

– Pasted Max Patch, click to expand. –
Nov 29, 2011 at 4:59pm

wow that’s simple.

Jan 17, 2012 at 11:09pm

I just noticed that this went into the examples folder. There’s a bug. It doesn’t play back at the right rate. Here’s my work around

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.