Hi, new-ish to SC and struggling to implement a basic variable length sampler/looper. I can allocate a buffer with some maximum length, then record into it with RecordBuf ugen. But when my recorded loop is shorter than the max buffer length, what is the best strategy to constrain the buffer to just the recorded material and ignore/trim the empty space that follows? Can I return the index of the last frame recorded into the buffer, or keep track of clock time at start and end of record (then convert to num of frames)?
I allocate a 30 sec. buffer. User hits REC and records 8 seconds of audio, then hits STOP/LOOP/whatever. How to accurately know the endpoint of recorded audio so I can loop just the 8 seconds, not the whole buffer?
Many thanks in advance,