Max MSP and FM Synthesis
Max MSP and FM Synthesis
The heart of the technique is the way extra tones (sidebands) are created when one
oscillator is used to modulate the frequency of another. These sidebands are
symmetrically spaced about the frequency of the carrier, and the size of the spaces is
equal to the frequency of the modulator. I is the index of modulation which is the ratio of
the deviation of the carrier to the frequency of the modulator. (In other words, if you have
a modulation frequency of 100 hz, and the amplitude of the modulator is enough to add
50 Hz to the carrier, the Modulation Index is 0.5. ) Increasing modulation increases the
number of sidebands, but the amplitude of the sidebands varies in a rather complex way
as the modulation changes.
1
Chowning, John M. "The Synthesis of Complex Audio Spectra by Means of Frequency
Modulation."
Journal of the audio engineering society, vol.21 (1973), pp. 526,534. Reprinted in
Roads, Curtis and John Strawn eds. FOUNDATIONS OF COMPUTER MUSIC. Cambridge MA,
MIT press, [Available in Mc Henry]
Peter Elsea 10/11/07 1
Frequency Modulation in Max
the component below the bar. (Most drawings show the absolute value of each
component.) The general shape of the amplitudes follows a family of curves known as
Bessel curves.
Do it in Max
Here's a Max patch to explore FM. It's built to be triggered by the receive objects: freq to
set the frequency, nON to turn the sound on and nOFF to turn the sound off. The
modulation index is set with a number box. The frequency of the modulator is set as a
ratio to the note frequency. This gives a consistent sound as the pitch is changed.
Figure 3 shows spectra generated by this patch. In all of the examples, the ratio was set to 1, so
there's a simple harmonic relationship of the carrier and any sideband frequencies that appear.
There are components at 880, 1760, 2640, 3520 and 4400 Hz, with a hint of 8800. There's also a
barely visible component at 0.
If the modulator and carrier are the same frequency like this, all of the sidebands will be
harmonics of that frequency, and the sound will be strongly pitched. You may wonder what
happens to the sidebands at frequencies lower than the carrier. If the spacing of the sidebands is
the same as the carrier frequency (as it will be if modulator equals carrier), the sideband just
below the carrier will be zero in frequency. The sideband below that will be the carrier
frequency, but negative. When that concept is applied in reality, the result is the carrier
frequency, but 180° out of phase. That sideband therefore weakens or strengthens the
fundamental, depending on the modulation index. Further low sidebands interact with upper
sidebands in the same way. The regularity of the sidebands produces the strongly harmonic
sound usually associated with synthesizers, but if the modulation index is changed during the
note (dynamic modulation) the intensity of the sidebands will change in some very voice-like
effects.
Figure 4 shows spectra where the carrier and modulator are different frequencies.
If the frequencies of the carrier and modulator are different but rationally related, the
result will again be strongly harmonic, and the pitch will be the root of the implied series.
(For instance, frequencies of 400hz and 500hz imply a root of 100hz. This could be
produced by a modulator ratio of 2.25 applied to a carrier of 400 hz.) If the carrier is the
higher frequency2, the resultant sound will be quite bright, sounding like a high pass
effect at low modulation and becoming very brash as the modulation increases. The
frequency of the carrier is always prominent. If the carrier is the lower frequency, the
sound will have "missing" harmonics, and those that are present will appear in pairs. At
low modulation index, you will hear two distinct pitches in the tone; as the index is
increased, the timbre of the upper pitch seems to become brighter.
2
Produced by a ratio of < 1.0
Peter Elsea 10/11/07 4
Frequency Modulation in Max
If the frequencies of the carrier and modulator are not rationally related, the tone will
have a less definite pitch, and will have a rich sound. Very often the effect is of two
tones, a weak pure tone at the carrier frequency, plus a rough sound with a vague pitch.
With careful adjustment of the modulation index, the carrier tone can be nearly
eliminated. Many of these sounds are bell like.
If the frequencies of the carrier and modulator are close to harmonic, timbral beating
will occur. This is illustrated in figures 5a and 5b. In this example the carrier frequency is
523 Hz. The modulator is 1.999 times this, or 1045 hz. The first lower sideband (reflected
through zero) falls at 522 hz. The resulting sound will change from the spectrum of 3e to
that of 3f once a second. This gives a warm vibrato.
Very rich spectra can be produced by using complex waveforms for the modulator
instead of sine waves. If you choose tri~, rect~ or saw~ for the modulator waveform, you
can get results as shown in figure 6 and 7. Note that with saw~ and rect~ (with a duty
cycle other than 0.5) there will be some pitch shift as the modulation is applied.
You can also get complex modulation waveforms by modulating the modulators, which
I'll demonstrate below.
Envelopes
The FM patch shown above applies a simple envelope to the modulation as well as the
amplitude of the note, and can hear a change in the sound as the note fades- that's due to a
reduction in the modulation index. Figure 8 shows sonograms of the sound with different
decay rates. You can see the upper components fade as the modulation envelope closes.
Practical FM patchers
Figure 10. shows a playable FM mono instrument developed from figure 1. I have
simplified the look with some encapsulation, which made it straightforward to add a
second modulator.
Carrier Modulator
Figure 11. Subpatches of Fig 10.
The carrier is very simple, just including the adder for a second frequency input and a
multiply for amplitude control. The modulator also has the math for ratio and deviation.
In the DX7, these modules were called operators. They could be combined in many ways
for complex effects.
In figure 13, the patch has been modified to work inside a poly. This conversion is
usually pretty straightforward. Convert notein to unpack, add an inlet for the note info (as
a list of pitch, velocity) and an outlet for the signal. Thispoly~ and some receive objects
for the parameters complete the instrument. The master patch is then quite simple, as in
figure 14.
John Chowning and David Bristow (who programmed the presets for the DX7) wrote a
book called FM Theory and Applications. It's out of print, but if you have a DX
instrument, it worth finding a used copy