Each cycle~ starts at 800 Hz and ramps to a note in the harmonic spectrum with a fundamental frequency of 100 Hz over 45 seconds after a delay of 5 seconds. The curve~ controls the amplitude of all of the cycle~ objects.
This example shows how you can generate a pulse burst of a certain number of repeated rectangle waves. It allows you to choose how many pulses you want to produce, the rate at which you want them to occur, and the width of the pulse relative to the pulse rate, also known as the duty cycle. The patch uses a phasor~ (with its rate specified by the user) and a <~ object (with its threshold specified by the duty cycle) to generate pulse that goes briefly to 1 then back to 0.
This patch shows different ways to receive and generate numerical values using MaxMSP.
This examples shows a way to choose automatically from a list of preestablished sound cues, with a crossfade between cues rather than a sudden switch.
To do this we have two stereo sfplay~ objects, both of which refer to the same list of sound cues in an sflist~ object, named "cuelist". Instead of sending open and preload messages to each sfplay~ object, you can send those same messages to a single sflist~, and then the sfplay~ objects refer to that object by its name.
This patch demonstrates a method for playing a stream of sound grains randomly chosen from a sound file.
To play short grains of sound, especially ones randomly chosen from a sound file, it's usually necessary to impose some sort of "window"—an amplitude envelope—to taper the ends of the grain in order to avoid clicks. This patch shows how to generate four types of window function, and read through them with a phasor.
A linear fade-in or fade-out of audio is okay for quick changes that take place in a fraction of a second, but for slower fades one should generally take into account that our subjective sense of loudness more closely conforms to an exponential change in amplitude. This patch allows you to use the slider (or the mod wheel from a MIDI controller) to control the amplitude of white noise in one of three different ways: with straight linear mapping, exponentially (with an exponent of 4), or using a range of 60 decibels.
The adsr~ object provides a signal in the shape of an ADSR envelope (attack, decay, sustain, release) commonly used in synthesizer design. You specify an attack time in ms (time to get from 0 amplitude to peak amplitude), a decay time in ms (time to settle to the sustain level), a sustain level (an amplitude factor, not a ms time), and a release time in ms (time to return to 0). Those values can all be supplied as initializing arguments, and/or as floats or signals in the second, third, fourth, and fifth inlets.
The tapin~ and tapout~ objects work together to delay sound. The tapin~ creates a place in memory for storing a circular buffer of the most recently received signal. Its argument specifies how many milliseconds of audio it should store. Any connected tapout~ object accesses that memory to get the recent past of an audio signal.
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.