Forums > MaxMSP

multiple load into buffer

April 22, 2006 | 1:06 pm

Haven’t managed to find any references to this, so it’s probably not
possible, but just in case …

Is there a way to load a series of files one after the other into a
buffer~ – ie append each new file to the end of the previous one, so
that I can create a new single audio file out of a series of smaller
ones?

thanks

David


April 22, 2006 | 4:13 pm

if you are recording sound into the buffer it’s easy. For loading from disc the method goes something like this.

load sound #1 into buffer A

load sound #2 to buffer B

copy sound #2 to buffer A (after sound #1)

This can be achieved using peek~ you will probably want to keep track of the different file regions using a coll.

My only example of this if buried in a big patch so i can’t post an example right now.


April 26, 2006 | 9:47 am

David Stevens wrote:
> Haven’t managed to find any references to this, so it’s probably not
> possible, but just in case …
>
> Is there a way to load a series of files one after the other into a
> buffer~ – ie append each new file to the end of the previous one, so
> that I can create a new single audio file out of a series of smaller ones?

Should be possible, but I’d use two buffers~, as loading into the buffer
will need some time. One is playing, one is loading…
Another attempt is sfplay~ as you can predefine cues, these cues can be
played immediately… (I’d try it with sfplay~…)

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


April 26, 2006 | 3:28 pm

hi Stefan,

Leafcutter John pointed me in the right direction, and I eventually
came up with something that worked without distorting the copied
buffer. I posted the result, but it’s still sitting in email
purgatory waiting to be approved by the moderator (it was a tad over
the size limit apparently).

thanks

David


April 27, 2006 | 6:15 am

instead of peek~ you could also use record~ , and if
you think the copying is too slow by playpseed you can
play the edit buffers with 4x speed …


April 28, 2006 | 8:52 am

Tried to send this before but was too big. I’ve removed the
[waveform~]s so hopefully it’ll get through now.

Thanks for the pointer – here’s a version that I got to work without
distorting – it only loads one extra sound so far, but it should be
simple to append extra files.

best

David

max v2;
#N vpatcher 13 54 1029 618;
#P button 857 75 15 0;
#P window setfont "Sans Serif" 10.;
#P window linecount 1;
#P newex 291 74 32 196618 t b b;
#P newex 431 295 46 196618 pack f f;
#P newex 430 324 67 196618 peek~ test2;
#P message 457 30 41 196618 set $1;
#P message 559 312 18 196618 0.;
#P newex 413 217 66 196618 + 440628.;
#P message 97 22 35 196618 clear;
#P user multiSlider 494 132 176 15 0. 1. 1 2936 15 0 0 2 0 0 0;
#M frgb 68 130 180;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P window setfont "Sans Serif" 9.;
#P message 461 65 85 196617 440627.96875;
#P toggle 613 269 15 0;
#P newex 613 342 27 196617 sig~;
#P user gain~ 611 406 46 38 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 10.;
#P newex 612 377 77 196618 groove~ test2;
#P flonum 323 272 67 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 452 97 53 196618 tl.uzi;
#P user ezdac~ 608 476 652 509 0;
#P flonum 180 236 77 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 284 188 70 196618 mstosamps~;
#P newex 198 179 70 196618 mstosamps~;
#N counter 0 440628;
#X flags 0 0;
#P newobj 432 167 102 196618 counter 0 440628;
#P flonum 238 275 63 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 246 115 15 0;
#P newex 296 224 31 196618 + 0.;
#P flonum 278 152 62 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 289 109 105 196618 info~ test;
#P flonum 199 148 65 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 117 106 105 196618 info~ test2;
#P message 137 33 31 196618 read;
#P newex 471 244 60 196618 peek~ test;
#P message 828 241 52 196618 set test2;
#P message 843 115 45 196618 set test;
#P message 704 284 253 196618 connect [waveform]s here to see what’s
happening;
#P message 705 174 253 196618 connect [waveform]s here to see what’s
happening;
#P message 282 23 46 196618 replace;
#P newex 122 67 114 196618 buffer~ test2 20000;
#P newex 282 48 103 196618 buffer~ test 1000.;
#P window linecount 9;
#P comment 120 293 100 196618 the maths only works for one extra
sample to be loaded. once that’s working I’ll modoify it to allow for
additonal samples to be appended.;
#P window linecount 6;
#P comment 629 47 100 196618 i used tl.uzi from Trond’s externals to
slow things down a bit. replace with uzi if you don’t have it;
#P window linecount 2;
#P comment 30 147 100 196618 it’s a mess , of course.;
#P window linecount 1;
#P comment 175 33 100 196618 1. load sample 1;
#P comment 336 27 100 196618 2. load sample 2;
#P window linecount 2;
#P comment 520 82 100 196618 3. click on message to start copy;
#P connect 7 1 15 0;
#P connect 35 0 7 0;
#P connect 14 0 7 0;
#P connect 23 1 25 0;
#P connect 16 0 23 0;
#P connect 20 0 16 0;
#P connect 15 3 16 0;
#P connect 19 0 21 0;
#P connect 41 0 20 0;
#P connect 17 6 18 0;
#P connect 20 0 18 0;
#P connect 35 0 6 0;
#P connect 8 0 6 0;
#P connect 18 0 24 0;
#P connect 41 1 17 0;
#P connect 6 1 41 0;
#P connect 23 1 19 0;
#P connect 24 1 19 1;
#P connect 24 1 28 0;
#P connect 22 0 36 0;
#P connect 40 0 39 0;
#P connect 36 0 40 0;
#P connect 27 0 22 0;
#P connect 33 0 27 0;
#P connect 24 1 38 0;
#P connect 38 0 33 0;
#P connect 13 0 40 1;
#P connect 23 1 36 1;
#P connect 22 0 13 0;
#P connect 33 0 22 2;
#P connect 27 3 34 0;
#P connect 24 1 22 4;
#P connect 30 0 26 0;
#P connect 29 0 30 0;
#P connect 31 0 29 0;
#P connect 37 0 29 0;
#P connect 32 0 31 0;
#P connect 30 0 26 1;
#P connect 12 0 10 0;
#P connect 11 0 9 0;
#P fasten 42 0 12 0 862 108 985 108 985 241 833 241;
#P connect 42 0 11 0;
#P fasten 35 0 42 0 102 47 862 47;
#P pop;


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