aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/D07.sampler.notes.pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd/doc/3.audio.examples/D07.sampler.notes.pd')
-rw-r--r--pd/doc/3.audio.examples/D07.sampler.notes.pd321
1 files changed, 321 insertions, 0 deletions
diff --git a/pd/doc/3.audio.examples/D07.sampler.notes.pd b/pd/doc/3.audio.examples/D07.sampler.notes.pd
new file mode 100644
index 00000000..9b08a10a
--- /dev/null
+++ b/pd/doc/3.audio.examples/D07.sampler.notes.pd
@@ -0,0 +1,321 @@
+#N canvas 12 0 1074 786 12;
+#X msg 862 17 \; pd dsp 1;
+#X msg 946 17 \; pd dsp 0;
+#X text 887 53 ON;
+#X text 965 53 OFF;
+#X floatatom 64 512 0 0 0;
+#N canvas 159 26 495 262 output 0;
+#X obj 406 192 t b;
+#X obj 406 132 f;
+#X obj 406 72 inlet;
+#X text 413 35 mute;
+#X obj 406 222 f;
+#X msg 510 214 0;
+#X msg 406 102 bang;
+#X obj 406 162 moses 1;
+#X obj 510 184 t b f;
+#X obj 476 140 moses 1;
+#X obj 100 178 dbtorms;
+#X obj 476 110 r master-lvl;
+#X obj 100 50 r master-lvl;
+#X obj 406 252 s master-lvl;
+#X obj 26 217 inlet~;
+#X obj 239 49 inlet;
+#X text 239 22 level;
+#X obj 239 120 s master-lvl;
+#X msg 115 78 set \$1;
+#X obj 115 107 outlet;
+#X msg 257 77 \; pd dsp 1;
+#X obj 100 233 line~;
+#X obj 26 254 *~;
+#X obj 26 289 dac~;
+#X obj 100 205 pack 0 50;
+#X text 24 190 audio;
+#X text 112 132 show level;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 13 0;
+#X connect 5 0 13 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 24 0;
+#X connect 11 0 1 1;
+#X connect 11 0 9 0;
+#X connect 12 0 10 0;
+#X connect 12 0 18 0;
+#X connect 14 0 22 0;
+#X connect 15 0 17 0;
+#X connect 15 0 20 0;
+#X connect 18 0 19 0;
+#X connect 21 0 22 1;
+#X connect 22 0 23 0;
+#X connect 22 0 23 1;
+#X connect 24 0 21 0;
+#X restore 29 546 pd output;
+#X msg 98 512 MUTE;
+#X text 143 511 <-- output amplitude;
+#X msg 253 7 bang;
+#X obj 253 35 delay 5;
+#X text 493 269 end of note;
+#X obj 359 35 r note;
+#N canvas 459 46 678 451 samples 0;
+#X graph graph1 0 -1.02 176403 1.02 262 171 462 41;
+#X array sample1 176403 float 0;
+#X pop;
+#X text 264 376 ------ 4 seconds ------;
+#X graph graph1 0 -1.02 176403 1.02 262 356 462 226;
+#X array sample2 176403 float 0;
+#X pop;
+#X restore 29 277 pd samples;
+#N canvas 21 287 947 410 recorder 0;
+#X obj 318 43 inlet;
+#X obj 272 196 adc~ 1;
+#X obj 272 224 hip~ 5;
+#X obj 341 254 line~;
+#X obj 272 253 *~;
+#X msg 341 226 1;
+#X obj 400 191 del 3990;
+#X msg 377 226 0 10;
+#X obj 272 304 tabwrite~ sample1;
+#X obj 124 110 makefilename sample%1;
+#X msg 124 139 set \$1 \, bang;
+#X msg 446 162 stop;
+#X msg 400 162 bang;
+#X obj 557 182 loadbang;
+#X obj 660 137 openpanel;
+#X msg 660 109 bang;
+#X text 702 108 <-- browse for samples;
+#X text 628 233 v-- re-read original samples;
+#X obj 318 72 route record stop reload browse;
+#X obj 557 319 soundfiler;
+#X msg 557 261 read ../sound/bell.aiff sample1 \, read ../sound/voice2.wav
+sample2;
+#X msg 660 164 read \$1 sample1;
+#X obj 660 191 soundfiler;
+#X connect 0 0 18 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 4 1;
+#X connect 4 0 8 0;
+#X connect 5 0 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 3 0;
+#X connect 9 0 10 0;
+#X connect 10 0 8 0;
+#X connect 11 0 6 0;
+#X connect 12 0 6 0;
+#X connect 13 0 20 0;
+#X connect 14 0 21 0;
+#X connect 15 0 14 0;
+#X connect 18 0 9 0;
+#X connect 18 0 12 0;
+#X connect 18 0 5 0;
+#X connect 18 1 7 0;
+#X connect 18 1 11 0;
+#X connect 18 2 20 0;
+#X connect 18 3 15 0;
+#X connect 20 0 19 0;
+#X connect 21 0 22 0;
+#X restore 29 443 pd recorder;
+#X msg 29 305 record 1;
+#X msg 29 360 stop;
+#N canvas 700 402 671 621 playback 0;
+#X obj 37 79 line~;
+#X obj 56 271 line~;
+#X obj 37 302 *~;
+#X obj 56 242 r cutoff;
+#X obj 37 50 r phase;
+#X obj 37 626 outlet~;
+#X obj 37 598 hip~ 5;
+#X obj 49 113 r sample-number;
+#X obj 49 142 makefilename sample%d;
+#X msg 49 170 set \$1;
+#X obj 37 211 tabread4~ sample1;
+#X obj 55 338 r envelope;
+#X obj 55 396 dbtorms;
+#X obj 55 367 unpack;
+#X obj 55 425 sqrt;
+#X obj 55 454 sqrt;
+#X obj 55 482 line~;
+#X obj 37 569 *~;
+#X obj 55 511 *~;
+#X obj 55 540 *~;
+#X text 107 51 messages to the phase generating line~;
+#X text 188 114 setting the sample number.;
+#X text 238 143 compute the name;
+#X text 110 171 and send a "set" message to the tabread4~.;
+#X text 116 270 line~ for de-clicking;
+#X text 156 341 The envelope generator. Rather than sending our message
+straight to the line~ we unpack it in order to fool with the amplitude
+field.;
+#X text 126 397 convert amplitude to linear units.;
+#X text 121 426 take the fourth root. This because we want to raies
+the line~'s output to the 4th power afterward. This is an inexpensive
+way to give the rise and decay a more natural sounding evolution than
+just a straight line.;
+#X text 94 514 square the output twice to get the fourth power.;
+#X connect 0 0 10 0;
+#X connect 1 0 2 1;
+#X connect 2 0 17 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 10 0 2 0;
+#X connect 11 0 13 0;
+#X connect 12 0 14 0;
+#X connect 13 0 12 0;
+#X connect 13 1 16 1;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 18 0;
+#X connect 16 0 18 1;
+#X connect 17 0 6 0;
+#X connect 18 0 19 0;
+#X connect 18 0 19 1;
+#X connect 19 0 17 1;
+#X restore 29 480 pd playback;
+#X msg 29 332 record 2;
+#X text 641 25 ARGUMENTS FOR NOTES:;
+#X text 662 53 pitch in halftones;
+#X text 662 77 amplitude (dB);
+#X text 662 125 sample number;
+#X text 662 101 duration (msec);
+#X text 662 149 start location (msec);
+#X text 662 173 rise time (msec);
+#X text 662 197 decay time (msec);
+#X obj 359 62 unpack 0 0 0 0 0 0 0;
+#X text 46 6 CHOCOLATE SAMPLER;
+#X obj 517 168 f;
+#X obj 452 142 f;
+#X obj 383 142 f;
+#X obj 346 142 f;
+#X obj 314 142 f;
+#X obj 220 142 f;
+#X obj 220 169 mtof;
+#X obj 220 197 / 261.62;
+#X obj 220 224 * 4.41e+08;
+#X obj 220 252 +;
+#X obj 485 142 delay;
+#X obj 314 312 pack 0 0 0 0 0;
+#X obj 253 62 t b b b;
+#X text 494 346 This starts the note \, sending to "receives" in the
+playback subptach. The new receive "envelope" is an amplitude control
+in parallel with the cutoff control. The "sample-number" switches the
+tabread4~ between tables.;
+#X msg 152 44 \; pd dsp 1 \; cutoff 0 5;
+#X obj 383 197 + 1;
+#X msg 552 467 60 100 10000 1 0 0 0;
+#X obj 552 737 s note;
+#X msg 517 196 \; envelope 0 \$1;
+#X msg 671 691 62;
+#X msg 706 691 64;
+#X msg 637 691 60;
+#X msg 608 691 55;
+#X msg 739 691 72;
+#X msg 576 691 48;
+#X msg 638 734 60.5;
+#X msg 552 494 60 90 10000 1 0 0 0;
+#X msg 552 522 60 100 10000 2 0 0 0;
+#X msg 552 550 60 100 10000 1 3000 0 0;
+#X obj 383 169 * 44.1;
+#X msg 552 605 60 100 100 1 0 0 0;
+#X msg 552 632 60 100 100 1 0 0 1000;
+#X msg 552 577 60 100 10000 1 0 1000 0;
+#X msg 314 340 \; envelope 0 \, \$1 \$2 \; phase \$3 \, \$4 1e+07 \;
+sample-number \$5 \; cutoff 1 5 \;;
+#X text 108 315 <-- record;
+#X msg 29 388 reload;
+#X msg 29 415 browse;
+#X text 6 109 transposition works;
+#X text 6 133 by altering the phase;
+#X text 6 181 The mtof and / 261;
+#X text 6 205 calculate speed change;
+#X text 6 229 considering 60 as unity.;
+#X text 20 43 as before we;
+#X text 11 64 mute and wait;
+#X text 6 157 target ($4 below right.);
+#X text 446 303 combine amplitude \, rise time \, start phase \, end
+phase \, and sample number in one message;
+#X text 16 594 This patch take the same principle as the previous one
+\, but allows you to parametrize sample playback. Since we must wait
+5 msec before starting the playback \, we store all the parameters
+in "f" objects \, and recall them to construct the new note. Transposition
+is done by altering the amount to play back in the (artificial) ten
+thousand seconds (1e+07). The playback segment can be altered to start
+in the middle of the sample instead of the beginning \, and you can
+change the duration and rise and decay times.;
+#X text 744 468 straight playback;
+#X text 749 495 change amplitude;
+#X text 752 523 change sample number;
+#X text 755 550 change start location;
+#X text 754 576 change rise time;
+#X text 754 609 change duration;
+#X text 755 633 ... and decay time;
+#X text 688 736 microtones OK too.;
+#X text 576 667 If you omit values they stay unchanged;
+#X text 799 759 updated for Pd version 0.33;
+#X text 548 426 Here are buttons to demonstrate the effect of varying
+the parameters one by one.;
+#X connect 4 0 5 1;
+#X connect 5 0 4 0;
+#X connect 6 0 5 2;
+#X connect 8 0 9 0;
+#X connect 8 0 42 0;
+#X connect 9 0 40 0;
+#X connect 11 0 26 0;
+#X connect 14 0 13 0;
+#X connect 15 0 13 0;
+#X connect 16 0 5 0;
+#X connect 17 0 13 0;
+#X connect 26 0 33 1;
+#X connect 26 0 8 0;
+#X connect 26 1 32 1;
+#X connect 26 2 38 1;
+#X connect 26 3 31 1;
+#X connect 26 4 30 1;
+#X connect 26 5 29 1;
+#X connect 26 6 28 1;
+#X connect 28 0 46 0;
+#X connect 29 0 39 1;
+#X connect 30 0 57 0;
+#X connect 31 0 39 4;
+#X connect 32 0 39 0;
+#X connect 33 0 34 0;
+#X connect 34 0 35 0;
+#X connect 35 0 36 0;
+#X connect 36 0 37 0;
+#X connect 37 0 39 3;
+#X connect 38 0 28 0;
+#X connect 39 0 61 0;
+#X connect 40 0 32 0;
+#X connect 40 1 33 0;
+#X connect 40 2 29 0;
+#X connect 40 2 30 0;
+#X connect 40 2 31 0;
+#X connect 40 2 38 0;
+#X connect 43 0 39 2;
+#X connect 43 0 37 1;
+#X connect 44 0 45 0;
+#X connect 47 0 45 0;
+#X connect 48 0 45 0;
+#X connect 49 0 45 0;
+#X connect 50 0 45 0;
+#X connect 51 0 45 0;
+#X connect 52 0 45 0;
+#X connect 53 0 45 0;
+#X connect 54 0 45 0;
+#X connect 55 0 45 0;
+#X connect 56 0 45 0;
+#X connect 57 0 43 0;
+#X connect 58 0 45 0;
+#X connect 59 0 45 0;
+#X connect 60 0 45 0;
+#X connect 63 0 13 0;
+#X connect 64 0 13 0;