-
Notifications
You must be signed in to change notification settings - Fork 2
/
11-com-mod-generators.Rmd
776 lines (638 loc) · 84.4 KB
/
11-com-mod-generators.Rmd
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
# Modulating Generators {#complex-generators}
This chapter extends Chapter \@ref(generators) and focuses entirely on audio-rate modulation.
Audio-rate modulation uses an audio-rate signal, typically an oscillator, to modulate a parameter, most commonly a parameter on another oscillator.^[Audio-rate modulation of a filter's cutoff is another common option but is beyond the scope of this chapter. Try it!]
Although the basic idea is simple to explain, sounds produced can be complex and require a new idea to understand: the sideband.
Before proceeding, let's introduce some terminology.
The audio rate signal source will be called the *modulator*.
The oscillator receiving the modulation is the *carrier*.
The strength of modulation the carrier receives from the modulator will be called the *modulation index*.
The modulation index defines how much the parameter of the carrier changes around its default value.
For example, if a carrier has a frequency of 800 Hz, the modulator may cause it to go +/- 1 Hz (from 799 to 801 Hz) or +/- 100 Hz (from 700 Hz to 900 Hz).
The signal resulting from audio-rate modulation is the *output*.
Recall that we can describe any wave by its shape, amplitude, frequency, and phase.
If we assume we can describe any waveshape by a collection of sine waves via Fourier transform, then we can focus on the amplitude, frequency, and phase parameters of these waves.
Audio-rate modulation can be performed on each of these parameters.
When the modulator acts on the amplitude parameter of the carrier, the result is amplitude modulation (AM).
When the modulator acts on the frequency parameter of the carrier, the result is frequency modulation (FM).
And when the modulator acts on the phase parameter of the carrier, the result is phase modulation (PM).
Each of these types of audio-rate modulation creates sidebands, which are new partials in the output.
Audio-rate modulation therefore is related to additive synthesis in that both involve adding partials to change the timbre of the output sound.
The main difference is that audio-rate modulation is not strictly additive and can also remove or change some partials in the carrier.
However, with sufficient control of audio-rate modulation, one can create a wide variety of sounds more efficiently than additive synthesis, as shown by the explosion of inexpensive FM keyboards in the 1980's, like the Yamaha DX7.
The following sections outline the use of audio-rate modulation in modular sound synthesis according to the parameters of amplitude, frequency, and phase.
However, the story is somewhat complicated due to the history of synthesis, limitations of analogue hardware, and mathematical relationships between methods.
There are actually two families of methods around amplitude and frequency that cover all three parameters, as will be explained.
## Modulating amplitude
The amplitude family includes amplitude modulation and ring modulation.
The difference between the two is that amplitude modulation stops producing sound when the modulation signal crosses below zero and ring modulation continues to produce sound.
Although this difference may seem like a small one, it leads to several differences in the resulting sidebands and therefore overall timbre.
### Amplitude modulation
You might have heard of amplitude modulation (AM) before, as it was one of the earliest technologies used in radio and is still in use today.
We actually already covered the basic idea of AM in Section \@ref(tremolo) to produce tremolo.
As you recall, we used an LFO at relatively low rates to control a VCA, and the VCA was controlling the output of our main oscillator.
AM works exactly the same way as this but at audio rates (>20 Hz).
At audio rates, we can hear sidebands, and the nature of the sound changes from an oscillation in loudness to a new timbre.
The VCA is key to understanding AM.
Recall that the VCA is a level control that lets through a certain amount of signal, typically 0-100%.^[Most VCAs are attenuators and so only reduce signal. Some VCAs include amplifiers that allow the gain on the signal to go above 100%].
If you stop to think about this mathematically, it means that the VCA is multiplying the signal by a control value.^[The control value itself at any moment is determined by the output of the modulator and thus it is the two signals that are being multiplied together, but for simplicity of exposition fixed point values are emphasized.]
For example, if the VCA control value is 50%, then it is multiplying the incoming signal amplitude by .5.
AM stops producing sound when the control value crosses below zero because VCAs are defined to operate in the 0-100% range, i.e., with unipolar control values only.
So when the control value crosses below zero, the VCA output simply stays at zero until the control value becomes positive again.
This behavior is illustrated in Figure \@ref(fig:am-unipolar).
(ref:am-unipolar) An example of amplitude modulation using sine waves for modulator and carrier. Note that where the modulator signal (purple) is at its peak, the output (yellow) is at greatest strength, but where the modulator signal is negative, the output reduces to zero.
```{r am-unipolar, echo=F, out.width="100%", fig.cap="(ref:am-unipolar)"}
knitr::include_graphics("images/am-unipolar.png")
```
Side bands for AM are simplest for sine waves.
If both modulator and carrier are sine waves, the spectrum of the output will include a partial at the carrier frequency $C_f$ and two partials offset by the modulator frequency $M_f$, specifically $C_f - M_f$ and $C_f + M_f$.
The sidebands have less strength than the carrier, and the strength of the sidebands is determined by the modulation index, which for AM is defined as the peak change in output amplitude divided by the amplitude of the carrier, $\Delta A/C_a$.^[When the modulation index is at maximum, each sideband is half of the strength of the carrier.]
An example of peak change is given in Figure \@ref(fig:am-modulation-index).
(ref:am-modulation-index) An example of peak amplitude change using sine waves for modulator and carrier. The indicated difference in amplitude between the carrier signal (red) and the output (yellow) is the peak amplitude change $\Delta A$.
```{r am-modulation-index, echo=F, out.width="100%", fig.cap="(ref:am-modulation-index)"}
knitr::include_graphics("images/am-modulation-index.png")
```
When the modulator and/or carrier are not sine waves, the sidebands contain the sums and differences for all pairs of partials between the modulator and the carrier.
For example, if $M_f$ has 3 partials and $C_f$ has 5 partials, then there are $3*5$ partials in the lower sideband and the same number in the upper sideband.
Even though the carrier frequency is not the fundamental, it is perceived as the pitch center of the sound, even when when the sidebands contain many partials.
Note that in the above formulas, any partial that crosses below zero disappears.
Also, if the modulator frequency goes above the carrier, $M_f > C_f$, the roles of carrier and modulator are reversed.
Implementing AM synthesis as described above is relatively simple in our virtual modular set up, but it has some surprises.
First, if we want pure sine waves, i.e. sine waves with only one harmonic, then we need to use wavetable oscillators, which we've briefly mentioned a few times up to this point but never used.
A [wavetable](https://en.wikipedia.org/wiki/Wavetable_synthesis) oscillator is a digital oscillator that defines a wave based on one stored cycle of that wave.
We need wavetable oscillators here to get a perfect sine wave, because the virtual analogue implementations faithfully recreate the imperfections of the original hardware.
This is also true for real VCAs, which tend to be a bit noisy, so we'll need to use a specific VCA that we've never used before.
All this effort is only necessary to get a result that matches the previous equations.
Otherwise you may not care about these small imperfections that give additional character to the sound through the extra sidebands they create.
Try creating a simple AM patch from scratch using the button in Figure \@ref(fig:am-example) and look carefully at the sidebands it creates.
(ref:am-example) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=empty.vcv&solution=%3cimg+class%3d%27rack-image%27+src%3d%27images%2fpatch-solutions%2fam-example.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+two+WT+VCOs%2c+AMP%2c+Scope%2c+and+Sassy%3c%2fli%3e%0a%3cli%3eOn+each+WT+VCO%2c+move+the+wavetable+position+knob+to+the+left+to+select+a+sine+wave.+The+intermediate+position+morph+between+other+waves+like+triangle+and+square%3c%2fli%3e%0a%3cli%3eConnect+the+oscillator+on+the+left+%28modulator%29+to+the+AMP+CV+and+to+a+Sassy+input%3c%2fli%3e%0a%3cli%3eConnect+the+oscilator+on+the+right+%28carrier%29+to+the+AMP+in+and+to+a+Sassy+input+%3c%2fli%3e%0a%3cli%3eConnect+the+AMP+out+to+Scope+in+and+a+Sassy+input.+Note+we+could+alternatively+use+other+VCAs+if+we+made+the+modulator+signal+unipolar%3c%2fli%3e%0a%3cli%3eEnable+the+external+trigger+on+the+Scope%2c+connect+the+modulator+output+to+the+Scop+external+trigger%2c+and+adjust+Sassy+for+high-quality+spectrogram+output+%28left+top+sliders+down+to+1%2f32%2c+top+right+slider+up+to+1000ms%2c+freq+radiobutton%2c+4x+radiobutton%29%3c%2fli%3e%0a%3cli%3eAdjust+the+oscillator+frequencies+so+that+the+modulator+is+lower+than+the+carrier+and+the+difference+is+sufficient+to+show+on+Sassy+and+not+cross+below+zero+%28I+used+60+and+400%29%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+scopes+%3cul%3e%0a%3cli%3eMouse+over+the+frequency+peaks+in+Sassy.+You+should+see+one+for+the+modulator%2c+one+for+the+carrier%2c+and+two+for+sidebands.+Check+their+values+and+compare+to+the+sideband+formula%3c%2fli%3e%0a%3cli%3eTemporarally+disconnect+the+Sassy+input+from+the+carrier.+You+should+now+see+a+peak+that+was+hidden+in+the+output+%3c%2fli%3e%0a%3cli%3eChange+the+time+knob+on+the+scope+to+look+at+the+output+waveshape+across+scales.+You+should+see+the+characteristic+waveshape+presented+earlier.+Connect+the+modulator+output+to+the+second+Scope+input+to+recreate+the+figure%3c%2fli%3e%0a%3cli%3eMove+the+modulator+wavetable+position+knob+slowly+upward+and+watch+the+change+in+Sassy.+You+will+see+both+new+peaks+in+the+spectrum+of+the+modulator+as+well+as+matching+peaks+in+sidebands+in+the+output+signal.%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fwtvco-solo.png%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2famp-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for amplitude modulation using pure sine waves.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("am-example", starter_file="empty.vcv", instructions_html="<ul>
<li>Add two WT VCOs, AMP, Scope, and Sassy</li>
<li>On each WT VCO, move the wavetable position knob to the left to select a sine wave. The intermediate position morph between other waves like triangle and square</li>
<li>Connect the oscillator on the left (modulator) to the AMP CV and to a Sassy input</li>
<li>Connect the oscilator on the right (carrier) to the AMP in and to a Sassy input </li>
<li>Connect the AMP out to Scope in and a Sassy input. Note we could alternatively use other VCAs if we made the modulator signal unipolar</li>
<li>Enable the external trigger on the Scope, connect the modulator output to the Scop external trigger, and adjust Sassy for high-quality spectrogram output (left top sliders down to 1/32, top right slider up to 1000ms, freq radiobutton, 4x radiobutton)</li>
<li>Adjust the oscillator frequencies so that the modulator is lower than the carrier and the difference is sufficient to show on Sassy and not cross below zero (I used 60 and 400)</li>
<li>Try the following and note the differences in the scopes <ul>
<li>Mouse over the frequency peaks in Sassy. You should see one for the modulator, one for the carrier, and two for sidebands. Check their values and compare to the sideband formula</li>
<li>Temporarally disconnect the Sassy input from the carrier. You should now see a peak that was hidden in the output </li>
<li>Change the time knob on the scope to look at the output waveshape across scales. You should see the characteristic waveshape presented earlier. Connect the modulator output to the second Scope input to recreate the figure</li>
<li>Move the modulator wavetable position knob slowly upward and watch the change in Sassy. You will see both new peaks in the spectrum of the modulator as well as matching peaks in sidebands in the output signal.</li>
</ul></li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/wtvco-solo.png'>
<img class='rack-image' src='images/solo-modules/amp-solo.png'>
</div>
",solution_html="<img class='rack-image' src='images/patch-solutions/am-example.png'>")
```
<!-- CAPTION BLOCK -->
```{r am-example, echo=F, out.width="100%", fig.cap="(ref:am-example)"}
modular_caption()
```
AM synthesis will generally produce inharmonic sidebands unless the modulator and carrier frequencies are chosen to create harmonic relationships.
Using sine waves for example, if modulator and carrier have the same frequency, then the lower sideband will be zero and the upper sideband will be one octave above the carrier, e.g. 100 and 200 Hz.
We can describe such frequency relationships between modulator and carrier in terms of ratios, so if both have the same frequency, the ratio of C:M is 1:1.
You can easily check that any N:1 ratio is harmonic, for example using 200 Hz as the carrier would result in 100, 200, and 300 Hz harmonics.
Likewise, N:2 where N is odd will give odd harmonics (100, 300, 500 Hz), and N:2 where N in even will give even harmonics (200, 400, 600 Hz).
Typical frequency ratios associated with musical intervals shown in Table \@ref(tab:freq-ratio) may also be used to create chordal harmonic structures.
Table: (\#tab:freq-ratio) Frequency ratios for musical intervals.
| Frequency ratio | Musical interval |
|:---------------:|------------------|
| 2:1 | Octave |
| 3:2 | Fifth |
| 4:3 | Fourth |
| 5:4 | Major third |
| 6:5 | Minor third |
Typically when a harmonic relationship like this has been established, one wishes to keep it intact while playing different notes.
This is as easy to accomplish as keeping two (or more) oscillators in tune as a chord while playing across a keyboard.
Try extending the last patch with a keyboard and use V/Oct connections to keep the harmonic relationship between modulator and carrier intact using the button in Figure \@ref(fig:am-keyboard-frequency-tracking).
This patch is also a good opportunity to explore the sounds of more complex modulator and carrier waves, as well as inharmonic sounds.
(ref:am-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=am-example.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2fam-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+Twelve-Key+and+Host+Audio%3c%2fli%3e%0a%3cli%3eMove+Scope+and+Sassy+to+the+lower+row+to+make+space%3c%2fli%3e%0a%3cli%3eConnect+12+ky+CV+to+both+oscillator+V%2fOct.+The+voltage+from+this+connection+will+be+summed+with+the+dialed+in+voltage+represented+by+each+oscillator%27s+frequency+knob%2c+so+when+each+receives+the+same+voltage+from+the+12+key%2c+the+relative+tuning+between+oscillators+will+not+change%3c%2fli%3e%0a%3cli%3eConnect+the+AMP+out+to+Host+audio+L%3c%2fli%3e%0a%3cli%3eSet+the+oscillators+to+have+a+harmonic+relationship%2c+e.g.+N%3a1%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3ePlay+across+the+keyboard.+Notice+that+the+carrier%2c+which+is+the+strongest+harmonic%2c+defines+the+perceived+pitch+and+that+the+sidebands+remain+harmonic+with+it%3c%2fli%3e%0a%3cli%3eTemporarally+disconnect+the+modulator+V%2fOct+and+play+up+the+keyboard.+Note+on+most+keys+the+result+is+inharmonic+but+it+becomes+harmonic+on+other+keys+by+chance%3c%2fli%3e%0a%3cli%3eReconnect+the+V%2fOct+and+move+the+modulator+wavetable+position+knob+slowly+upward+and+listen+to+the+change+in+the+sound.+Repeat+for+the+carrier+knob.+Note+that+the+carrier+remains+the+perceived+pitch+center+even+as+the+harmonics+increase+%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for amplitude modulation with keyboard tracking.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("am-keyboard-frequency-tracking", starter_file="am-example.vcv", instructions_html="<ul>
<li>Add Twelve-Key and Host Audio</li>
<li>Move Scope and Sassy to the lower row to make space</li>
<li>Connect 12 ky CV to both oscillator V/Oct. The voltage from this connection will be summed with the dialed in voltage represented by each oscillator's frequency knob, so when each receives the same voltage from the 12 key, the relative tuning between oscillators will not change</li>
<li>Connect the AMP out to Host audio L</li>
<li>Set the oscillators to have a harmonic relationship, e.g. N:1</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Play across the keyboard. Notice that the carrier, which is the strongest harmonic, defines the perceived pitch and that the sidebands remain harmonic with it</li>
<li>Temporarally disconnect the modulator V/Oct and play up the keyboard. Note on most keys the result is inharmonic but it becomes harmonic on other keys by chance</li>
<li>Reconnect the V/Oct and move the modulator wavetable position knob slowly upward and listen to the change in the sound. Repeat for the carrier knob. Note that the carrier remains the perceived pitch center even as the harmonics increase </li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/am-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r am-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:am-keyboard-frequency-tracking)"}
modular_caption()
```
AM creates an interesting sound with a fixed modulation index, but as with all audio-rate modulations, we can also change that modulation index over time.
All that is needed is a signal that changes over time and something to attenuate the modulation index in response to that signal.
We can extend the last patch along these lines by adding an envelope triggered by the keyboard where that envelope controls another VCA.
Every keypress will then cause a brief change in the modulation index, which will correspondingly change the strength of the sidebands.
This effect is even more pronounced for non-sine waves because there are more partials in the sidebands.
Try modulating the modulation index with an envelope using the button in Figure \@ref(fig:am-keyboard-frequency-tracking-adsr-modulation-index).
(ref:am-keyboard-frequency-tracking-adsr-modulation-index) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=am-keyboard-frequency-tracking.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2fam-keyboard-frequency-tracking-adsr-modulation-index.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+ADSR+and+another+AMP+to+the+right+of+the+carrier+VCO%3c%2fli%3e%0a%3cli%3eConnect+12+ky+gate+out+to+ADSR+gate+in%3c%2fli%3e%0a%3cli%3eConnect+ADSR+out+to+the+new+AMP+CV+in%3c%2fli%3e%0a%3cli%3eConnect+modulator+out+to+new+AMP+in%2c+new+AMP+out+to+old+AMP+CV%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3ePlay+across+the+keyboard.+Notice+the+enveloped+sound+becomes+a+bit+brighter+and+the+brightness+fades+with+the+envelope.+This+is+analogous+to+having+filter+whose+cutoff+is+controlled+by+an+envelope%2c+but+without+using+a+filter+module!%3c%2fli%3e%0a%3cli%3eChange+the+gain+on+the+new+AMP+all+the+way+down.+You+should+see+a+sine+wave+on+the+scope.+Now+when+you+play+across+the+keyboard%2c+the+envelope+it+going+from+non-AM+to+AM+wherease+before%2c+it+was+baseline+AM+to+stronger+AM%3c%2fli%3e%0a%3cli%3eRepeat+the+above+with+non-sine+waveshapes+for+modulator+and+carrier.+The+effect+of+the+envelope+is+even+more+dramatic+in+these+cases%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for amplitude modulation with keyboard tracking where the modulation index is controlled by an envelope.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("am-keyboard-frequency-tracking-adsr-modulation-index", starter_file="am-keyboard-frequency-tracking.vcv", instructions_html="<ul>
<li>Add ADSR and another AMP to the right of the carrier VCO</li>
<li>Connect 12 ky gate out to ADSR gate in</li>
<li>Connect ADSR out to the new AMP CV in</li>
<li>Connect modulator out to new AMP in, new AMP out to old AMP CV</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Play across the keyboard. Notice the enveloped sound becomes a bit brighter and the brightness fades with the envelope. This is analogous to having filter whose cutoff is controlled by an envelope, but without using a filter module!</li>
<li>Change the gain on the new AMP all the way down. You should see a sine wave on the scope. Now when you play across the keyboard, the envelope it going from non-AM to AM wherease before, it was baseline AM to stronger AM</li>
<li>Repeat the above with non-sine waveshapes for modulator and carrier. The effect of the envelope is even more dramatic in these cases</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/am-keyboard-frequency-tracking-adsr-modulation-index.png'>")
```
<!-- CAPTION BLOCK -->
```{r am-keyboard-frequency-tracking-adsr-modulation-index, echo=F, out.width="100%", fig.cap="(ref:am-keyboard-frequency-tracking-adsr-modulation-index)"}
modular_caption()
```
### Ring modulation
Ring modulation (RM) is implemented the same way as AM, except with a VCA where the control value can cross below zero.
That means that RM multiplies the carrier signal by the control value of the VCA, but since the control value can be negative, the output can also be negative.
Negative output may sound strange at first, but it is exactly the same as positive output *except* inverted.
Thus RM operates just like AM except that RM will never stop at zero, and when it crosses zero, the output is the same as above zero except inverted.
This behavior is illustrated in Figure \@ref(fig:rm-bipolar).
(ref:rm-bipolar) An example of ring modulation using sine waves for modulator and carrier. Note that where the modulator signal (purple) is at either its positive or negative peak, the output (yellow) is at greatest strength. The overall amplitude of the output is reduced relative to Figure \@ref(fig:am-unipolar) due to the removal of the carrier frequency (see text).
```{r rm-bipolar, echo=F, out.width="100%", fig.cap="(ref:rm-bipolar)"}
knitr::include_graphics("images/rm-bipolar.png")
```
Historically, ring modulation was performed by a [circuit consisting of diodes arranged in a ring](https://en.wikipedia.org/wiki/Ring_modulation), thus the name.
Ring modulators and VCAs are sometimes called four- and two-quadrant multipliers.
On a VCA, the input signal can be bipolar but the control value is unipolar.
That means the VCA output is restricted to two quadrants of the Cartesian plane.
On a ring modulator, both input signal and control can be bipolar, so the output can occur in all four quadrants of the Cartesian plane.
The difference between four- and two-quadrant multipliers is illustrated in Figure \@ref(fig:four-quadrant-multiplier).
Ring modulators are also sometimes called balanced modulators because the modulating signal spends as much time being negative as positive.
(ref:four-quadrant-multiplier) A two-quadrant multiplier multiplies a bipolar signal (carrier) and a unipolar signal (control voltage), so has output in two quadrants (left). A four-quadrant multiplier multiplies two bipolar signals, so has output in all four quadrants (right).
```{r four-quadrant-multiplier, echo=F, out.width="100%", fig.cap="(ref:four-quadrant-multiplier)"}
knitr::include_graphics("images/four-quadrant-multiplier.png")
```
Like AM, side bands for RM are easiest to understand for sine waves.
The output spectrum is the same as AM, except that the carrier frequency $C_f$ is removed, leaving only the side bands $C_f - M_f$ and $C_f + M_f$, and any sidebands that cross below zero are reflected back as their absolute value instead of being lost.
Similarly, when the modulator and/or carrier are not sine waves, the sidebands contain the sums and differences for all pairs of partials between the modulator and the carrier.
The modulation index for RM is likewise the same as AM, and if the modulator frequency goes above the carrier, $M_f > C_f$, the roles of carrier and modulator are reversed.
We can implement RM with a slight modification to the first AM patch.
Again, the choice of module is important to get identical behavior to the equations above, though in practice, the character of small imperfections might be preferred.
Try creating a simple RM patch extending the AM patch using the button in Figure \@ref(fig:rm-example).
(ref:rm-example) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=am-example.vcv&solution=%3cimg+class%3d%27rack-image%27+src%3d%27images%2fpatch-solutions%2frm-example.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+feidah%2c+copy+the+connections+from+AMP+over+to+it%2c+and+remove+AMP%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+scopes+%3cul%3e%0a%3cli%3eMouse+over+the+frequency+peaks+in+Sassy.+You+should+see+one+for+the+modulator%2c+one+for+the+carrier%2c+and+two+for+sidebands.+Check+their+values+and+compare+to+the+sideband+formula%3c%2fli%3e%0a%3cli%3eTemporarally+disconnect+the+Sassy+input+from+the+carrier.+You+should+see+that+this+carrier+partial+is+missing+from+the+ring+mod+output%3c%2fli%3e%0a%3cli%3eChange+the+time+knob+on+the+scope+to+look+at+the+output+waveshape+across+scales.+You+should+see+the+characteristic+waveshape+presented+earlier.+Connect+the+modulator+output+to+the+second+Scope+input+to+recreate+the+figure%3c%2fli%3e%0a%3cli%3eMove+the+modulator+wavetable+position+knob+slowly+upward+and+watch+the+change+in+Sassy.+You+will+see+both+new+peaks+in+the+spectrum+of+the+modulator+as+well+as+matching+peaks+in+sidebands+in+the+output+signal.%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2ffeidah-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for ring modulation using pure sine waves.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("rm-example", starter_file="am-example.vcv", instructions_html="<ul>
<li>Add feidah, copy the connections from AMP over to it, and remove AMP</li>
<li>Try the following and note the differences in the scopes <ul>
<li>Mouse over the frequency peaks in Sassy. You should see one for the modulator, one for the carrier, and two for sidebands. Check their values and compare to the sideband formula</li>
<li>Temporarally disconnect the Sassy input from the carrier. You should see that this carrier partial is missing from the ring mod output</li>
<li>Change the time knob on the scope to look at the output waveshape across scales. You should see the characteristic waveshape presented earlier. Connect the modulator output to the second Scope input to recreate the figure</li>
<li>Move the modulator wavetable position knob slowly upward and watch the change in Sassy. You will see both new peaks in the spectrum of the modulator as well as matching peaks in sidebands in the output signal.</li>
</ul></li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/feidah-solo.png'>
</div>
",solution_html="<img class='rack-image' src='images/patch-solutions/rm-example.png'>")
```
<!-- CAPTION BLOCK -->
```{r rm-example, echo=F, out.width="100%", fig.cap="(ref:rm-example)"}
modular_caption()
```
In terms of harmonicity, RM is again identical to AM except for the properties of missing the carrier frequency and reflections of sideband partials off zero.
The missing carrier means that the overall spectrum will no longer have a strong pitch center.
However, our perception tends to fill in the missing frequency of the carrier such that the pitch still seems centered there, just not as strongly.
Reflected sideband partials have potential to interfere with other partials, but this will occur only when the modulator or carrier has a richer waveshape than sign and thus higher harmonics to subtract.
Otherwise the same concepts about harmonic frequency ratios, keyboard tracking, and modulating the modulation index apply to RM as AM.
Try extending the final AM patch to RM using the button in Figure \@ref(fig:rm-keyboard-frequency-tracking).
This patch is also a good opportunity to explore how the sound of RM differs from AM.
(ref:rm-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=rm-keyboard-frequency-tracking-adsr-modulation-index.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2frm-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+two+feidahs%2c+copy+the+connections+from+the+AMPs+over+to+them%2c+and+remove+the+AMPs%3c%2fli%3e%0a%3cli%3eSet+the+oscillators+to+have+a+harmonic+relationship%2c+e.g.+N%3a1%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3ePlay+across+the+keyboard.+Notice+that+even+with+the+carrier+missing%2c+it+still+defines+the+perceived+pitch+and+the+sidebands+remain+harmonic+with+it.+Notice+the+change+in+brightness+with+the+envelope%3c%2fli%3e%0a%3cli%3eTemporarally+disconnect+the+modulator+V%2fOct+and+play+up+the+keyboard.+Note+the+result+is+perhaps+a+bit+less+inharmonic+than+AM+under+these+conditions%3c%2fli%3e%0a%3cli%3eReconnect+the+V%2fOct+and+move+the+modulator+wavetable+position+knob+slowly+upward+and+listen+to+the+change+in+the+sound.+Note+that+as+the+shape+approaches+saw%2c+the+carrier+frequency+is+filled+in+by+reflection.+Repeat+for+the+carrier+knob.+Note+that+the+missing+carrier+remains+the+perceived+pitch+center+even+as+the+harmonics+increase.%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for ring modulation with keyboard tracking.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("rm-keyboard-frequency-tracking", starter_file="rm-keyboard-frequency-tracking-adsr-modulation-index.vcv", instructions_html="<ul>
<li>Add two feidahs, copy the connections from the AMPs over to them, and remove the AMPs</li>
<li>Set the oscillators to have a harmonic relationship, e.g. N:1</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Play across the keyboard. Notice that even with the carrier missing, it still defines the perceived pitch and the sidebands remain harmonic with it. Notice the change in brightness with the envelope</li>
<li>Temporarally disconnect the modulator V/Oct and play up the keyboard. Note the result is perhaps a bit less inharmonic than AM under these conditions</li>
<li>Reconnect the V/Oct and move the modulator wavetable position knob slowly upward and listen to the change in the sound. Note that as the shape approaches saw, the carrier frequency is filled in by reflection. Repeat for the carrier knob. Note that the missing carrier remains the perceived pitch center even as the harmonics increase.</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/rm-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r rm-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:rm-keyboard-frequency-tracking)"}
modular_caption()
```
RM and AM are similar in operation and in sound.
The main differences revolve around the missing carrier component and sidebands reflecting off zero.
Both of these emphasize sidebands in RM, because the sidebands have more energy in them and are never destroyed.
In contrast, AM puts more weight on the carrier frequency and less on the sidebands.
Another way of looking at the difference is that RM copies the characteristics of the carrier into the sidebands without including the carrier, whereas AM copies the same characteristics to a lesser extent and includes the carrier.
This makes RM potentially more useful as an audio processing tool than AM.
These differences between AM and RM are illustrated in Figure \@ref(fig:am-rm-modsquare-carsaw).
(ref:am-rm-modsquare-carsaw) AM (left) and RM (right) for a square wave modulator (blue) and a saw wave carrier (yellow). Note that the energy of the saw wave carrier is more strongly preserved in AM, whereas in RM, the characteristics of the carrier are preserved without preserving its energy.
```{r am-rm-modsquare-carsaw, echo=F, out.width="100%", fig.cap="(ref:am-rm-modsquare-carsaw)"}
knitr::include_graphics("images/am-rm-modsquare-carsaw.png")
```
## Modulating frequency
The frequency family includes frequency modulation and phase modulation.
Since $frequency * time = phase$, frequency and phase modulation are closely related.
However, understanding this modulation family in modular synthesis requires understanding not just the math behind them but also the history.
Many modular synthesis methods involving this family are actually approximations rather than exact implementations.
Each approximation has its own characteristic sound that is now part of the genre of electronic music.
Thus understanding this family requires understanding both the true methods and the approximations.
### Frequency modulation
Frequency modulation (FM) is a widespread method for radio transmission, just like AM.
In the context of modular synthesis, FM is strongly associated with @Chowning1973, whose work in the 1970s [was used in the Yamaha FM synthesizers](https://en.wikipedia.org/wiki/Frequency_modulation_synthesis), notably the DX7.^[Technically Chowning's FM is phase modulation, as will be discussed later in the chapter.]
<!-- Although Chowning's approach arrived decades after FM was used in modular synthesis, it sets the standard for all other forms of FM, which can largely be viewed as approximations of it. -->
Historically, FM synthesis methods have only approximated true FM.
The purpose of this section is thus to explain true FM so that approximations have a common reference point.
We previously covered the basic idea of FM in Section \@ref(vibrato) to produce vibrato.
As you recall, we used an LFO at relatively low rates to control a VCA, and the VCA was controlling the V/Oct of our main oscillator.
In FM we don't use a VCA but instead an attenuverter/polarizer, i.e. FM crosses zero just like RM.
The attenuverter/polarizer is often integrated into the carrier oscillator with a corresponding FM input.
The voltage into the carrier's FM input is added to the voltage into the carrier's V/Oct input, so when only one input is used, these two inputs are interchangeable.
When using both, the V/Oct defines the carrier's frequency, and the FM input defines the variation around that frequency.
Thus as the modulator's strength increases,^[The strength of the modulation is the amplitude of the modulation, just like the strength of any wave is the amplitude of the wave.] the frequency of the output increases, and as the modulator's strength decreases, the frequency of the output decreases, as shown in Figure \@ref(fig:fm-voct-composite).
(ref:fm-voct-composite) Voltage controlled oscillators typically have an FM input (lower left) in addition to a V/Oct input (upper left). The voltage from these two inputs is internally summed, thus V/Oct can be used to define a center frequency and FM can be used to define a variation around that frequency. Note the attenuator knob directly above the FM jack can be used to attenuate the FM voltage and therefore the strength of the modulation. The effect of the modulator through the FM jack (right) causes the carrier (yellow) to increase or decrease in frequency according to the value of the modulator (blue).
```{r fm-voct-composite, echo=F, out.width="100%", fig.cap="(ref:fm-voct-composite)"}
knitr::include_graphics("images/fm-voct-composite.png")
```
As with AM and RM, FM creates sidebands symmetrically around the carrier frequency.
However, FM creates an infinite number of sideband partials rather than just two - even when the modulator and carrier are sine waves.
These side band partials are arranged in pairs as $C_f - nM_f$ and $C_f + nM_f$, where $n$ is a natural number.
The FM sideband formula is the same as the AM/RM formula except that for AM/RM, $n$ is fixed at 1 instead of ranging from 1 to infinity.
FM side bands have several unusual behaviors with respect to phase.
When $n$ is odd, the side band partials below $C_f$ have reversed phase.
Additionally, partials that cross zero will reflect with a reversal of phase.
The above is also true when the modulator and carrier are non-sine waves, in which case each pairing of partials between them creates a new sideband pair.
To avoid confusion around the word "pair," the following discussion of sidebands will be restricted to sine waves.
The FM modulation index is defined as the peak change in output frequency divided by the highest frequency component of the modulator, $\Delta F/M_f$.
Changing the modulation index has a dramatic effect on the timbre for several reasons.
First, the modulation index controls how many sideband partials are audible.
Although FM produces infinite sidebands, most of the partials have negligible amplitude and are imperceptible.
According to [Carson's bandwith rule](https://en.wikipedia.org/wiki/Carson_bandwidth_rule), 98% of the energy in the spectrum is within a bandwidth defined by $2(\Delta F + M_f)$, so holding $M_f$ constant, the FM bandwidth will increase as the modulation index increases.
Larger bandwidth affects the timbre of the sound by increasing the audible sideband partials and increasing the opportunities for partials to reflect off zero and interfere with existing partials.
Second, as the modulation index increases, each sideband pair defined by $n$ changes in amplitude according to its own Bessel function, and once the Bessel function crosses below zero, the sideband pair reverses phase.
The amplitude changes created by the Bessel functions ripple outward for increasing $n$ as the modulation index increases, as shown in Figure \@ref(fig:bessel-modulation).
So the FM modulation index changes both the number of sideband partials and their relative strengths at the same time, both of which affect timbre.
(ref:bessel-modulation) [Vimeo video](https://vimeo.com/309150702) of FM sideband pair amplitudes following Bessel functions as the modulation index increases. Image [© Jeffery Hass](https://vimeo.com/jeffreyhass).
```{r bessel-modulation, fig.cap="(ref:bessel-modulation)", echo = F}
embed_vimeo("309150702")
```
Figure \@ref(fig:bessel-modulation) illustrates how the brightness of the sound increases as the modulation index increases.
Because there is a fluctuating loss of energy behind the peaking Bessel functions, the pitch center feels somewhat unstable as the modulation index increases.
Depending on where the carrier frequency falls along equal loudness contours (see Chapter \@ref(physics-and-perception-of-sound)), the perceived pitch can appear to move up or down as the modulation index increases.
For example, the pitch in Figure \@ref(fig:bessel-modulation) is about 700 Hz, at which point human hearing has more sensitivity to higher frequencies than lower frequencies.
Thus as the modulation index increases, the upper sideband is perceived as louder than the lower sideband, causing a perception of upward pitch shift.
FM harmonic ratios of carrier to modulator (C:M) are likewise more complex than for AM/RM because FM sidebands are infinite and reflect from zero out of phase.
Additionally, sideband partials may already be inverted if they are both odd and less than the carrier frequency or if their Bessel function drops below zero.
If we only consider reflection from zero and ignore the other complexities, a 1:1 ratio will produce all harmonics and thus be similar to a saw wave.
This is because the first lower sideband partial is $1-1=0$, and all negative partials for higher $n$ reflect back on top of their positive counterparts.
Thus for 1:1, the carrier frequency is the fundamental, and the lower sideband is reflected on top of the upper sideband.
Another simple example is 1:2.
Since every sideband partial will be $1 \pm n2$, the partials will always be odd, giving a spectrum similar to a square wave.
Again the lower sideband will reflect across zero on top of the upper sideband, and the carrier frequency will be the fundamental.
Properties of C:M ratios can be generalized across integers.
For example, any N:1 will generate all harmonics starting at the value of 1, though the carrier will only be the fundamental for 1:1.
Ratio 1:N will skip every nth partial, e.g. for 1:3, partials 3, 9, 27, and so on will be skipped.
Ratio N:2 will yield only even partials if N is even and only odd partials if N is odd.
These examples show how different ratios can create the same result and illustrates the complexity of this topic, even under our current simplifying assumptions.
If we consider ratios that produce the same result as a family, then we can describe families using a single ratio called [the normal form ratio](http://www.sfu.ca/%7Etruax/fmtut.html) by taking $|C-M|$ until the result is either 1:1 or $M \ge 2C$.
For example, any N:1 will reduce to 1:1 in normal form because we repeatedly subtract 1 from N until 1:1 is reached.
An important use of normal form ratios is to tell if a ratio is harmonic or not.
Any harmonic ratio will have a normal form of 1:N, and any other normal form ratio will be inharmonic.
For example, 2:7 is in normal form because $M \ge 2C$, but it is not 1:N, so it is inharmonic.
An extended table of interesting ratios has been developed by @Truax1977.
Keyboard tracking with FM requires no additional effort relative to AM/RM.
Even though the modulation index, $\Delta F/M_f$, depends on the frequency of the modulator, if we send the same V/Oct to modulator and carrier, the numerator and denominator of the modulation index will change by the same amount so the modulation index overall will not change.
Thus timbre will remain constant across the keyboard using the same approach to keyboard tracking as AM/RM.
The discussion to this point has focused on basic FM.
Even basic FM is fairly nuanced and complex, which explains why FM was first properly implemented digitally.
More advanced digital applications of FM involve modulators modulating other modulators, sometimes with feedback loops (so modulators are modulating themselves).
These advanced digital algorithms are typically defined using [operators](https://www.soundonsound.com/techniques/more-frequency-modulation#para5), where each operator is an oscillator, VCA, and envelope, as shown in Figure \@ref(fig:two-op-fm).
For reference, the DX7 uses six operators - the equivalent of 18 modules!
While the number of modules required to implement advanced FM algorithms in analogue may sometimes be impractical, understanding the correspondence between operators and modules will help you import ideas from digital FM into analogue.
(ref:two-op-fm) Two operator FM. Image [© Clusternote/CC-BY-SA-3.0](https://commons.wikimedia.org/wiki/File:2op_FM.svg).
```{r two-op-fm, echo=F, out.width="100%", fig.cap="(ref:two-op-fm)"}
knitr::include_graphics("images/2op_FM.svg.png")
```
This section is one of the most technical in the book, and it's easy to get lost in the details of FM.
The most important things to remember about true FM are:
- The FM modulation index changes timbre, becoming more bright with higher index
- FM sidebands reflect off zero and interfere with partials in complex ways, creating a variety of sounds
- C:M ratios broadly define FM harmonic structure, and some C:M ratios are inharmonic
### Analogue exponential frequency modulation
Although frequency modulation has been traced back as far as the 1940s [@Bode1984], exponential frequency modulation (EFM) seems most strongly associated with the modular synthesizers after the 1960s when Robert Moog [advanced the exponential volt per octave standard](https://en.wikipedia.org/wiki/Moog_synthesizer).
In EFM, the output is moved an **equal musical interval** around the carrier's default value.
For example, suppose a $\pm1 V$ modulation signal goes into a 400 Hz carrier's FM input.
Then the first pair of sidebands will be 200 Hz and 800 Hz, or half and double the carrier frequency, respectively.
Since the output spends more time above 400 Hz than below it, the perceived pitch is shifted above 400 Hz.
The EFM pitch shift increases as the modulation index increases [@Hutchins1975] and
is very problematic for staying in tune with other instruments.
Workarounds to the pitch shift problem for EFM include playing with other pitched instruments over a narrow frequency range where the shift is negligible, not playing with other pitched instruments at all, and using EFM for percussion only.
The effect of modulating by an equal musical interval goes beyond pitch shift.
As the EFM modulation index increases and the sidebands grow, they become increasingly asymmetric, which breaks the normal FM harmonic ratios [@Hutchins1975].
Recall that normal FM harmonic ratios are heavily dependent on the property of reflecting off zero.
In EFM, partials rarely reflect off zero because the change in frequency can never reach zero^[Exponential functions don't cross zero.] and the overall pitch shift pulls the lower sideband away from zero.
Thus the partials mostly don't reflect off zero, and the normal harmonic ratios are no longer valid.
In practice this means that it is difficult to get a stable output that is strongly harmonic as the modulation index increases, in addition to the pitch shift problem.
Despite these challenges, EFM has a history in electronic music and has been widely used for percussive and inharmonic sounds.
Let's build up some patches to explore EFM, starting with a basic patch to investigate the sidebands and pitch shift.
Try simple EFM with sine waves using the button in Figure \@ref(fig:efm-example) and note the effect of the modulation index on sidebands, pitch shift, and the harmonicity of the timbre.
(ref:efm-example) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=rm-example.vcv&solution=%3cimg+class%3d%27rack-image%27+src%3d%27images%2fpatch-solutions%2fefm-example.png%27%3e&instructions=%3cul%3e%0a%3cli%3eRemove+feidah+and+add+Host+audio%3c%2fli%3e%0a%3cli%3eConnect+the+modulator+out+to+the+carrier+FM+in%3c%2fli%3e%0a%3cli%3eConnect+the+carrier+out+to+Scope+in+1+and+modulator+out+to+Scope+in+2%3c%2fli%3e%0a%3cli%3eConnect+the+carrier+out+to+Host+audio+L%3c%2fli%3e%0a%3cli%3eSet+the+oscillators+to+have+a+harmonic+relationship%2c+e.g.+N%3a1%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eTurn+up+the+FM+carrier+knob+slightly.+Mouse+over+the+frequency+peaks+in+Sassy.+You+should+see+one+for+the+modulator%2c+one+for+the+carrier%2c+and+two+for+sidebands.+Check+their+values+against+the+sideband+formula+with+exponential+modulation+%28i.e.+half+and+double+C+%2b%2f-+M%29%3c%2fli%3e%0a%3cli%3eSlowly+turn+up+the+carrier+FM+knob.+This+will+increase+the+modulation+index.+Observe+the+changes+in+both+the+spectrum+and+the+pitch+of+the+sound.+At+what+modulation+index+does+the+pitch+seem+to+noticably+change%3f+Does+the+sound+become+inharmonic+at+a+different+time+or+the+same+time%3f%3c%2fli%3e%0a%3cli%3eChange+the+carrier+FM+knob+down+to+a+low+but+not+zero+level.+Now+increase+the+waveshape+knob+on+the+modulator+and+note+the+change+in+pitch.+This+is+because+the+modulation+index+is+based+on+the+highest+frequency+component+of+the+modulator%2c+so+when+you+use+a+waveshape+with+higher+harmonics%2c+the+modulation+index+will+also+change.%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for exponential frequency modulation illustrating pitch shift and inharmonicity with increasing modulation index.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("efm-example", starter_file="rm-example.vcv", instructions_html="<ul>
<li>Remove feidah and add Host audio</li>
<li>Connect the modulator out to the carrier FM in</li>
<li>Connect the carrier out to Scope in 1 and modulator out to Scope in 2</li>
<li>Connect the carrier out to Host audio L</li>
<li>Set the oscillators to have a harmonic relationship, e.g. N:1</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Turn up the FM carrier knob slightly. Mouse over the frequency peaks in Sassy. You should see one for the modulator, one for the carrier, and two for sidebands. Check their values against the sideband formula with exponential modulation (i.e. half and double C +/- M)</li>
<li>Slowly turn up the carrier FM knob. This will increase the modulation index. Observe the changes in both the spectrum and the pitch of the sound. At what modulation index does the pitch seem to noticably change? Does the sound become inharmonic at a different time or the same time?</li>
<li>Change the carrier FM knob down to a low but not zero level. Now increase the waveshape knob on the modulator and note the change in pitch. This is because the modulation index is based on the highest frequency component of the modulator, so when you use a waveshape with higher harmonics, the modulation index will also change.</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image' src='images/patch-solutions/efm-example.png'>")
```
<!-- CAPTION BLOCK -->
```{r efm-example, echo=F, out.width="100%", fig.cap="(ref:efm-example)"}
modular_caption()
```
As you can see from the patch in Figure \@ref(fig:efm-example), increasing the modulation index very quickly shifts the pitch up and makes the sound less harmonic.
To my ears the inharmonic aspect is essentially immediate and the pitch shift is noticeable around 10%.
Similarly, changing the waveshape of the modulator from sine to anything else creates a pitch shift because the modulation index is based on the highest frequency component of $M_f$.
We can use mathematical thinking to highlight what EFM is doing and how it diverges from true FM.
Recall that a 1:1 ratio means that the carrier is the fundamental of a harmonic series with all harmonics.
What will happen in EFM if we use a 1:1 ratio?
Try extending the last patch to add keyboard tracking using the button in Figure \@ref(fig:efm-keyboard-frequency-tracking).
While keyboard tracking isn't strictly necessary for this demonstration, it makes it more fun and sets up comparisons with other forms of FM.
(ref:efm-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=efm-example.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2fefm-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eMove+the+VCOs+to+the+upper+row%3c%2fli%3e%0a%3cli%3eAdd+12+key+to+the+lower+row+and+connect+its+CV+out+to+the+modulator+and+carrier+V%2fOct%3c%2fli%3e%0a%3cli%3eSet+the+oscillators+to+have+a+1%3a1+relationship%2c+with+both+at+800+Hz%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eAdjust+FM+knob+and+note+the+change+in+timbre%3c%2fli%3e%0a%3cli%3eChoose+a+timbre+with+few+enough+sidebands+that+you+can+easily+count+them%2c+then+play+up+the+keyboard+and+note+if+the+number+changes+and+sounds+changes.+Now+change+the+keyboard+octave+up+by+2+and+play+across+the+keyboard+again.+Notice+how+the+timbre+remains+the+same%2c+as+expected%3c%2fli%3e%0a%3cli%3eTake+the+FM+knob+back+down+to+zero%2c+set+the+12+key+octave+to+4%2c+and+press+the+leftmost+key+%28which+sends+0+volts%29%3c%2fli%3e%0a%3cli%3eSassy+should+show+a+peak+at+800+Hz%3c%2fli%3e%0a%3cli%3eIncrease+the+FM+knob+and+remember+you+should+NOT+see+any+partials+below+800+Hz+in+true+FM%2c+but+one+appears+almost+immediately+around+5%25+FM%3c%2fli%3e%0a%3cli%3eAs+you+continue+to+move+the+knob%2c+that+rogue+harmonic+moves+up%2c+as+does+the+carrier%2c+and+more+rogue+harmonics+appear+%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eAdd+feidah+between+the+VCOs+on+the+top+row+and+an+LFO+to+the+bottom+row+%3c%2fli%3e%0a%3cli%3eConnect+the+modulator+out+to+feidah+in%3c%2fli%3e%0a%3cli%3eConnect+feidah+out+to+carrier+FM+in+and+turn+both+the+feidah+level+and+FM+knob+to+fully+open+%3c%2fli%3e%0a%3cli%3eConnect+the+LFO+triangle+out+to+the+feidah+vca+in+and+set+the+LFO+frequency+to+.1+or+less%3c%2fli%3e%0a%3cli%3eNotice+the+pitch+shift+we+expect+from+EFM+but+also+the+corresponding+change+in+harmonics%2c+with+the+rogue+harmonics+appearing+below+the+carrier+frequency+and+all+partials+moving+up%2c+even+though+the+VCO+frequencies+are+constant.+This+illustrates+the+massive+pitch+stability+problem+for+EFM+when+the+modulation+index+changes%3a+the+fundamental+is+being+supplanted+by+rogue+harmonics+and+the+spectrum+is+being+shifted+at+the+same+time%3c%2fli%3e%0a%3c%2ful%3e%0a) for exponential frequency modulation with keyboard tracking and exploring a 1:1 ratio.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("efm-keyboard-frequency-tracking", starter_file="efm-example.vcv", instructions_html="<ul>
<li>Move the VCOs to the upper row</li>
<li>Add 12 key to the lower row and connect its CV out to the modulator and carrier V/Oct</li>
<li>Set the oscillators to have a 1:1 relationship, with both at 800 Hz</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Adjust FM knob and note the change in timbre</li>
<li>Choose a timbre with few enough sidebands that you can easily count them, then play up the keyboard and note if the number changes and sounds changes. Now change the keyboard octave up by 2 and play across the keyboard again. Notice how the timbre remains the same, as expected</li>
<li>Take the FM knob back down to zero, set the 12 key octave to 4, and press the leftmost key (which sends 0 volts)</li>
<li>Sassy should show a peak at 800 Hz</li>
<li>Increase the FM knob and remember you should NOT see any partials below 800 Hz in true FM, but one appears almost immediately around 5% FM</li>
<li>As you continue to move the knob, that rogue harmonic moves up, as does the carrier, and more rogue harmonics appear </li>
</ul></li>
<li>Add feidah between the VCOs on the top row and an LFO to the bottom row </li>
<li>Connect the modulator out to feidah in</li>
<li>Connect feidah out to carrier FM in and turn both the feidah level and FM knob to fully open </li>
<li>Connect the LFO triangle out to the feidah vca in and set the LFO frequency to .1 or less</li>
<li>Notice the pitch shift we expect from EFM but also the corresponding change in harmonics, with the rogue harmonics appearing below the carrier frequency and all partials moving up, even though the VCO frequencies are constant. This illustrates the massive pitch stability problem for EFM when the modulation index changes: the fundamental is being supplanted by rogue harmonics and the spectrum is being shifted at the same time</li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/efm-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r efm-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:efm-keyboard-frequency-tracking)"}
modular_caption()
```
The patch in Figure \@ref(fig:efm-keyboard-frequency-tracking) demonstrates workable EFM keyboard tracking for a moderate fixed modulation index, as expected.^[For example, with feidah at .5 I get zero pitch shift across an octave from C4 to C5 but 6 cents of shift over two octaves, which is [generally perceptible](https://en.wikipedia.org/wiki/Cent_(music)).]
However, the patch also demonstrates how EFM, even using a small modulation index, diverges from true FM.
Not only do we find rogue harmonics below the fundamental, which should not happen with a 1:1 ratio, but we also see the a broad shift in the spectrum as the modulation index is modulated by an LFO, which badly affects EFM's pitch stability during modulation index changes.
These imperfections of EFM give it an interesting sound, so as previously stated, these problems may not be problems depending on the musical goal.
Neither staying in tune with other instruments across multiple octaves nor dynamically changing the modulation index are necessary in every situation.
In addition to its distinctive pitched sound, EFM works quite well in percussive voices.
The kick drum patch in Section \@ref(improving-our-understanding-of-the-problem) actually used FM in the sense of modulating the V/Oct of a sine wave, albeit for a single-cycle envelope.
As a more interesting example, we can use an envelope to control both overall sound and the modulation index to create a bell like sound.
Try extending the last patch to with an envelope to create a bell sound using the button in Figure \@ref(fig:efm-keyboard-bell).
(ref:efm-keyboard-bell) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=efm-keyboard-frequency-tracking.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2fefm-keyboard-bell.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+ADSR+and+QuadVCA%2fMixer+to+the+top+row+on+the+right%3c%2fli%3e%0a%3cli%3eConnect+carrier+out+to+QuadVCA%2fMixer+input+1%3c%2fli%3e%0a%3cli%3eConnect+QuadVCA%2fMixer+mix+out+to+Host+audio+L%3c%2fli%3e%0a%3cli%3eConnect+ADSR+out+to++QuadVCA%2fMixer+CV+input+1+and+feidah+VCA+in%3c%2fli%3e%0a%3cli%3eConnect+12+key+out+to+ADSR+gate+in%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eAdjust+ADSR+to+get+a+bell+like+timbre+with+feidah+level+set+at+25%25%3c%2fli%3e%0a%3cli%3eOnce+the+ADSR+is+set%2c+increase+feidah+level+to+get+a+better+timbre%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for exponential frequency modulation to create a bell sound.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("efm-keyboard-bell", starter_file="efm-keyboard-frequency-tracking.vcv", instructions_html="<ul>
<li>Add ADSR and QuadVCA/Mixer to the top row on the right</li>
<li>Connect carrier out to QuadVCA/Mixer input 1</li>
<li>Connect QuadVCA/Mixer mix out to Host audio L</li>
<li>Connect ADSR out to QuadVCA/Mixer CV input 1 and feidah VCA in</li>
<li>Connect 12 key out to ADSR gate in</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Adjust ADSR to get a bell like timbre with feidah level set at 25%</li>
<li>Once the ADSR is set, increase feidah level to get a better timbre</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/efm-keyboard-bell.png'>")
```
<!-- CAPTION BLOCK -->
```{r efm-keyboard-bell, echo=F, out.width="100%", fig.cap="(ref:efm-keyboard-bell)"}
modular_caption()
```
### Analogue linear frequency modulation
In analogue linear frequency modulation (LFM), the output is moved in **equal frequencies** around the carrier's default value.
Thus LFM matches the behavior of true FM previously discussed, e.g. a 100 Hz modulator and 400 Hz carrier will create side bands at 300 Hz and 500 Hz.
Because LFM spends equal time above and below the carrier frequency, pitch shift is not an intrinsic problem as it is in EFM.
In modular, LFM is implemented invisibly: a module will except V/Oct into an FM jack, but internally that signal will be processed as a linear signal.
While LFM is a is closer approximation of true FM, it's still an imperfect approximation that leads to the same types of problems as EFM.
Recall the basic problem with EFM was asymmetry of the sidebands.
Because the upper sideband was wider than the lower sideband, and this asymmetry grew with increasing modulation index, EFM's pitch shifts upward and the harmonic ratios are destroyed.
In EFM, these problems are intrinsic because EFM moves the output in equal musical intervals rather than equal frequencies.
Even though LFM doesn't intrinsically have this asymmetry problem, it has the asymmetry problem in practical use.
<!-- the asymmetry problem reappears as soon as the LFM bandwidth gets close to zero. -->
To understand the asymmetry problem for LFM, consider a simple example.
Suppose a 100 Hz modulator and 400 Hz carrier as before.
As we increase the strength of the modulation, the peak change in output frequency $\Delta F$ will increase, as will the modulation index, which is defined as $\Delta F/M_f$.
When the modulation index is 4, $\Delta F = 400Hz$, the output ranges from 0 Hz to 800 Hz.
<!-- LFM becomes asymmetric at this point because -->
Because analogue oscillators that implement LFM don't go below zero but rather stop at zero, FM becomes asymmetric at this point and ranges over more frequencies above the carrier than below it, leading to pitch shift.
The pitch shift pulls sidebands away from zero, which destroys harmonic ratios just like EFM.
Perhaps the best way to contrast EFM and LFM is that in EFM, these are intrinsic problems, whereas for LFM, these problems arise at a relatively higher modulation index.
In practice, however, we typically want a higher modulation index in order to get interesting timbres, and it is at this point where the differences between EFM and LFM become less clear.
My experience with LFM is that it has better keyboard tracking when using an equivalent small modulation index with EFM, e.g. half the pitch shift over 4 octaves.
Other than that, it seems one can consider LFM to be a linearized version of EFM with basically the same characteristics.
The linear response of LFM means that turning a knob to increase the modulation index will not increase it as quickly as the exponential response of EFM, but under conditions where their modulation indices can be matched, their frequency spectrums are very similar.
We can investigate these issues again by using a 1:1 ratio and comparing the results to EFM.
Try extending the EFM keyboard patch to add LFM using the button in Figure \@ref(fig:lfm-keyboard-frequency-tracking).
As you can see, the pitch shift occurs with LFM just like EFM, but the shift is less for the same LFO range.
(ref:lfm-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=efm-keyboard-frequency-tracking.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2flfm-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eDisconnect+the+LFO+for+now%3c%2fli%3e%0a%3cli%3eDuplicate+the+modulator+and+feidah+and+move+the+duplicates+to+the+right+of+the+EFM+modules+on+the+top+row%3c%2fli%3e%0a%3cli%3eAdd+evenVCO+to+the+right.+It+uses+a+linear+FM+input%3c%2fli%3e%0a%3cli%3eevenVCO+uses+octaves%2fsemitones+instead+of+frequency.+Set+Octave+to+.5+and+Tune+to+-4.6525+semitones+to+get+800+Hz%3c%2fli%3e%0a%3cli%3eWire+up+the+linear+FM+modules+just+like+the+EFM+modules%3c%2fli%3e%0a%3cli%3eIf+you+want%2c+use+the+Label+module+to+mark+off+the+EFM+and+LFM+sections+%28right+click+to+enter+text%29+%3c%2fli%3e%0a%3cli%3eAdd+an+8%3a1+switch+to+the+right+of+the+12+key+and+a+Triggers+MKIII+to+the+right+of+that%3c%2fli%3e%0a%3cli%3eRun+the+EFM+out+to+the+first+input+of+the+8%3a1+and+run+the+8%3a1+output+to+all+the+places+the+EFM+out+previously+went+%28scope%2c+sassy%2c+host+audio%29%3c%2fli%3e%0a%3cli%3eConnect+the+LFM+to+the+2nd+8%3a1+input%3c%2fli%3e%0a%3cli%3eSet+the+8%3a1+steps+to+2+and+connect+the+top+Triggers+out+to+the+8%3a1+clock+in%3c%2fli%3e%0a%3cli%3eYou+can+now+switch+between+EFM+and+LFM+by+pushing+a+button.+Make+sure+LFM+is+selected%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eAdjust+the+feidah+level+knob+and+note+the+change+in+timbre%3c%2fli%3e%0a%3cli%3eChoose+a+timbre+with+few+enough+sidebands+that+you+can+easily+count+them%2c+then+play+up+the+keyboard+and+note+if+the+number+changes+and+sounds+changes.+Now+change+the+keyboard+octave+up+by+2+and+play+across+the+keyboard+again.+Notice+how+the+timbre+remains+the+same%2c+as+expected%3c%2fli%3e%0a%3cli%3eTake+the+feidah+leve+back+down+to+zero%2c+set+the+12+key+octave+to+4%2c+and+press+the+leftmost+key+%28which+sends+0+volts%29%3c%2fli%3e%0a%3cli%3eSassy+should+show+a+peak+at+800+Hz%3c%2fli%3e%0a%3cli%3eIncrease+the+feidah+level+and+remember+you+should+NOT+see+any+partials+below+800+Hz+in+true+FM%2c+but+one+appears+around+.2%3c%2fli%3e%0a%3cli%3eAs+you+continue+to+move+the+knob%2c+that+rogue+harmonic+moves+up%2c+as+does+the+carrier%2c+and+more+rogue+harmonics+appear+%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eSet+feidah+level+to+full+on+and+connect+the+LFO+triangle+out+to+the+feidah+vca+in%3c%2fli%3e%0a%3cli%3eNotice+the+pitch+shift+and+change+in+harmonics+are+qualitatively+similar+to+EFM%2c+with+the+rogue+harmonics+appearing+below+the+carrier+frequency+and+all+partials+moving+up%3c%2fli%3e%0a%3cli%3eYou+can+use+the+push+button+to+switch+between+EFM+and+LFM.+Notice+that+the+pitch+shift+is+greater+for+EFM+over+the+same+LFO+range%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fevenvco-solo.png%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2flabel-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for linear frequency modulation with keyboard tracking and exploring a 1:1 ratio.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("lfm-keyboard-frequency-tracking", starter_file="efm-keyboard-frequency-tracking.vcv", instructions_html="<ul>
<li>Disconnect the LFO for now</li>
<li>Duplicate the modulator and feidah and move the duplicates to the right of the EFM modules on the top row</li>
<li>Add evenVCO to the right. It uses a linear FM input</li>
<li>evenVCO uses octaves/semitones instead of frequency. Set Octave to .5 and Tune to -4.6525 semitones to get 800 Hz</li>
<li>Wire up the linear FM modules just like the EFM modules</li>
<li>If you want, use the Label module to mark off the EFM and LFM sections (right click to enter text) </li>
<li>Add an 8:1 switch to the right of the 12 key and a Triggers MKIII to the right of that</li>
<li>Run the EFM out to the first input of the 8:1 and run the 8:1 output to all the places the EFM out previously went (scope, sassy, host audio)</li>
<li>Connect the LFM to the 2nd 8:1 input</li>
<li>Set the 8:1 steps to 2 and connect the top Triggers out to the 8:1 clock in</li>
<li>You can now switch between EFM and LFM by pushing a button. Make sure LFM is selected</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Adjust the feidah level knob and note the change in timbre</li>
<li>Choose a timbre with few enough sidebands that you can easily count them, then play up the keyboard and note if the number changes and sounds changes. Now change the keyboard octave up by 2 and play across the keyboard again. Notice how the timbre remains the same, as expected</li>
<li>Take the feidah leve back down to zero, set the 12 key octave to 4, and press the leftmost key (which sends 0 volts)</li>
<li>Sassy should show a peak at 800 Hz</li>
<li>Increase the feidah level and remember you should NOT see any partials below 800 Hz in true FM, but one appears around .2</li>
<li>As you continue to move the knob, that rogue harmonic moves up, as does the carrier, and more rogue harmonics appear </li>
</ul></li>
<li>Set feidah level to full on and connect the LFO triangle out to the feidah vca in</li>
<li>Notice the pitch shift and change in harmonics are qualitatively similar to EFM, with the rogue harmonics appearing below the carrier frequency and all partials moving up</li>
<li>You can use the push button to switch between EFM and LFM. Notice that the pitch shift is greater for EFM over the same LFO range</li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/evenvco-solo.png'>
<img class='rack-image' src='images/solo-modules/label-solo.png'>
</div>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/lfm-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r lfm-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:lfm-keyboard-frequency-tracking)"}
modular_caption()
```
### Analogue through-zero frequency modulation
Analogue through-zero frequency modulation (TZFM), is perhaps the easiest FM to understand if you understand true FM, because TZFM is true FM!
Like LFM, TZFM output moves in equal frequencies around the carrier's default value, but when the modulator drives the carrier's frequency below zero, TZFM oscillators will go through zero instead of stopping at zero like LFM.
Going "through zero" is implemented by flipping the waveform, and is perhaps most easily understood as [running the waveform backwards](http://electronotes.netfirms.com/EN206.pdf).
Again, this is true FM: normal symmetric sidebands, no pitch shifting, and perfect harmonic ratios.
Let's take a look at TZFM using a 1:1 ratio and comparing the results to EFM and LFM.
Try extending the LFM keyboard patch using the button in Figure \@ref(fig:tzfm-keyboard-frequency-tracking).
As you can see, there's no pitch shift and no rogue harmonics.
(ref:tzfm-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=lfm-keyboard-frequency-tracking.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftzfm-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eDisconnect+the+LFO+for+now%3c%2fli%3e%0a%3cli%3eDuplicate+the+modulator+and+feidah+and+move+the+duplicates+to+the+right+of+the+LFM+modules+on+the+top+row%3c%2fli%3e%0a%3cli%3eAdd+Bogg+Audio+VCO+%28the+carrier%29+to+the+right+and+set+its+frequency+to+800+Hz%3c%2fli%3e%0a%3cli%3eTurn+the+carrier+FM+knob+all+the+way+up+and+move+the+switch+to+LIN+%28this+is+TZFM+on+this+module%29%3c%2fli%3e%0a%3cli%3eWire+up+the+TZFM+modules+just+like+the+LFM+modules%3c%2fli%3e%0a%3cli%3eIf+you+want%2c+use+the+Label+module+to+mark+off+the+TZFM+section+%28right+click+to+enter+text%29+%3c%2fli%3e%0a%3cli%3eRun+the+carrier+out+to+the+3rd+input+of+the+8%3a1+and+set+the+8%3a1+steps+to+3+%3c%2fli%3e%0a%3cli%3eYou+can+now+switch+between+EFM%2c+LFM%2c+and+TZFM+by+pushing+a+button.+Make+sure+TZFM+is+selected%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eAdjust+the+feidah+level+knob+and+note+the+change+in+timbre%3c%2fli%3e%0a%3cli%3eChoose+a+timbre+with+few+enough+sidebands+that+you+can+easily+count+them%2c+then+play+up+the+keyboard+and+note+if+the+number+changes+and+sounds+changes.+Now+change+the+keyboard+octave+up+by+2+and+play+across+the+keyboard+again.+Notice+how+the+timbre+remains+the+same%2c+as+expected%3c%2fli%3e%0a%3cli%3eTake+the+feidah+leve+back+down+to+zero%2c+set+the+12+key+octave+to+4%2c+and+press+the+leftmost+key+%28which+sends+0+volts%29%3c%2fli%3e%0a%3cli%3eSassy+should+show+a+peak+at+800+Hz%3c%2fli%3e%0a%3cli%3eIncrease+the+feidah+level+-+you+will+not+see+any+partials+below+800+Hz+and+you+will+not+see+the+carrier+move+off+800+Hz%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eSet+feidah+level+to+.5+to+approximately+match+the+spectrum+of+EFM+and+LFM+on+and+connect+the+LFO+triangle+out+to+the+feidah+vca+in%3c%2fli%3e%0a%3cli%3eNotice+the+timbre+gets+brighter+and+the+pitch+center+is+a+little+unstable%2c+but+this+is+what+we+expect+from+FM+and+the+result+is+quite+different+from+EFM+and+LFM+%3c%2fli%3e%0a%3cli%3eYou+can+use+the+push+button+to+switch+between+all+three+FMs+to+further+compare%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fboggvco-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for through zero frequency modulation with keyboard tracking and exploring a 1:1 ratio.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tzfm-keyboard-frequency-tracking", starter_file="lfm-keyboard-frequency-tracking.vcv", instructions_html="<ul>
<li>Disconnect the LFO for now</li>
<li>Duplicate the modulator and feidah and move the duplicates to the right of the LFM modules on the top row</li>
<li>Add Bogg Audio VCO (the carrier) to the right and set its frequency to 800 Hz</li>
<li>Turn the carrier FM knob all the way up and move the switch to LIN (this is TZFM on this module)</li>
<li>Wire up the TZFM modules just like the LFM modules</li>
<li>If you want, use the Label module to mark off the TZFM section (right click to enter text) </li>
<li>Run the carrier out to the 3rd input of the 8:1 and set the 8:1 steps to 3 </li>
<li>You can now switch between EFM, LFM, and TZFM by pushing a button. Make sure TZFM is selected</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Adjust the feidah level knob and note the change in timbre</li>
<li>Choose a timbre with few enough sidebands that you can easily count them, then play up the keyboard and note if the number changes and sounds changes. Now change the keyboard octave up by 2 and play across the keyboard again. Notice how the timbre remains the same, as expected</li>
<li>Take the feidah leve back down to zero, set the 12 key octave to 4, and press the leftmost key (which sends 0 volts)</li>
<li>Sassy should show a peak at 800 Hz</li>
<li>Increase the feidah level - you will not see any partials below 800 Hz and you will not see the carrier move off 800 Hz</li>
</ul></li>
<li>Set feidah level to .5 to approximately match the spectrum of EFM and LFM on and connect the LFO triangle out to the feidah vca in</li>
<li>Notice the timbre gets brighter and the pitch center is a little unstable, but this is what we expect from FM and the result is quite different from EFM and LFM </li>
<li>You can use the push button to switch between all three FMs to further compare</li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/boggvco-solo.png'>
</div>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tzfm-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r tzfm-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:tzfm-keyboard-frequency-tracking)"}
modular_caption()
```
<!-- **template** -->
<!-- - How are sideband frequency and amplitude calculated -->
<!-- - How does modulation index affect these -->
<!-- - What happens to partials that cross zero? -->
<!-- - How is result perceived -->
<!-- - How can we make it harmonic -->
<!-- - Ratios C:M -->
<!-- - Will harmonics track keyboard or not -->
### Phase modulation
Phase modulation (PM) is very similar to frequency modulation - in fact Chowning's FM used in the DX7 was PM, not FM!
Recall that phase and frequency are very closely related.
Figure \@ref(fig:wheel-sine-2) shows how the angle on the wheel from 0 to 2$pi$ corresponds to one wavelength of a sine wave.
We can view frequency like speed: the change in angle over time.
Since both frequency and phase can be described in terms of angle, both FM and PM are types of [angle modulation](https://en.wikipedia.org/wiki/Angle_modulation).
(ref:wheel-sine-2) [Relation](https://upload.wikimedia.org/wikipedia/commons/0/08/Sine_curve_drawing_animation.gif) between angle (in radians) and the wavelength of a sine wave. Image [© Brews ohare/CC-BY-4.0](https://commons.wikimedia.org/wiki/File:Sine_curve_drawing_animation.gif).
```{r wheel-sine-2, echo=F, out.width="80%", fig.cap="(ref:wheel-sine-2)"}
embed_linked_media("images/wheel-sine.gif")
```
We can think of PM similarly to TZFM.
When the modulator is positive, it adds phase to the carrier (moves forward in time along the carrier), and when the modulator changes direction, it subtracts phase from the carrier (moves backward in time along the carrier).
This makes PM "through zero" and so operate with symmetric sidebands and proper harmonic ratios.
There are two main differences between PM and true FM.
First, the modulation index for PM is simply $\Delta \theta$, where $\theta$ is the peak phase deviation.
This differs from true FM, where the modulation index also depends on $M_f$, the highest frequency component of the modulator.
The other difference with PM is that, relative to FM, it has [different scaling factors and phase offsets](https://moinsound.wordpress.com/2011/03/04/frequency-modulation-or-phase-modulation-synthesizer-technologies/).
These differences don't seem to matter for sine wave modulators, but for other signals, the differences get more interesting.
For example, [FM using a square wave gives the same result as PM on a triangle wave](https://ccrma.stanford.edu/software/snd/snd/fm.html).
So it isn't correct to say that PM and FM are identical, though they are very similar.
To round off this chapter, try adding PM to the TZFM keyboard patch using the button in Figure \@ref(fig:pm-keyboard-frequency-tracking).
As with TZFM, there's no pitch shift and no rogue harmonics using a 1:1 ratio, just a slightly different sensitivity of the modulation index to the attenuverter/polarizer.
The timbre is identical to TZFM for an equivalent modulation index.
(ref:pm-keyboard-frequency-tracking) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tzfm-keyboard-frequency-tracking.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2fpm-keyboard-frequency-tracking.png%27%3e&instructions=%3cul%3e%0a%3cli%3eDisconnect+the+LFO+for+now%3c%2fli%3e%0a%3cli%3eDuplicate+the+modulator+and+feidah+and+move+the+duplicates+to+the+right+of+the+TZFM+modules+on+the+top+row%3c%2fli%3e%0a%3cli%3eAdd+Bogg+Audio+Sine+%28the+carrier%29+to+the+right+and+set+its+frequency+to+800+Hz%3c%2fli%3e%0a%3cli%3eTurn+the+carrier+Phase+knob+all+the+way+to+the+left+%28this+better+matches+the+shape+of+TZFM+for+comparison%2c+but+you+could+move+it+all+the+way+to+the+right+as+well%29%3c%2fli%3e%0a%3cli%3eWire+up+the+PM+modules+just+like+the+TZFM+modules%2c+except+use+the+Phase+input+instead+of+FM%3c%2fli%3e%0a%3cli%3eIf+you+want%2c+use+the+Label+module+to+mark+off+the+PM+section+%28right+click+to+enter+text%29+%3c%2fli%3e%0a%3cli%3eRun+the+carrier+out+to+the+4th+input+of+the+8%3a1+and+set+the+8%3a1+steps+to+4+%3c%2fli%3e%0a%3cli%3eYou+can+now+switch+between+EFM%2c+LFM%2c+TZFM%2c+and+PM+by+pushing+a+button.+Make+sure+PM+is+selected%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scopes+%3cul%3e%0a%3cli%3eAdjust+the+feidah+level+knob+and+note+the+change+in+timbre%3c%2fli%3e%0a%3cli%3eChoose+a+timbre+with+few+enough+sidebands+that+you+can+easily+count+them%2c+then+play+up+the+keyboard+and+note+if+the+number+changes+and+sounds+changes.+Now+change+the+keyboard+octave+up+by+2+and+play+across+the+keyboard+again.+Notice+how+the+timbre+remains+the+same%2c+as+expected%3c%2fli%3e%0a%3cli%3eTake+the+feidah+leve+back+down+to+zero%2c+set+the+12+key+octave+to+4%2c+and+press+the+leftmost+key+%28which+sends+0+volts%29%3c%2fli%3e%0a%3cli%3eSassy+should+show+a+peak+at+800+Hz%3c%2fli%3e%0a%3cli%3eIncrease+the+feidah+level+-+you+will+not+see+any+partials+below+800+Hz+and+you+will+not+see+the+carrier+move+off+800+Hz%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eSet+feidah+level+to+1+to+approximately+match+the+spectrum+of+TZFM.+You+may+need+to+turn+the+TZFM+down+to+around+.3+to+have+a+comparable+modulation%3c%2fli%3e%0a%3cli%3eConnect+the+LFO+triangle+out+to+the+feidah+vca+in%3c%2fli%3e%0a%3cli%3eNotice+the+timbre+gets+brighter+and+the+pitch+center+is+a+little+unstable%2c+but+this+is+what+we+expect+from+FM+and+the+result+is+quite+different+from+EFM+and+LFM%3c%2fli%3e%0a%3cli%3eYou+can+use+the+push+button+to+switch+between+all+three+FMs+to+further+compare.+Note+in+particular+the+comparison+to+TZFM.+If+you+set+PM+to+1+and+TZFM+to+.3+and+remove+the+VCO%2c+they+look+identical+on+my+scope+except+for+some+phase+shift%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fboggsine-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for phase modulation with keyboard tracking and exploring a 1:1 ratio.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("pm-keyboard-frequency-tracking", starter_file="tzfm-keyboard-frequency-tracking.vcv", instructions_html="<ul>
<li>Disconnect the LFO for now</li>
<li>Duplicate the modulator and feidah and move the duplicates to the right of the TZFM modules on the top row</li>
<li>Add Bogg Audio Sine (the carrier) to the right and set its frequency to 800 Hz</li>
<li>Turn the carrier Phase knob all the way to the left (this better matches the shape of TZFM for comparison, but you could move it all the way to the right as well)</li>
<li>Wire up the PM modules just like the TZFM modules, except use the Phase input instead of FM</li>
<li>If you want, use the Label module to mark off the PM section (right click to enter text) </li>
<li>Run the carrier out to the 4th input of the 8:1 and set the 8:1 steps to 4 </li>
<li>You can now switch between EFM, LFM, TZFM, and PM by pushing a button. Make sure PM is selected</li>
<li>Try the following and note the differences in the sound and scopes <ul>
<li>Adjust the feidah level knob and note the change in timbre</li>
<li>Choose a timbre with few enough sidebands that you can easily count them, then play up the keyboard and note if the number changes and sounds changes. Now change the keyboard octave up by 2 and play across the keyboard again. Notice how the timbre remains the same, as expected</li>
<li>Take the feidah leve back down to zero, set the 12 key octave to 4, and press the leftmost key (which sends 0 volts)</li>
<li>Sassy should show a peak at 800 Hz</li>
<li>Increase the feidah level - you will not see any partials below 800 Hz and you will not see the carrier move off 800 Hz</li>
</ul></li>
<li>Set feidah level to 1 to approximately match the spectrum of TZFM. You may need to turn the TZFM down to around .3 to have a comparable modulation</li>
<li>Connect the LFO triangle out to the feidah vca in</li>
<li>Notice the timbre gets brighter and the pitch center is a little unstable, but this is what we expect from FM and the result is quite different from EFM and LFM</li>
<li>You can use the push button to switch between all three FMs to further compare. Note in particular the comparison to TZFM. If you set PM to 1 and TZFM to .3 and remove the VCO, they look identical on my scope except for some phase shift</li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/boggsine-solo.png'>
</div>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/pm-keyboard-frequency-tracking.png'>")
```
<!-- CAPTION BLOCK -->
```{r pm-keyboard-frequency-tracking, echo=F, out.width="100%", fig.cap="(ref:pm-keyboard-frequency-tracking)"}
modular_caption()
```
Table \@ref(tab:frequency-summary) summarizes the important properties of the frequency modulation methods discussed in this section
If one wants a method that behaves like true FM, TZFM and PM are good choices.
However, if one wants the character of EFM or LFM, that can't be denied.
Table: (\#tab:frequency-summary) Behaviors of frequency modulation methods discussed in this section. Linear FM items are marked with an asterisk when they are true for practical purposes but not always true.
| Behavior | EFM | LFM | TZFM | PM |
|---------------------|----------------|------------|-----------------|------------------|
| Symmetric sidebands | no | no* | yes | yes |
| C:M ratios | broken | broken | perfect | perfect |
| Pitch shift | yes | yes* | no | no |
## Check your understanding
1. `r mc_question("When a signal's amplitude is modulated, the result is:", list( answer="amplitude modulation",
"frequency modulation",
"phase modulation"))`
2. `r mc_question("When a signal's phase is modulated, the result is:", list( "amplitude modulation",
"frequency modulation",
"frequency hopping",
answer="phase modulation"))`
3. `r mc_question("What type of frequency modulation moves the output signal an equal musical interval around the carrier's default value?", list( "PM",
"linear FM",
"through-zero linear FM",
answer="exponential FM"))`
4. `r mc_question("What causes pitch shift in frequency modulation?", list( "digital modulation",
"analogue modulation",
"symmetric modulation",
answer="asymmetric modulation"))`
5. `r mc_question("Which of the following does not behave like true FM?", list( "through-zero FM",
"PM",
answer="linear FM"))`
<!-- **template** -->
<!-- - How are sideband frequency and amplitude calculated -->
<!-- - How does modulation index affect these -->
<!-- - What happens to partials that cross zero? -->
<!-- - How is result perceived -->
<!-- - How can we make it harmonic -->
<!-- - Ratios C:M -->
<!-- - Will harmonics track keyboard or not -->