buffer~: How to import a sample without defining samplelength

Yiannis Ioannides's icon

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.

Yiannis

Dave Mollen's icon

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?

Luke Hall's icon

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.

Yiannis Ioannides's icon

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.

Yiannis Ioannides's icon

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

Thanks folks!