Simple live loop sequencer tutorial needed


    Sep 24 2018 | 3:28 pm
    Hi I am looking for an introductory tutorial on bpm/quantization in Max or PD, in the context of live loop overdubbing. At the risk of sounding too vague, I would like to quantize note/hit live input to a user-specified bpm and time signature. I freely admit that I already have the chops to build something from the ground up, but to be brutally honest, I don't have the time. This relates to a specific DMI request from a disabled musician I am working with atm on a tight time schedule. I am aware of the extensive work already done in the area of live looping by, for example, Rodrigo Constanza. But I'm hoping for suggestions re "how to bpm-division sync live input to a loop sequencer, for n00bs". This would allow the user to build melodic and percussion loops on a per-note/hit basis. Yes, this is easy to achieve in Ableton Live, but I'd like to keep the system open, hackable, accessible and free. In this *very* early prototype I'm already using an arcade joystick --> MultiControl --> PD --> Ableton. I'd like to trim it down and refine it (joystick to Max/PD): https://www.facebook.com/BrendanMcCloskey62/videos/2163122364008197/
    Thanks Brendan

    • Sep 24 2018 | 10:09 pm
      Hey Brandan, you are very vague concerning your question. I assume you want to record audio in realtime and loop it. Please provide an example of what you want to achieve exactly. As I assume you can not achieve this with a classic looper - so what is it that you need in addition.
      BR
      Jo
    • Sep 25 2018 | 6:55 am
      Sorry if you think I am vague, I thought I was fairly explicit. I'm looking for guidance on how to insert and quantise hits/notes into a live looping buffer.
    • Sep 25 2018 | 8:38 am
      Brendan,
      assuming that you want to have a reatime live looping audio quantization functionality for short percussive audio elements here are my thoughts:
      This exercise is a lot about audio analysis to I would try to do this in GEN with CODEBOX code as you will need to do some programming. If I were you I would try the following:
      1. Quantization counter / grid: First of all you need a quantization grid. I would implement it this way: Let a counter continuously run from 0 to 441000. this would be 10 seconds of sound. This is your master quantization length. If you have a 4/4 time signature every 2.5 seconds there is a beat.
      So this is the basis for the next step:
      2. "Hit" & grid identification: As a precondition I would run another counter that counts from the beginning to the end of all the recordings. All audio that will come in will need to be recorded and analyzed. First step would be identifying the start and the end position of a "hit". Then when a certain audio threshold is reached the start position (counter position) would be stored. In addition you need to store the current position of the quantization counter (from step1). When the sound is fading out and the threshold is reached again the end position (counter position) of the "hit" is stored. So at the end of this you would have an array that looks like this:
      sampleNumber, sampleStart, sampleEnd, gridPosition; 1 4500 25000 300000
      3. Quantization: Now the last step is pretty simple. You need to realign the sample start position according the grid. To do so you need to write a function that gets the start position as an input and provides the exact position according to the grid. Below you will find a piece of code that I was using already. So in this example variable a would be 441000 (as this would be your size of the quantization grid) and b would be 300000 (as this is the grid position for your "hit). If you feed this example in the Slave_Size is 330750 and this is also the position on the quantization grid. // play slave loop // calc slave size to match master size a = Store_MasterLength; b = Play_Length; if (a > b) { while (a > b) a = a / 2; if (b > (a*1.5)) Size = a*2; else Size = a; } else if (a < b) { while (a < b) a = a * 2; if (b < (a*0.75)) Size = a/2; else Size = a; } else if (a == b) Size = a; Slave_Size = Size;
      3. Writing the "hit" in the buffer: last step is to write the hit to the buffer. Now you have all the information needed: Take the audio from the buffer your recorded (positions are already known sample start 4500; sample end 25000) and write it to the quantized buffer from position 330750 onwards.
      So you would need to get your hands dirty with gen and this will take some time but in my experience it can be done with gen programming.
      BR
      Jo
    • Sep 25 2018 | 2:50 pm
      Hi Jo and thanks, this lays out the concept in a fair amount of detail, I'll have a go at it using MSP and PD, before trying gen, although I doubt that I would need sub-millisecond accuracy that gen offers; plus my (textual) coding chops aren't great.
      Thanks again