Forums > MaxMSP

reading sample length in buffer~


nit
October 12, 2008 | 11:51 pm

how can i display the length (in ms) of a loaded sample into buffer~?

like this:

read
|
[buffer~ sample1 10000]

i wan’t to know and to have displayed what the sample length of the loaded sample is.


October 12, 2008 | 11:59 pm

Look at [info~ sample1]



nit
October 13, 2008 | 12:34 pm

now i get the sample length set in buffer. in this case 10000 ms.
the sample loaded is shorter, i wan’t that length. wich is variable offcourse because of different samples.



nit
October 13, 2008 | 12:47 pm

if i don’t specify a length in buffer~ i getthe actual length of the loaded sample so that’s solved but the problem is that if i change sample info doesn’t change. it only outputs info of the first loaded sample.


October 13, 2008 | 1:08 pm

hi,

use the "replace" message, not "read".

cheers

g

2008/10/13 wit

>
> if i don’t specify a length in buffer~ i getthe actual length of the loaded
> sample so that’s solved but the problem is that if i change sample info
> doesn’t change. it only outputs info of the first loaded sample.
>


October 13, 2008 | 1:33 pm

If you use the message "read 0 -1" to load a file into [buffer~] it resizes itself automatically, which you will be able to see in [info~]. Have a look in the [buffer~] reference file to see why.

lh



nit
October 13, 2008 | 2:10 pm

thanks, didn’t think about that. replace did the job.


Viewing 7 posts - 1 through 7 (of 7 total)