This patch shows how to modulate a sound file in realtime using cycle~.
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.
In the groove~ object, you specify the rate of playback of a buffer~ by means of a signal in the left inlet of groove~. Normal playback speed is achieved with a signal value of 1. As shown also in the example "Play a sound file with vibrato", you can create a vibrato by modulating that signal with a low-frequency oscillator.
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.
In electronic music parlance, the word "modulation" means change, specifically the continuous or cyclical change caused by using one signal to control another. The controlling signal, known as the modulator, is used to control some property of the sound signal we're listening to, called the carrier.
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.