I'm building a live setup with pd, and I want to have a tempo synced looper that's a constant number of bars behind the live playing, so that with one button I can switch from "live" to "looped", and it will loop the last x bars until I switch it back to "live". Has anyone seen something like this I can easily modify, or is this something I'm going to have to do from scratch?
-
Looking for very simple looper patch...
-
"Making it from Scratch" is kind of the point of Pd. If you do, you'll get EXACTLY what you want in the end, and you'll learn a HELL of a lot. that being said, you are not on your own. Start by looking into [delwrite~] and [delread~]. These are your basic delay buffer and playback objects. With enough ram, you can store quite a bit in a delay buffer. You may want to look into the math to convert BPM to milliseconds so that you can set a number of bars and tempo for the object that you create. Or, you can set up a timer to do a tap-temp thing. Start with [delwrite~] though, and read the documentation, come back when you get stuck!
-
Looking at delwrite~, is there a way to dynamically allocate x ms? I'd like to have a selector for 1 bar, 2 bars, or 4 bars, but they would each be a different value (eg, 2000, 4000, and 8000 @120bpm). It looks like delwrite~ has its size specified at creation time and can't be adjusted, if I'm reading the help correctly.
Edit:
Never mind. I see that you would use one delay line with the maximum length and use multiple delreads to grab just what you want. -
delwrite's arguments set the buffer size. For example: at 120BPM, a bar is: 1 beat(500ms) * 4 beats per bar = 2000 ms. Now, if you want the capability of playing back any length from 0 up to say, 4 bars, you set your delwrite to 8000ms. Then, you can change the delread's timne dynamically, say 4000ms for two bars. At this point, the delay buffer will play back in it's entirety, it just acts like a delay. If you want to make a looper, you'll have to feed the delread back into the delwrite.
Confusing? It is a little hard to think of delay buffers as "loopps" if you are used to sample-based manipulations. You can also do this with tabwrite~ and tabread~ (I prefer tabread4~), but it is a much different process and requires some fancy timing and understanding of order-of-execution.