Stumped with Gen~ problem

    Nov 24 2011 | 8:23 pm
    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 | 7:57 am
      Somethin like this maybe, (though there's probably more efficient ways... i'm thinking), at least it'll help get started:
      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 | 6:07 pm
      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 | 7:59 pm
      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.
    • Nov 29 2011 | 7:14 am
      Hi there,
      Here's a gen~ based bar-synchronized looper. Have fun tweaking it!
    • Nov 29 2011 | 4:59 pm
      wow that's simple.
    • Jan 17 2012 | 11:09 pm
      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