cycle~

Tendency Masks

This example shows how to use the function object for making tendency masks with breakpoint line segment functions (à la Koenig and as explained by Rowe) using a line object to progress through the functions that describe the minimum and maximum of the function’s range.

1/4 of a sine wave as a control shape

The cycle~ object uses a lookup table of 512 values that make the shape of a single cycle of a cosine wave, and it reads through those repeatedly at whatever rate is specified in its left (frequency) inlet. You can also set the cycle~ to 0 Hz (its default frequency) and select a point in the cosine waveform with a value (either a signal or a float) from 0 to 1 in the right (phase offset) inlet.

Use stored waveform for a synthesizer

This patch demonstrates the technique of wavetable synthesis: using one cycle of a stored waveform as the wave type for a synthesizer tone. The cycle~ object with no argument produces a cosine wave; however, cycle~ can also refer to a waveform stored in a buffer~, and use that as a wavetable. To do that, you need to create a buffer~, store a waveform in it, and then refer to that buffer~ by creating a cycle~ with the same name.

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

Route signal for audio and control data

The way audio Max compiles audio signal networks is, whenever audio is turned on, MSP outlets send out the message ‘signal’. (In other words, that’s how Max knows how MSP objects are connected to each other, and thus knows how to calculate the audio signal network.) The [route signal] object detects the selector ‘signal’ and sends a ‘bang’ out its left outlet in response. The [t signal] object converts that ‘bang’ back into the message ‘signal’.