Loop selection length in playlist~

lesespejo's icon

Hi,

I'd like to know the length, in samples, of a selection made in playlist~ object. I need it to record, with the help of pfft~, my loop in a jit.matrix, but I want that recording to be as long as my loop in playlist~ object.
Is there a way to know in samples the duration of a selection in playlist~ object ? or even better in frames ?

Hope this make some sense
Thanks in advance for any help

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

i don't know if you can with a simpler way, but it's def. possible thanks to the dict ouptut

the problem you may have is that it's a value between 0 an 1, you'll need to scale it manually depending on the actual size of your soundfile (can use sfinfo~ to get that)

lesespejo's icon

Thanks VICHUG,

I would think your suggestion points in the right way... Maybe there is a better solution, that's for sure, this is Max...

thank you

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

vichug's icon

a leaner approach would be getting duration of soundfiles from the dict output by playlist~ but it appears to be broken (it always shows originalduration as 0)

George Hudson's icon

Vary the values between 0 and 1 :)