Forums > MaxMSP

buffer~: How to import a sample without defining samplelength

Aug 11 2011 | 2:15 am

Hello everyone,

I have a patch where I have a buffer~ and a groove~, and I want to be able to import samples without having to define the samplelength (in ms) everytime, as an optional argument.

I suspect that it has something to do with the 7th outlet of the info~ object, which is Total Time (ms).

Thanks guys.


Aug 11 2011 | 9:22 am

Hello Yiannis,
If you don’t define the samplelength it will automatically load the whole file into the buffer.
If you want to know the length of the file send a bang into info~.
Or is it something else you want to do?

Aug 11 2011 | 9:48 am

If you use the "replace" message (instead of the "read" message) to load your file it will automatically resize the [buffer~] to the file length every time a file is loaded.

Aug 11 2011 | 2:38 pm

Thanks Dave, that is correct: I want to load samples with various samplelength, but whenever I load a sample and have not defined the optional argument of the samplelength, I get a really high-pitched noise, it’s like it’s really a really small fragment of a second, from the sample.

Luke, that’s what I originally had: a [dropfile] with a {prepend replace} object, straight to the [buffer~], and for other patches, I never bothered defining the samplelength, but since I have a very different setup on this one, it’s seems that I am back to square one.

Aug 11 2011 | 2:39 pm

Actually guys, it worked. I… think I just had to restart my computer.

Thanks folks!

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

Forums > MaxMSP