#N canvas 36 22 966 735 10; #X obj 180 120 t b b b; #X obj 318 136 spigot; #X obj 224 234 f; #X obj 249 234 + 1; #X text 246 101 ONE central clock; #X obj 240 212 r set; #N canvas 0 22 450 300 graph1 0; #X array array1 708449 float 2; #X coords 0 2 708448 -2 200 140 1; #X restore 46 481 graph; #N canvas 0 22 450 300 graph2 0; #X array array2 1.04725e+06 float 2; #X coords 0 2 1.04725e+06 -2 200 140 1; #X restore 602 486 graph; #N canvas 0 22 458 308 toggle 0; #X obj 78 34 inlet; #X text 114 34 change; #X obj 78 64 0; #X obj 78 86 == 0; #X obj 134 80 outlet; #X obj 122 102 outlet; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 3 0 2 1; #X connect 3 0 5 0; #X restore 186 56 pd toggle; #X obj 353 117 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 186 14 r top1; #X obj 266 388 f; #X obj 159 410 tabwrite zentrum; #X obj 156 363 t f b; #X msg 568 216 start; #X msg 647 216 stop; #N canvas 0 22 725 323 startstop 0; #X obj 126 69 inlet; #X obj 189 68 inlet; #X obj 126 94 b; #X obj 191 95 b; #X msg 127 116 1; #X msg 191 116 0; #X obj 133 141 s set; #X obj 202 233 s set; #X msg 202 214 1; #X text 241 203 zero is inaccessable to the mouse-drawing \, perhaps it will be ok with a soundfile \, here zeroth element trips the detector as i cant change it from a value of zero manually.; #X msg 43 149 \; pd dsp \$1; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 4 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 4 0 10 0; #X connect 5 0 10 0; #X connect 8 0 7 0; #X restore 568 261 pd startstop; #N canvas 170 137 682 586 same_as_left 0; #X obj 144 46 f; #X obj 169 46 + 1; #X obj 160 24 r set; #X obj 222 324 t b f; #X obj 222 289 spigot; #X obj 137 404 s top1; #X msg 149 323 0; #X obj 275 200 b; #X text 227 131 range; #X obj 144 3 inlet; #X obj 34 269 outlet; #X obj 144 70 tabread array1; #X obj 252 344 outlet; #X obj 144 102 +; #X obj 328 86 inlet; #X text 180 6 Clock; #X text 326 104 Scale factor; #X obj 144 126 moses -0.001; #X obj 223 149 moses 0.001; #X obj 355 254 sel; #X obj 341 166 t b b; #X obj 325 208 f; #X obj 350 208 + 1; #X msg 341 188 0; #X msg 355 273 1; #X obj 140 273 loadbang; #X text 377 205 generate random number of samples within which a new crossing cannot be found; #X text 383 253 potential room for old errors - too soon; #X obj 371 233 random 300; #X connect 0 0 1 0; #X connect 0 0 11 0; #X connect 1 0 0 1; #X connect 2 0 0 1; #X connect 3 0 6 0; #X connect 3 0 5 0; #X connect 3 1 12 0; #X connect 4 0 3 0; #X connect 6 0 4 1; #X connect 7 0 21 0; #X connect 9 0 0 0; #X connect 11 0 13 0; #X connect 13 0 10 0; #X connect 13 0 17 0; #X connect 14 0 13 1; #X connect 17 0 7 0; #X connect 17 1 18 0; #X connect 18 0 4 0; #X connect 18 0 20 0; #X connect 18 0 7 0; #X connect 18 1 7 0; #X connect 19 0 24 0; #X connect 20 0 23 0; #X connect 20 1 28 0; #X connect 21 0 22 0; #X connect 21 0 19 0; #X connect 22 0 21 1; #X connect 23 0 21 1; #X connect 24 0 4 1; #X connect 25 0 4 1; #X connect 28 0 19 1; #X restore 51 204 pd same_as_left; #X obj 72 136 spigot; #X obj 107 117 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 61 101 loadbang; #X text 466 57 THE PROCESS; #X text 138 192 scale; #X text 40 219 to rec; #X text 126 216 snip-amp; #X text 466 75 1) find difference between snip-amplitudes 2) adjust the new file up or down to fit 3) move back one sample \, to the stored value. 4) play the new sound. 5) found new crossing \, stop \, begin again at (1); #X text 71 -1 slow prototype for split zero idea - incorporating the scaling idea; #X text 230 16 CHANGE HAPPENS HERE \, this must trigger the calculation ; #N canvas 0 22 627 483 scale 0; #X obj 222 126 f; #X obj 280 126 f; #X text 151 3 bang from state change; #X obj 137 185 f; #X obj 339 148 f; #X text 47 155 who is about to start?; #X obj 221 101 t b b; #X obj 244 168 -; #X obj 200 232 spigot; #X obj 272 232 spigot; #X obj 200 253 * -1; #X obj 373 132 r lefttog; #X obj 155 167 r righttog; #X obj 386 75 r rightamp; #X obj 296 47 r leftamp; #X obj 112 20 t b b b; #X obj 112 2 inlet; #X obj 272 260 outlet; #X obj 200 272 outlet; #X text 358 219 adjust leading edge of next sound to match the point where the last one was cut - resulting in no amplitude jumps during the transition.; #X connect 0 0 7 0; #X connect 1 0 7 1; #X connect 3 0 8 1; #X connect 4 0 9 1; #X connect 6 0 0 0; #X connect 6 1 1 0; #X connect 7 0 9 0; #X connect 7 0 8 0; #X connect 8 0 10 0; #X connect 9 0 17 0; #X connect 10 0 18 0; #X connect 11 0 4 1; #X connect 12 0 3 1; #X connect 13 0 1 1; #X connect 14 0 0 1; #X connect 15 0 6 0; #X connect 15 1 3 0; #X connect 15 2 4 0; #X connect 16 0 15 0; #X restore 201 156 pd scale; #X obj 99 68 s lefttog; #X obj 450 279 s rightamp; #X obj 151 239 s leftamp; #X obj 276 65 s righttog; #X obj 186 34 t b b; #X obj 616 446 soundfiler; #X obj 616 403 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 661 402 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 360 359 44100; #X msg 322 450 \; zentrum resize \$1; #X obj 333 509 table zentrum; #N canvas 170 137 510 555 same_as_left 0; #X obj 144 46 f; #X obj 169 46 + 1; #X obj 160 24 r set; #X obj 222 324 t b f; #X obj 222 289 spigot; #X obj 132 407 s top1; #X msg 149 323 0; #X obj 275 200 b; #X text 227 131 range; #X obj 144 3 inlet; #X obj 34 269 outlet; #X obj 252 344 outlet; #X obj 144 102 +; #X obj 328 86 inlet; #X text 180 6 Clock; #X text 326 104 Scale factor; #X obj 144 126 moses -0.001; #X obj 223 149 moses 0.001; #X obj 355 254 sel; #X obj 341 166 t b b; #X obj 325 208 f; #X obj 350 208 + 1; #X msg 341 188 0; #X msg 355 273 1; #X obj 140 273 loadbang; #X obj 144 70 tabread array2; #X obj 371 233 random 300; #X connect 0 0 1 0; #X connect 0 0 25 0; #X connect 1 0 0 1; #X connect 2 0 0 1; #X connect 3 0 6 0; #X connect 3 0 5 0; #X connect 3 1 11 0; #X connect 4 0 3 0; #X connect 6 0 4 1; #X connect 7 0 20 0; #X connect 9 0 0 0; #X connect 12 0 10 0; #X connect 12 0 16 0; #X connect 13 0 12 1; #X connect 16 0 7 0; #X connect 16 1 17 0; #X connect 17 0 4 0; #X connect 17 0 19 0; #X connect 17 0 7 0; #X connect 17 1 7 0; #X connect 18 0 23 0; #X connect 19 0 22 0; #X connect 19 1 26 0; #X connect 20 0 21 0; #X connect 20 0 18 0; #X connect 21 0 20 1; #X connect 22 0 20 1; #X connect 23 0 4 1; #X connect 24 0 4 1; #X connect 25 0 12 0; #X connect 26 0 18 1; #X restore 350 252 pd same_as_left; #X obj 539 411 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 737 472 loadinfoursamples 0; #X obj 107 76 openpanel; #X msg 297 93 read -resize \$1 array2; #X obj 297 72 openpanel; #X msg 107 95 read -resize \$1 array1; #X obj 363 152 openpanel; #X obj 553 148 openpanel; #X msg 363 171 read -resize \$1 array3; #X msg 553 169 read -resize \$1 array4; #X obj 212 257 outlet; #X obj 107 48 inlet; #X obj 296 48 inlet; #X obj 363 130 inlet; #X obj 553 125 inlet; #X connect 0 0 3 0; #X connect 1 0 8 0; #X connect 2 0 1 0; #X connect 3 0 8 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 9 0 0 0; #X connect 10 0 2 0; #X connect 11 0 4 0; #X connect 12 0 5 0; #X restore 616 423 pd loadinfoursamples; #X obj 706 402 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 751 401 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 371 386 * 5; #X text 464 163 not yet implemented the step-back one sample routine ; #X text 465 148 no setup routine - assumes that both samples start from zero; #N canvas 0 22 278 126 save 0; #X msg 30 53 write -aiff \$1 zentrum; #X obj 30 31 savepanel; #X obj 30 12 inlet; #X obj 30 76 outlet; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 1 0; #X restore 539 430 pd save; #X text 759 423 only two at present; #X text 333 527 RESULT; #X text 224 648 arrays all (Y) -2 to 2 \, to allow for headroom during scaling; #X text 42 190 clock in; #N canvas 200 22 731 586 what_Im_trying_to_do 0; #X text 24 123 the idea then is to make a patch which plays slowly (control rate at the moment) through a soundfile until it reaches a zero-crossing \, then plays from a second file from a zero-crossing \, using alternate waveform sections from both to construct a new composite sound.; #X text 30 210 I tested this but found that exact zero-amplitude points are not that common in soundfiles \, so i decided to have a small range above and below the zero line \, and when a sample is read whicgh is within that range the switch occurs fromm one soundfile to the other. ; #X text 37 313 this patch illustrates this idea in a simplistic mini way \, the two waveforms in array1 and array2 are alternately spliced into the final waveform in the middle.; #X text 44 498 if i can find the smallest possible range for triggering changes as described above \, then the effect of the scaling will be minimised.; #X text 19 22 the idea for this came from using protools to splice together soundfiles at zero crossing points. This technique also worked where two samples within two seperate soundfiles were the same amplitude \, By 'worked' i mean a pop-less transition from one sounfile to the other \, without the need for amplitude ramp scaling \, eg with line~ \, or with trapezoid~ in maxmsp.; #X text 35 382 the difference in amplitude between the two ends is found and compensated for \, so that hopefully a seamless transition is created \, the next step is to impement this idea at signal rate \, and with multiple soundfiles.; #X restore 440 37 pd what_Im_trying_to_do; #X obj 180 99 bang~; #N canvas 0 22 458 308 tworand 0; #X obj 105 71 random 4; #X obj 134 92 random 3; #X obj 105 48 t b b; #X obj 118 136 +; #X obj 50 120 + 1; #X obj 162 179 % 4; #X obj 118 159 moses 5; #X obj 134 113 + 1; #X obj 105 26 inlet; #X obj 50 221 outlet; #X obj 118 221 outlet; #X text 142 27 bang; #X text 152 141 1 and 4 which are never the same.; #X text 160 121 output two random numbers between; #X text 163 224 first; #X connect 0 0 4 0; #X connect 1 0 7 0; #X connect 2 0 0 0; #X connect 2 1 1 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 4 0 9 0; #X connect 5 0 10 0; #X connect 6 0 10 0; #X connect 6 1 5 0; #X connect 7 0 3 1; #X connect 8 0 2 0; #X restore 503 350 pd tworand; #X text 501 334 next step ---> use more samples; #X text 483 184 ~33 samples either side of zero with 0.001; #X connect 0 0 18 0; #X connect 0 1 1 0; #X connect 0 2 2 0; #X connect 1 0 40 0; #X connect 2 0 3 0; #X connect 2 0 11 1; #X connect 3 0 2 1; #X connect 5 0 2 1; #X connect 8 0 19 0; #X connect 8 0 29 0; #X connect 8 1 9 0; #X connect 8 1 32 0; #X connect 9 0 1 1; #X connect 10 0 33 0; #X connect 11 0 12 1; #X connect 13 0 12 0; #X connect 13 1 11 0; #X connect 14 0 16 0; #X connect 15 0 16 1; #X connect 17 0 13 0; #X connect 17 1 31 0; #X connect 18 0 17 0; #X connect 19 0 18 1; #X connect 20 0 19 0; #X connect 20 0 37 0; #X connect 28 0 17 1; #X connect 28 1 40 1; #X connect 33 0 8 0; #X connect 33 1 28 0; #X connect 35 0 42 0; #X connect 36 0 42 1; #X connect 37 0 45 0; #X connect 40 0 13 0; #X connect 40 1 30 0; #X connect 41 0 48 0; #X connect 42 0 34 0; #X connect 43 0 42 2; #X connect 44 0 42 3; #X connect 45 0 38 0; #X connect 48 0 34 0; #X connect 54 0 0 0;