blob: 02d937f48c952b707b615daa918a36ec374c1b85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
66
67
68
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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
#N canvas 50 103 992 682 12;
#X graph graph1 0 -1.02 44100 1.02 599 426 799 296;
#X array sample-table 44103 float 0;
#X pop;
#X obj 502 568 loadbang;
#X floatatom 88 616 0 0 0;
#N canvas 159 26 495 266 output 0;
#X obj 338 160 t b;
#X obj 338 110 f;
#X obj 338 60 inlet;
#X text 344 29 mute;
#X obj 338 185 f;
#X msg 425 178 0;
#X msg 338 85 bang;
#X obj 338 135 moses 1;
#X obj 425 153 t b f;
#X obj 397 117 moses 1;
#X obj 83 148 dbtorms;
#X obj 397 92 r master-lvl;
#X obj 83 42 r master-lvl;
#X obj 338 210 s master-lvl;
#X obj 22 181 inlet~;
#X obj 199 41 inlet;
#X text 199 18 level;
#X obj 199 100 s master-lvl;
#X msg 96 65 set \$1;
#X obj 96 89 outlet;
#X msg 214 64 \; pd dsp 1;
#X obj 83 194 line~;
#X obj 22 212 *~;
#X obj 22 241 dac~;
#X obj 83 171 pack 0 50;
#X text 20 158 audio;
#X text 93 110 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 50 641 pd output;
#X msg 126 614 MUTE;
#X text 168 613 <-- output amplitude;
#X obj 50 586 hip~ 5;
#X obj 50 510 tabread4~ sample-table;
#X floatatom 16 306 0 0 0;
#X obj 16 331 * 441;
#X obj 16 453 +~ 1;
#X obj 35 249 phasor~ 0;
#X text 57 303 <-- chunk size (100ths of a second);
#X obj 497 460 adc~ 1;
#X obj 497 485 hip~ 5;
#X obj 497 534 tabwrite~ sample-table;
#X msg 512 507 bang;
#X text 544 506 <-- click here to record your own sample;
#X text 595 575 v-- re-read the original sample;
#X obj 50 561 *~;
#X text 599 432 -------- 44103 samples ------;
#N canvas 160 476 591 415 envelope 0;
#X obj 81 68 -~ 0.5;
#X obj 83 276 clip~ -0.5 0.5;
#X obj 83 254 *~ 1;
#X obj 127 227 moses 1;
#X msg 96 227 1;
#X obj 83 301 cos~;
#X obj 81 93 wrap~;
#X obj 81 122 -~ 0.5;
#X obj 83 349 *~ -0.5;
#X obj 83 324 -~ 1;
#X floatatom 127 195 0 0 0;
#X text 135 65 subtracting 0.5 and wrapping produces a sawtooth wave
180 degrees out of phase from the original.;
#X text 130 116 as before we subtract 1/2 again to center the sawtooth
from -1/2 to 1/2.;
#X text 177 195 <-- sharpness (at least 1);
#X obj 81 42 inlet~;
#X obj 83 379 outlet~;
#X obj 127 173 inlet;
#X connect 0 0 6 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 3 1 2 1;
#X connect 4 0 2 1;
#X connect 5 0 9 0;
#X connect 6 0 7 0;
#X connect 7 0 2 0;
#X connect 8 0 15 0;
#X connect 9 0 8 0;
#X connect 10 0 3 0;
#X connect 14 0 0 0;
#X connect 16 0 10 0;
#X restore 88 560 pd envelope;
#X floatatom 179 535 0 0 0;
#X text 212 534 <-- envelope sharpness;
#X obj 112 456 line~;
#X obj 112 406 * 441;
#X floatatom 112 381 0 0 0;
#X obj 112 431 pack 0 100;
#X text 158 383 <-- read point in 100ths of a second;
#X obj 50 485 +~;
#X obj 112 481 samphold~;
#X obj 16 381 samphold~;
#X obj 16 356 sig~;
#X obj 16 428 *~;
#X text 18 5 CALCULATING LOOP FREQUENCY AS FUNCTION OF TRANSPOSITION
;
#X obj 88 535 r~ phase;
#X obj 35 274 s~ phase;
#X obj 74 356 r~ phase;
#X obj 32 403 r~ phase;
#X obj 170 457 r~ phase;
#X obj 157 351 s chunk-size;
#X floatatom 22 50 0 0 0;
#X text 66 49 <-- transposition (10ths of a halftone);
#X obj 22 75 / 120;
#X obj 36 149 pow;
#X obj 22 100 t b f;
#X msg 22 125 2;
#X text 86 103 2 to the power (octaves);
#X text 85 125 gives speed change for the;
#X text 85 148 desired transposition;
#X obj 157 326 * 0.01;
#X text 270 339 chunk size;
#X text 270 361 in seconds;
#X obj 46 175 r chunk-size;
#X obj 46 200 t b f;
#X obj 35 224 /;
#X text 105 201 divide speed change by chunk;
#X text 103 222 size to get loop frequency;
#X text 402 74 The transposition is frequency in Hz. divided by chunk
size in seconds. This patch calculates the loop frequency as a function
of desired transposition;
#X text 77 75 transposition in octaves;
#X text 404 124 Notice now that we get Doppler effects when the chunk
size changes. You can suppress that if you don't want it \, by converting
the chunk size to an audio signal \, sampling and holding it. But then
there would be more work to deal with very low frequencies never triggering
the sample and hold...;
#X text 403 208 You might also want to have a way to retrigger the
loop to sync it with some other process. By the time we had all this
built the patch would be fairly involved. For now \, we'll move on
to note-oriented samplers instead.;
#X text 665 650 updated for Pd version 0.33;
#X msg 502 595 read ../sound/voice.wav sample-table;
#X obj 502 622 soundfiler;
#X obj 21 28 loadbang;
#X connect 1 0 63 0;
#X connect 2 0 3 1;
#X connect 3 0 2 0;
#X connect 4 0 3 2;
#X connect 6 0 3 0;
#X connect 7 0 19 0;
#X connect 8 0 9 0;
#X connect 8 0 50 0;
#X connect 9 0 32 0;
#X connect 10 0 29 0;
#X connect 11 0 36 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 16 0 15 0;
#X connect 19 0 6 0;
#X connect 21 0 19 1;
#X connect 22 0 21 1;
#X connect 24 0 30 0;
#X connect 25 0 27 0;
#X connect 26 0 25 0;
#X connect 27 0 24 0;
#X connect 29 0 7 0;
#X connect 30 0 29 1;
#X connect 31 0 33 0;
#X connect 32 0 31 0;
#X connect 33 0 10 0;
#X connect 35 0 21 0;
#X connect 37 0 31 1;
#X connect 38 0 33 1;
#X connect 39 0 30 1;
#X connect 41 0 43 0;
#X connect 43 0 45 0;
#X connect 44 0 55 0;
#X connect 45 0 46 0;
#X connect 45 1 44 1;
#X connect 46 0 44 0;
#X connect 50 0 40 0;
#X connect 53 0 54 0;
#X connect 54 0 55 0;
#X connect 54 1 55 1;
#X connect 55 0 11 0;
#X connect 63 0 64 0;
#X connect 65 0 41 0;
|