D10.sampler.notes.pd 8.5 KB
Newer Older
1
#N canvas 109 25 840 630 10;
2 3 4 5
#X msg 207 32 bang;
#X obj 207 60 delay 5;
#X text 447 294 end of note;
#X obj 313 60 r note;
Miller Puckette's avatar
Miller Puckette committed
6
#N canvas 459 46 678 451 samples 0;
7
#N canvas 0 0 450 300 (subpatch) 0;
8
#X array sample1 176403 float 0 black black;
Miller Puckette's avatar
Miller Puckette committed
9 10 11
#X coords 0 1.02 176403 -1.02 200 130 1;
#X restore 262 41 graph;
#X text 264 376 ------ 4 seconds ------;
12
#N canvas 0 0 450 300 (subpatch) 0;
13
#X array sample2 176403 float 0 black black;
Miller Puckette's avatar
Miller Puckette committed
14 15
#X coords 0 1.02 176403 -1.02 200 130 1;
#X restore 262 226 graph;
16
#X restore 18 292 pd samples;
Miller Puckette's avatar
Miller Puckette committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#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;
66 67 68
#X restore 18 434 pd recorder;
#X msg 18 320 record 1;
#X msg 18 363 stop;
Miller Puckette's avatar
Miller Puckette committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
#N canvas 359 226 666 626 playback 0;
#X obj 20 45 line~;
#X obj 39 237 line~;
#X obj 20 268 *~;
#X obj 39 208 r cutoff;
#X obj 20 16 r phase;
#X obj 20 592 outlet~;
#X obj 20 564 hip~ 5;
#X obj 32 79 r sample-number;
#X obj 32 108 makefilename sample%d;
#X msg 32 136 set \$1;
#X obj 20 177 tabread4~ sample1;
#X obj 38 304 r envelope;
#X obj 38 362 dbtorms;
#X obj 38 333 unpack;
#X obj 38 391 sqrt;
#X obj 38 420 sqrt;
#X obj 38 448 line~;
#X obj 20 535 *~;
#X obj 38 477 *~;
#X obj 38 506 *~;
#X text 90 17 messages to the phase generating line~;
#X text 171 80 setting the sample number.;
#X text 221 109 compute the name;
#X text 93 137 and send a "set" message to the tabread4~.;
#X text 99 236 line~ for de-clicking;
#X text 139 307 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 109 363 convert amplitude to linear units.;
#X text 104 392 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 77 480 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;
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
#X restore 18 461 pd playback;
#X msg 18 341 record 2;
#X text 565 45 ARGUMENTS FOR NOTES:;
#X text 586 73 pitch in halftones;
#X text 586 97 amplitude (dB);
#X text 586 145 sample number;
#X text 586 121 duration (msec);
#X text 586 169 start location (msec);
#X text 586 193 rise time (msec);
#X text 586 217 decay time (msec);
#X obj 313 87 unpack 0 0 0 0 0 0 0;
#X obj 471 193 f;
#X obj 406 167 f;
#X obj 337 167 f;
#X obj 300 167 f;
#X obj 268 167 f;
#X obj 174 167 f;
#X obj 174 194 mtof;
#X obj 174 222 / 261.62;
#X obj 174 249 * 4.41e+08;
#X obj 174 277 +;
#X obj 439 167 delay;
#X obj 268 337 pack 0 0 0 0 0;
#X obj 207 87 t b b b;
#X text 408 371 This starts the note \, sending to "receives" in the
Miller Puckette's avatar
Miller Puckette committed
151 152 153
playback subptach. The new receive "envelope" is an amplitude control
in parallel with the cutoff control. The "sample-number" switches the
tabread4~ between tables.;
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
#X msg 106 69 \; pd dsp 1 \; cutoff 0 5;
#X obj 337 222 + 1;
#X msg 416 487 60 100 10000 1 0 0 0;
#X obj 416 758 s note;
#X msg 471 221 \; envelope 0 \$1;
#X msg 535 698 62;
#X msg 570 698 64;
#X msg 501 698 60;
#X msg 472 698 55;
#X msg 603 698 72;
#X msg 440 698 48;
#X msg 502 741 60.5;
#X msg 416 514 60 90 10000 1 0 0 0;
#X msg 416 541 60 100 10000 2 0 0 0;
#X msg 416 568 60 100 10000 1 3000 0 0;
#X obj 337 194 * 44.1;
#X msg 416 622 60 100 100 1 0 0 0;
#X msg 416 649 60 100 100 1 0 0 1000;
#X msg 416 595 60 100 10000 1 0 1000 0;
#X msg 268 365 \; envelope 0 \, \$1 \$2 \; phase \$3 \, \$4 1e+07 \;
Miller Puckette's avatar
Miller Puckette committed
174
sample-number \$5 \; cutoff 1 5 \;;
175 176 177 178 179 180 181 182 183 184 185
#X text 80 320 <-- record;
#X msg 18 385 reload;
#X msg 18 406 browse;
#X text 15 184 transposition works;
#X text 15 198 by altering the phase;
#X text 15 240 calculate speed change;
#X text 15 254 considering 60 as unity.;
#X text 15 74 as before we;
#X text 15 89 mute and wait;
#X text 15 212 target (\$4 below right.);
#X text 370 328 combine amplitude \, rise time \, start phase \, end
Miller Puckette's avatar
Miller Puckette committed
186
phase \, and sample number in one message;
187 188 189 190 191 192 193 194 195 196
#X text 574 487 straight playback;
#X text 574 513 change amplitude;
#X text 574 540 change sample number;
#X text 574 568 change start location;
#X text 574 595 change rise time;
#X text 574 622 change duration;
#X text 573 649 ... and decay time;
#X text 539 741 microtones OK too.;
#X text 439 677 If you omit values they stay unchanged;
#X text 412 449 Here are buttons to demonstrate the effect of varying
Miller Puckette's avatar
Miller Puckette committed
197
the parameters one by one.;
198 199
#X obj 19 492 output~;
#X text 16 560 This patch take the same principle as the earlier "one-shot
200
sampler" \, but allows you to parameterize sample playback. Since we
Miller Puckette's avatar
Miller Puckette committed
201 202 203 204 205 206
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.;
207 208 209 210 211 212 213 214
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header chocolate_sampler
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X text 15 226 The [mtof] and / 261;
#X obj 1 796 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
14 -233017 -33289 0;
#N canvas 44 246 494 284 META 0;
215 216 217 218 219
#X text 12 105 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 85 AUTHOR Miller Puckette;
#X text 12 65 LIBRARY PDDP;
#X text 12 25 LICENSE SIBSD;
#X text 12 125 HELP_PATCH_AUTHORS Updated for release 0.37. Jonathan
220 221
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
222 223
#X text 12 45 DESCRIPTION chocolate sampler;
#X text 12 5 KEYWORDS signal tutorial;
224 225 226 227 228 229 230 231
#X restore 392 798 pd META;
#N canvas 13 202 428 190 References 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -261139 -33289 0;
#X text 7 2 chocolate sampler- Related Help Documents;
#X text 19 37 links:;
#X restore 103 798 pd References;
#X obj 6 798 pddp/pddplink ../5.reference/pddp/help.pd -text help;
Miller Puckette's avatar
Miller Puckette committed
232
#X connect 0 0 1 0;
233 234
#X connect 0 0 33 0;
#X connect 1 0 31 0;
Miller Puckette's avatar
Miller Puckette committed
235 236 237
#X connect 3 0 18 0;
#X connect 6 0 5 0;
#X connect 7 0 5 0;
238 239
#X connect 8 0 74 0;
#X connect 8 0 74 1;
Miller Puckette's avatar
Miller Puckette committed
240
#X connect 9 0 5 0;
241
#X connect 18 0 24 1;
Miller Puckette's avatar
Miller Puckette committed
242
#X connect 18 0 0 0;
243 244 245 246 247 248 249 250 251 252 253 254
#X connect 18 1 23 1;
#X connect 18 2 29 1;
#X connect 18 3 22 1;
#X connect 18 4 21 1;
#X connect 18 5 20 1;
#X connect 18 6 19 1;
#X connect 19 0 37 0;
#X connect 20 0 30 1;
#X connect 21 0 48 0;
#X connect 22 0 30 4;
#X connect 23 0 30 0;
#X connect 24 0 25 0;
Miller Puckette's avatar
Miller Puckette committed
255 256 257
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
#X connect 28 0 30 3;
#X connect 29 0 19 0;
#X connect 30 0 52 0;
#X connect 31 0 23 0;
#X connect 31 1 24 0;
#X connect 31 2 20 0;
#X connect 31 2 21 0;
#X connect 31 2 22 0;
#X connect 31 2 29 0;
#X connect 34 0 30 2;
#X connect 34 0 28 1;
#X connect 35 0 36 0;
#X connect 38 0 36 0;
#X connect 39 0 36 0;
#X connect 40 0 36 0;
#X connect 41 0 36 0;
#X connect 42 0 36 0;
#X connect 43 0 36 0;
#X connect 44 0 36 0;
#X connect 45 0 36 0;
#X connect 46 0 36 0;
#X connect 47 0 36 0;
#X connect 48 0 34 0;
#X connect 49 0 36 0;
#X connect 50 0 36 0;
#X connect 51 0 36 0;
#X connect 54 0 5 0;
Miller Puckette's avatar
Miller Puckette committed
285
#X connect 55 0 5 0;