This simple program allows you to listen to a sinusoidal tone with any desired frequency and amplitude. Initially both frequency and amplitude are set to 0, so you'll need to set the frequency to some number in the audible range, and you'll need to increase the amplitude to some value greater than 0 but not greater than 1. The speaker icon (ezdac~ object) is an on/off button for audio, and sends the output signal to the DAC.
This example plays the first sixteen harmonics based on a fundamental frequency where the rate at which each harmonic play is period / # of harmonic. For example, with a period of 10000 ms—meaning the fundamental plays every 10000 ms—the 4th harmonic will be heard every 10000/4 ms, or 2500 ms.
Thie example demonstrates a simple setup for playing a sound file using sfplay~.
The example demonstrates a simple way to play an audio file.
This example demonstrates how to play an audio file.
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’.
To sync an LFO to the onset of a note, drive it with a phasor~ object. Send a phase value of "0" into the right inlet of phasor~ when the note starts, as seen in this example.
The way we commonly avoid clicks when changing the amplitude of a sound is to interpolate smoothly sample-by-sample from one gain factor to another, using an object such as line~. Does that same technique work well for making a smooth change from one delay time to another? As it turns out, that's not the best way to get a seamless unnoticeable change from one delay time to another, because changing the delay time gradually will actually cause a pitch shift in the sound.
An exponential amplitude fade is usually more subjectively natural-sounding than a linear amplitude fade. This patch allows you to compare the two.
Similarly to the sample and hold object sah~, the snapshot~ object can be used to capture the amplitude of a signal at a specific instant.