Buffer techniques
This patch demonstrates a few different ways of reading audio from buffer~.
This patch demonstrates a few different ways of reading audio from buffer~.
This patch demonstrates a method of storing and recalling sound in RAM using the buffer~ object and the various objects that can access a buffer.
This patch demonstrates a method of storing and recalling sound in RAM using the buffer~ object and the various objects that can access a buffer.
This patch records while the spacebar is held down, and starts looping when the spacebar is released.
This example shows how to play part of a sample in Max. Simply put, to play a sound from point A to point B, nothing beats play~, you just tell it "start ". However, if you must use groove~, then you need to provide a stopping command at the right moment somehow.
To set a list of cue points in an audio file and have them played in order, use either sfplay~ (with a set of cues established by preload messages to sfplay~ or to sflist~) or buffer~ (with start messages to play~, the parameters of which are stored in a coll).
To record the output of a line~ as a series of numbers, a buffer~ can be used to capture the entirety of its output. To record the output, connect the line~ to a record~ with the same name as the buffer~. The buffer can then be played back by creating a play~ object with the same name as the buffer~ and sending it a start message.
This example is essentially the same as "Basic RAM recording into buffer~", except that it's designed for recording and playing back a stereo signal instead of a single channel of audio. The buffer~ object has an additional argument to specify 2 channels of storage.
To record a sound into RAM, you must first allocate/designate a place in RAM into which to record. The buffer~ object creates a named buffer in memory large enough to store the specified duration of audio data. In this example, the buffer is named "theholdingplace" and holds up to 60,000 milliseconds (one minute) of audio. The incoming audio signal from the adc~ object goes into a record~ object that refers to that memory buffer.