RECORD AND LOOP

c4liam's icon

hi i have been trying to build a patch that records a bar of music that could be a varying length of time and then this bar of music is looped for an indefinite period. I want this process to be repeated 12 times so that in the end there will be 12 different bars of music being played and constantly looping.

problem I am having is with the buffer and I cant seem to get it to be flexible in terms of the length of recording I can do.

Hans Höglund's icon

Buffers represent a piece of allocated memory. It should be somewhat longer than the expected length of the bar. You can resize a buffer dynamically using the size message, see the documentation.

c4liam's icon

ok but i want the buffer size to be flexible not restricted to a size using a size message.basicially id want it possible for me to begin the recording and when i click stop it would then play and loop

brendan mccloskey's icon

If you haven't done so already, try searching this forum using the keywords from your original post; here's some examples of dynamically resizing buffers:

also look at the helpfiles for [poke~] and [count~]:

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

Brendan

Hans Höglund's icon

Do not confuse buffers with what is being played. The point of a buffer is to have a piece of pre-allocated memory that can be written to efficiently. You should, in general, always have some buffer overhead. Enlarging buffers while recording is a bad idea.

Objects that index buffers (e.g. play~ and groove~) will take arguments to determine which part of the buffer is actually played back (see links above).

FP's icon
Max Patch
Copy patch and select New From Clipboard in Max.

maybe it could help :