Forums > MaxMSP

chopping a sample into it's individual samples

January 15, 2008 | 5:59 pm


January 15, 2008 | 8:02 pm

I think the main problem is your design mixes control rate operations
with real-time signals. Snapshot~ will output sample values but at the control rate.
You will also need to bang it to get any value out. This also introduces latency
into the design. I would suggest keeping track of the number of samples and
then introduce a delay or pause after each portion of the audio you want goes
by. That should split things up and still maintain sample accuracy.

Anthony

—- Chris Hipgrave wrote:
>
> Hi all,
>
> i am trying to automatically chop a sound file into it’s individual cycles but am having trouble. Could anyone tell me why my meager patch will not work?
>
> Thanks
> Chris
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 341 433 38 196617 sel 10;
> #P message 133 129 29 196617 stop;
> #P newex 257 387 40 196617 t b b b;
> #P newex 322 457 85 196617 prepend set open;
> #N counter 0 10;
> #X flags 0 0;
> #P newobj 287 410 68 196617 counter 0 10;
> #P user umenu 287 434 45 196647 1 64 450 1;
> #X add one;
> #X add two;
> #X add three;
> #X add four;
> #X add five;
> #X add six;
> #X add seven;
> #X add eight;
> #X add nine;
> #X add ten;
> #P message 322 481 45 196617 open six;
> #P newex 151 508 55 196617 sfrecord~;
> #P toggle 206 435 15 0;
> #P message 263 347 14 196617 0;
> #P message 257 411 14 196617 1;
> #P comment 279 325 33 196617 stop;
> #P newex 263 300 45 196617 onebang;
> #P button 263 323 15 0;
> #P newex 263 276 32 196617 sel 1;
> #P newex 217 300 45 196617 onebang;
> #P button 217 323 15 0;
> #P flonum 288 212 70 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 288 188 70 196617 snapshot~ 10;
> #P message 110 182 27 196617 stop;
> #P message 41 182 65 196617 startwindow;
> #P newex 164 215 29 196617 dac~;
> #P comment 41 168 69 196617 • start audio;
> #P user panel 28 162 123 43;
> #X brgb 255 255 255;
> #X frgb 100 202 30;
> #X border 2;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P message 163 129 51 196617 startloop;
> #P message 217 106 43 196617 0.0001;
> #P message 254 134 37 196617 loop 1;
> #P newex 217 128 29 196617 sig~;
> #P toggle 263 256 15 0;
> #P toggle 217 256 15 0;
> #P newex 263 234 27 196617 > 0.;
> #P newex 217 234 27 196617 < 0.;
> #P flonum 217 212 70 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 217 188 70 196617 snapshot~ 10;
> #P message 70 63 30 196617 read;
> #P newex 70 85 78 196617 buffer~ sample;
> #P newex 217 157 81 196617 groove~ sample;
> #P newex 217 276 32 196617 sel 1;
> #P comment 183 325 33 196617 start;
> #P connect 38 0 37 0;
> #P connect 34 0 33 0;
> #P connect 34 0 38 0;
> #P connect 36 2 34 0;
> #P connect 2 0 31 0;
> #P connect 2 0 17 0;
> #P connect 2 0 17 1;
> #P connect 2 0 5 0;
> #P connect 25 0 29 0;
> #P connect 22 0 36 0;
> #P connect 37 0 2 0;
> #P connect 35 0 32 0;
> #P connect 36 1 32 0;
> #P connect 33 1 35 0;
> #P connect 36 0 28 0;
> #P connect 23 0 22 0;
> #P connect 24 1 26 1;
> #P connect 20 0 21 0;
> #P connect 2 1 20 0;
> #P connect 26 0 25 0;
> #P connect 24 0 26 0;
> #P connect 10 0 24 0;
> #P connect 8 0 10 0;
> #P connect 6 0 7 0;
> #P connect 6 0 8 0;
> #P connect 1 1 23 1;
> #P connect 28 0 30 0;
> #P connect 29 0 30 0;
> #P connect 1 0 23 0;
> #P connect 9 0 1 0;
> #P connect 7 0 9 0;
> #P connect 5 0 6 0;
> #P connect 11 0 2 0;
> #P connect 12 0 2 0;
> #P connect 14 0 2 0;
> #P connect 13 0 11 0;
> #P fasten 19 0 17 0 115 210 169 210;
> #P fasten 18 0 17 0 46 210 169 210;
> #P connect 30 0 31 0;
> #P connect 32 0 31 0;
> #P connect 4 0 3 0;
> #P window clipboard copycount 39;
>
>
> –
> http://www.chrishipgrave.co.uk


January 16, 2008 | 2:37 pm

Chris Hipgrave schrieb:
> i am trying to automatically chop a sound file into it’s individual
> cycles but am having trouble. Could anyone tell me why my meager
> patch will not work?

You will have to look into envelope following and thresholds to decide
when a sound starts and when it ends.

objects to look into: abs~, slide~ or rampsmooth~, thresh~.

I would first just analyse the bits and pieces, store them into a coll
and rather record~ into other buffers or simply copy the analyzed bits
to new buffers…

objects to look into:

coll, record~, waveform~ (especially the crop message), mxj buf.Op

good luck

Stefan


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


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