Forums > MaxMSP

reading to specific location in buffer~

June 6, 2007 | 8:14 pm

hi list,

this is probably a really basic question but i had a hard time finding an answer. is there way to read an audio file to a specific location within a buffer~? i know this can be done with the record~ object, but if I have many audio files that I simply want to load consecutively into one buffer, is there a way to specify that start time of each? for instance, 001.wav begins at 0, 002.wav begins at 5000, etc.

thanks in advance, and my apologies if this is already posted elsewhere!

best,
daniel


June 7, 2007 | 10:38 am

Hi Daniel,

Is there any reason you could not mix all of your component sounds into a larger composite sound file, and then load that file into a single buffer?

Best,
Eric


June 8, 2007 | 2:09 pm

The only way I can think of is like this:

#P newex 268 73 41 196617 * 44.1;
#P flonum 268 55 46 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 123 298 27 196617 +;
#P newex 123 256 29 196617 t b f;
#P newex 123 276 27 196617 i;
#P newex 152 210 27 196617 t i i;
#P newex 123 320 60 196617 peek~ main;
#P newex 152 189 27 196617 – 1;
#P newex 122 169 40 196617 uzi;
#P newex 141 149 41 196617 * 44.1;
#P newex 122 127 29 196617 t b f;
#P newex 122 101 105 196617 info~ temp;
#P message 122 58 43 196617 replace;
#P newex 122 76 69 196617 buffer~ temp;
#P newex 123 233 61 196617 peek~ temp;
#P newex 123 356 101 196617 buffer~ main 10000;
#P comment 323 55 62 196617 offset (ms);
#P connect 11 0 2 0;
#P connect 2 0 13 0;
#P connect 13 1 10 1;
#P connect 14 0 10 0;
#P connect 8 2 9 0;
#P connect 5 6 6 0;
#P connect 4 0 3 0;
#P connect 3 1 5 0;
#P connect 6 0 8 0;
#P connect 13 0 12 0;
#P connect 12 0 14 0;
#P connect 11 1 12 1;
#P connect 16 0 14 1;
#P connect 6 1 7 0;
#P connect 7 0 8 1;
#P connect 9 0 11 0;
#P connect 15 0 16 0;

The only problem is that you need to initialize the main buffer with a fixed size. As soon as you resize it, the contents are lost.

So, Cycling, I’d like to make this an official feature request: the option to resize a buffer without clearing its contents.

Thanks,
Mattijs

Quote: pichiste@gmail.com wrote on Wed, 06 June 2007 22:14
—————————————————-
> hi list,
>
> this is probably a really basic question but i had a hard time finding an answer. is there way to read an audio file to a specific location within a buffer~? i know this can be done with the record~ object, but if I have many audio files that I simply want to load consecutively into one buffer, is there a way to specify that start time of each? for instance, 001.wav begins at 0, 002.wav begins at 5000, etc.
>
> thanks in advance, and my apologies if this is already posted elsewhere!
>
> best,
> daniel
—————————————————-


June 8, 2007 | 3:18 pm

An ‘append [filename]‘ message for the buffer object would also be nice… :)


June 11, 2007 | 6:33 pm

Mattijs Kneppers schrieb:
> So, Cycling, I’d like to make this an official feature request: the
> option to resize a buffer without clearing its contents.

Yes, but it has to be a seperate command. For example "resize". For
technical reasons the only way to do it is to allocate new memory for
it, copy the old content and then free the old memory. This is expensive
and you would not want that always…
It needs a separate notification as well, I had bad crashes when
accessing a buffer~ while croping with waveform~…
It could also just be an extra external, which does the copying in low
priority or a seperate thread, and gives a notification. A bit like
waveform~ without UI (just for croping) or an enhanced mxj~ buf.op but
as C-external…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


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