How to stop a buffer from recording any more audio after it's recorded the full sample size

Remi LeJeune's icon

Remi LeJeune

6月 27 2024 | 3:28 午後

I'm very new to Max and I'm trying to make a patch that records individual clips when I hit a MIDI footswitch, which turns on and off a toggle. I cannot figure out how to make it that when the recording is done, it doesn't record any more audio onto that buffer.

does that question make sense?

Source Audio's icon

Source Audio

6月 27 2024 | 3:35 午後

Quesion makes sense, but you don't provide enough infos

about "inividul clips", how many, do you want to crop buffer(s) after recording and many other things.

describe in simple words what you want to do.

Remi LeJeune's icon

Remi LeJeune

6月 27 2024 | 3:43 午後

there's 4 clips that I want to record and be able to play back individually. Whatever was recorded, I want played back.

the sel 9 is detecting midi input

this is what I have at the moment. It was just my plan to copy and paste this 4 times with different buffer names.

also, the effect I'm trying to make is found here:

Where Jonny records each verse individually to be able to play them back at 4:09

Wil's icon

Wil

6月 28 2024 | 1:12 午前

I am also interested in SourceAudio solution.

Here is generic. Start record, auto stop.

Something more accurate using phasor to start/stop the record?

Max Patch
Copy patch and select New From Clipboard in Max.



Wil's icon

Wil

6月 28 2024 | 1:41 午前

...with phasor...

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon

Roman Thilenius

6月 28 2024 | 3:39 午前

count~/record~ and count~/play~ (or count~/index~) seems right, but as @wil says, to reach sample accurate synchronisation one should start and stop things using signals instead of messages.

Wil's icon

Wil

6月 28 2024 | 3:48 午前

I have been struggling with latency through the method above.

besides start/stop - there is this Rodrigo patch to decipher

Roman Thilenius's icon

Roman Thilenius

6月 28 2024 | 4:09 午前


what i forgto say say above: using 4 buffers in parallel also seems right. it does not need more CPU than writing at different positions into the same buffer, but is a better structure.

a tapping buffer would also be a solution to base a climax sequencer on it. it will kinda autoloop, but is more difficult to build and might raise new questions and has other limitations.

Source Audio's icon

Source Audio

6月 28 2024 | 7:34 午前

for any live situation, this looper must have flexible length

and maybe sync enabled.

just set 4 seconds length will not serve well .

I also doubt that many are well in keeping timing over 4 seconds time

and start not heard loop in the song later after whole band shifted tempo...

But if that is what you need, just start record~ in loop 0 - append 0 mode.

It will auto stop after recording is done ...

then you start playback when you want.

.......

count~ to several index / poke objects is maybe best solution

in case one also wants to overdub into loops.

You simply open gates for audio input and recording sample count to buffer channel that one wants to record into or play back in case this looper keeps going all the time.

latency compensation - run playhead xx samples ahead of recording/feedback head.

Latency can be measured well using latency tester patch, which max usually has somewhere in examples.

here simplest example:

DSP part of loopers is easy part, more work is the logic arround

controlling loops.

That is why I don't want to post any examples.

without knowing all details on how to use such looper, if overdubbing is needed,

undo, how to select looper for either recording or playback

if loop starts playback after recording is done or goes into mute state, etc etc.