*~

Irrationally out-of-sync phasors

Two oscillators with a ratio of frequencies that's an irrational number will never have exactly the same phase relationship. So, phasor~ objects that have an irrational frequency relationship, when combined, will create a rhythm that never exactly repeats. In this example, you can hear that the sum of the two phasor~ objects with a constantly changing relationship will create a constantly changing rhythm.

Amplitude modulation of sinusoidal tones

Amplitude modulation is the use of one oscillator—usually but not obligatorily at a sub-audio frequency—to modify the amplitude of a sound. (Ring modulation, shown in Multiplication of Sine Tones, is one particular example of amplitude modulation.) The modulating oscillator is added to a main amplitude value to create an amplitude that fluctuates up and down from the central value. The result, at low modulation frequencies, is called "tremolo".

Addition of sinusoidal tones

To play two tones, you need two oscillators: two cycle~ objects). To mix them together, simply add the two signals with a +~ object. (For digital signals, addition is mixing.) To control the amplitude, multiply it by some factor, using a *~ object. (Multiplication is amplification.)

Click resulting from amplitude change

The amplitude of a sound is controlled by multiplying the sound wave by a certain factor. A multiplier of 1 represents "unity gain", meaning no change. Multiplying by a factor between 0 and 1 reduces the amplitude of the sound. However, if the multiplier is changed very suddenly and significantly, it may create a sudden discontinuity in the waveform which will be heard as a high-frequency click. 

Alter the speed of an audio file

This example demonstrates how to modulate the playback speed of an audio file. The value in the right inlet of sfplay~ determines the playback rate; 1. is normal speed, 0.5 is half speed, 2.0 is double speed, and so on. The rate can be provided as a continuously changing control signal instead of as a single constant value, allowing us to warp the speed at will. Here we're using a cycle~ object to produce a low-frequency sinusoid over the course of ten seconds (i.e. at the frequency of 0.1 Hz).