How to retrieve the length of a loaded sample?

Pvdn's icon

If i load a sample into a buffer, how can i know it's length? I see i can set a lot of stuff (lenght, samplerate) on the bufferobject, but not anything to get information from it.

Gregory Taylor's icon

You'd use the info~ object, as described in MSP tutorial 14.

Gregory Taylor's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Pedro Santos's icon

Have you seen my reply to your other recent topic? The included patch makes use of the info~ object in order to obtain the total length of the buffer...

Pvdn's icon

Ah, thanks. max/msp has been a while for me, i have to look up quite a lot and totally forgot about info~.

And i I hadnd't seen your message at the time, Pedro, i wasn't at a computer running max. Oh but wait, wasn't there a website that could draw max patches?