aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/H01.more.FM.pd
blob: 1b0e112b8d4a4be4f9e97127925a1eb384bb0bba (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
#N canvas 25 100 785 694 12;
#X floatatom 197 602 0 0 0;
#N canvas 159 26 541 274 output 0;
#X obj 351 166 t b;
#X obj 351 114 f;
#X obj 351 62 inlet;
#X text 358 30 mute;
#X obj 351 192 f;
#X msg 442 186 0;
#X msg 351 88 bang;
#X obj 351 140 moses 1;
#X obj 413 114 moses 1;
#X obj 86 153 dbtorms;
#X obj 413 88 r master-lvl;
#X obj 86 44 r master-lvl;
#X obj 351 218 s master-lvl;
#X obj 12 166 inlet~;
#X obj 207 43 inlet;
#X text 207 19 level;
#X obj 207 104 s master-lvl;
#X msg 100 67 set \$1;
#X obj 100 93 outlet;
#X msg 222 67 \; pd dsp 1;
#X obj 86 205 line~;
#X obj 12 218 *~;
#X obj 12 244 dac~;
#X obj 86 179 pack 0 50;
#X text 12 142 audio;
#X text 100 118 show level;
#X obj 12 192 hip~ 1;
#X connect 0 0 4 0;
#X connect 1 0 7 0;
#X connect 2 0 6 0;
#X connect 4 0 12 0;
#X connect 5 0 12 0;
#X connect 6 0 1 0;
#X connect 7 0 0 0;
#X connect 7 1 5 0;
#X connect 8 1 4 1;
#X connect 9 0 23 0;
#X connect 10 0 1 1;
#X connect 10 0 8 0;
#X connect 11 0 9 0;
#X connect 11 0 17 0;
#X connect 13 0 26 0;
#X connect 14 0 16 0;
#X connect 14 0 19 0;
#X connect 17 0 18 0;
#X connect 20 0 21 1;
#X connect 21 0 22 0;
#X connect 21 0 22 1;
#X connect 23 0 20 0;
#X connect 26 0 21 0;
#X restore 158 630 pd output;
#X msg 234 602 MUTE;
#X text 528 618 updated for Pd version 0.34;
#X text 277 601 <-- output;
#X text 79 4 FM \, PWM \, PAF as formant generators;
#X text 39 22 The next several patches illustrate "Synthesizing Sounds
with Specified \, Time-Varying Spectra" presented at ICMC 2001 and
reprinted on http://www.crca.ucsd.edu/~msp/publications.html.;
#X obj 146 468 line~;
#X obj 146 444 pack 0 50;
#X floatatom 146 389 0 0 0;
#X obj 124 493 *~;
#X text 145 367 index;
#X floatatom 248 398 0 0 0;
#X text 250 370 carrier freq;
#X obj 158 547 cos~;
#X graph graph1 0 0 128 500 499 556 755 426;
#X array spectrum 128 float 0;
#X pop;
#X msg 233 546 bang;
#X text 271 543 <-- click to graph;
#N canvas 204 17 358 238 fft 0;
#X obj 46 48 inlet~;
#X obj 159 181 tabwrite~ spectrum;
#X obj 159 145 inlet;
#X obj 46 78 rfft~;
#X obj 46 111 *~;
#X obj 77 111 *~;
#X obj 46 141 sqrt~;
#X obj 191 45 block~ 1024 1;
#X connect 0 0 3 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 3 0 4 1;
#X connect 3 1 5 0;
#X connect 3 1 5 1;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 1 0;
#X restore 187 574 pd fft;
#X text 490 562 0;
#X text 738 559 5512;
#X obj 153 520 +~;
#X obj 248 448 phasor~;
#X obj 23 458 osc~ 172.266;
#X obj 146 417 / 100;
#X obj 248 422 * 172.266;
#X text 34 93 First compare this phase modulation example with the
ring modulation example from the section on processing (patch 51).
Here we choose a convenient \, fixed modulation frequency and consider
the effect of changing carrier frequency and modulation index. It's
exactly as if the carrier frequency were a ring modulation frequency.
;
#X text 33 331 Next we'll look at two techniques for sliding a formant
frequency without losing harmonicity.;
#X text 33 191 Using either method we can synthesize the hat-shaped
spectra called "formants." However \, if you try to move the formant
up or down in frequency \, you'll lose harmonicity \; the partials
are only integer multiples of the fundamental \, 172.266 \, when the
carrier is an integer multiple. To hear this \, set index to 20 and
carrier frequency to zero \, and scroll carrier through integers. Then
shift-drag on the carrier frequency to change it in hundredths. Presto
\, inharmonic sounds...;
#X connect 0 0 1 1;
#X connect 1 0 0 0;
#X connect 2 0 1 2;
#X connect 7 0 10 1;
#X connect 8 0 7 0;
#X connect 9 0 24 0;
#X connect 10 0 21 0;
#X connect 12 0 25 0;
#X connect 14 0 1 0;
#X connect 14 0 18 0;
#X connect 16 0 18 1;
#X connect 21 0 14 0;
#X connect 22 0 21 1;
#X connect 23 0 10 0;
#X connect 24 0 8 0;
#X connect 25 0 22 0;