buffer~ size

artmusicsouth's icon

I am working on a looper wherein I want my various buffer~ objects to have a variable length. I want the length determined by how long someone actually plays/records a section of music rather than predetermine the length of the buffer size.

Should I use a message box with (size $1) or is there another way to come at this?

Rick's icon

You have to set buffer size before you record into it, resizing a buffer after you record into it erases the buffer.

Create the longest buffer you'd want to use then record a variable length loop within it.

jbl's icon

I came here because I am looking for a way to get the size of a buffer once it has stuff in it. Anyway... I just happen to know how to solve your problem so I figured I would help.

The idea is to start with a buffer longer than the actual recording. Once you have this, you need to time how long the recording was using a timer (timer or clocker object) Once the recording stops, stop the timer and then crop the buffer accordingly.

Note that I assume that you already have a system that will start and stop the recording based on how long someone plays. (signal amplitude)