Max Tutorial #6: Modulating Oscillators with LFOs

In this tutorial, we’ll begin to apply some modulating techniques using a low-frequency oscillator or LFO. In Max, there is no distinction between regular oscillators and low-frequency oscillators. We use the same objects for both, and adjust the frequency range accordingly. In a voltage-controlled synthesizer, the voltage values output from an oscillator can be sent directly to the input of other modules in order to perform modulation. In digital systems like Max, however, objects don’t interpret the “voltage” or signal correctly unless we specify the range of values explicitly.

We can set the range of values for modulation by using the [scale~] object. The [scale~] object takes arguments for an input range and an output range and—you guessed it—scales them accordingly. We’ll start with a sawtooth oscillator as our sound source and a sine wave oscillator as our LFO. The change in amplitude of the sine wave, which goes smoothly up and down, will modulate the frequency of the sawtooth oscillator. Between [cycle~] and [saw~], we add the [scale~] object to convert from the signal output range of [cycle~], which goes from -1 to 1, to a range of frequencies. In this case, we’ll simulate a wide vibrato-like effect by choosing a range from 400 to 440 Hz. This is called frequency modulation.

We can also use an LFO to modulate the amplitude, or volume, of the signal. At relatively slow speeds, this sounds like a tremolo effect. To make the effect more obvious, we’ll eliminate the frequency modulation and assign [saw~] a fixed frequency. Then we’ll move our [cycle~] and [scale~] objects over and connect them to the multiplication object [*~], which we’ve used in the past to control volume similar to a voltage-controlled amplifier, or VCA. We’ll also adjust the output range in the [scale~] object to 0 to 1, reflecting the way Max designates loudness. Just as before, the frequency of the modulating oscillator, [cycle~], determines how fast the effect is.

The last section of this tutorial demonstrates how to modulate modulators. In other words, instead of a tremolo or vibrato effect with a constant speed, another level of modulation allows us to vary the speed of the effect over time. The architecture is simple: we replace the constant that previously determined the speed (the floating-point number box) with another [cycle~] and [scale~] pair, and adjust the output ranges accordingly.

In the first example, which expands the amplitude modulation technique, the tremolo effect will vary between 3 and 12 pulses per second. The amount of time between these extremes is determined by the number box at the top. The value given, 0.1 Hz, is too low to be heard as an audible frequency (hence “low-frequency” oscillator), but is slow enough that we can hear the change in the tremolo speed clearly. (0.1 Hz means that the oscillator completes one tenth of one one cycle or “period” every second, and therefore a complete cycle between the two extremes once every ten seconds.)

We can plug in the same structure for frequency modulation, again adjusting the output of the [scale~] object as necessary. Once again, 0 to 1 is a good range for amplitude, but not frequency, so we’ll switch back to the frequency range we used before: 400 to 440 Hz. Remember to connect the output of the last [scale~] object into the frequency inlet of [saw~]. Once we’ve made these adjustments, because the floating-point number box at the top is still set to 0.1 Hz, we can hear that every ten seconds the vibrato goes from its fastest speed (12 pulses per second) to its slowest speed (3 pulses per second).