# MSP

## Phasor lookup in cosine

One common usage of the phasor~ object is to readrepeatedly through a stored table of numbers. In that way, instead of just producing a simple linear ramp shape, phasor~ can actually be used to produce any shape. In this example, we're using it to read repeatedly through one half of a sinusoid, so that we repeatedly get just the positive half of a sine wave.

## Phasor as control signal

The phasor~ object is an oscillator that makes a "sawtooth" waveform, repeatedly ramping from 0 to 1. (Technically, it goes from 0 to almost 1, because whenever it would arrive at exactly 1, it wraps around and begins again from 0.) You can listen to this sawtooth waveform, but phasor~ is perhaps even more useful as a control signal, to provide a repeated linearly-changing value in your program.

## Multiplication of sinusoidal tones

Multiplying one tone by another, in effect, imposes the contour of one waveform on that of the other waveform. For example, mutiplying a 1000 Hz sinusoidal tone by a 3 Hz sinusoidal tone yields something very much like a 1000 Hz sine tone, but with its amplitude continually shaped by the low-frequency oscillator (LFO). Because the LFO goes from 0 to 1 to 0 to -1 to 0 each cycle, the amplitude of the 1000 Hz tone goes from 0 up to 1 and back down to 0, then to -1 and back to 0 for each cycle of the LFO.

## Many Unrelated LFOs

By combining numerous low-frequency oscillators with unrelated repetition rates, you can create irregular shapes of modulation and patterns that never exactly repeat, creating a sound that changes in ways that seem constantly varying in somewhat unpredictable ways.

## Table and coll objects

This patch demonstrates use of the table and coll objects to read through a data set to automate musical parameters.

## 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.

## Modulated sound

This patch shows how to modulate a sound file in realtime using cycle~.

## Hanning function to control parameters of a sound

If you scale a one cycle of cosine wave by a factor of -0.5 and offset it by 0.5 you get a "Hanning function", which goes from 0 to 1 and back to 0 as smoothly as possible. That can be used to shape the amplitude of a sound, turning it on and off smoothly, or it can be used to modulate any characteristic of the sound.

## Frequency modulation of sinusoidal tones

Frequency modulation is the use of one oscillator—usually but not obligatorily at a sub-audio frequency—to modify the frequency of a sound. The modulating oscillator is added to a main frequency value to create a frequency that fluctuates up and down from the central value. The result, at low modulation rates, is called "vibrato".