modulation

Frequency modulation

Frequency modulation refers to using the output of a low-frequency oscillator to continually alter (modulate) the frequency of another oscillator. This example provides the user control of the amplitude and frequency of both the "carrier" oscillator (the one we hear directly) and the "modulator" oscillator (the effect of which we hear indirectly). The output of the modulating oscillator is added to a constant (the main frequency), thus causing the carrier frequency to fluctuate up and down around that central frequency.

Play a sound file with vibrato

To impose a vibrato (a periodic fluctuation of frequency) on the playback of a sound file, you can use a low-frequency oscillator (a cycle~ object) to modulate the playback speed of the file. The right inlet of the sfplay~ object controls the playback speed with a rate factor. A value of 1 is normal speed (the default), 2.0 is double speed, 0.5 is half speed, etc. The speed can be supplied as a constant number (float) or with a continuous signal.

Random pitch variation of an oscillator

If you want to make an oscillator with unstable pitch, you can modulate the pitch of the oscillator using a noise signal as an exponent with a base of 2, and applying that as a multiplier to vary the fundamental frequency. In that way, when the noise ranges from -1 to +1, it will cause a pitch variation of ±1 octave, whatever the fundamental frequency of the oscillator. Divide the amplitude of the noise by 1200 if you want to be able to represent pitch variation in cents.