data Reference

A data buffer for holding audio (or potentially some other) data.

data

Examples

Arguments

name [symbol]

The first argument of buffer is required and is the name that other objects use to access the stored buffer data. Buffers with the same name in a rnbo~ object and a parent Max patcher can share data in either direction.

samples [number]

Optional

Set the size of the buffer in samples.The actual duration of the buffer is determined by the number of samples and the sample rate. (cr) It is important to note that large buffers can take time to allocate and may interrupt audio processing, so it is best not to use arbitrarily large buffers.

size [number]

Optional

Set the size of the buffer in samples.The actual duration of the buffer is determined by the number of samples and the sample rate. (cr) It is important to note that large buffers can take time to allocate and may interrupt audio processing, so it is best not to use arbitrarily large buffers.

channels [number]

Optional

Set the number of channels for the data buffer. Requires that the size be set. If buffer is referencing an external source using the file attribute, the number of channels is automatically determined by the source file."

samplerate [number]

Optional

Sets the sample rate for the buffer object (default = 44100). This can be set independently from the sample rate of the audio driver and other buffer objects.

Inlets

info [bang]

Sending a bang into the buffer objects inlet will output the buffer data to the corresponding outlets. The reported data is the size of the buffer in samples, the number of channels, and the sample rate of the currently loaded buffer.

Outlets

sizeout [number]

The left outlet reports the total size of the buffer in samples whenever the buffer is instantiated, modified, or receives a bang. The actual duration of the buffer is determined by the number of samples and the sample rate.

chanout [number]

The middle outlet reports the current number of channels of the buffer whenever the buffer is instantiated, modified, or receives a bang *. _Needs a way to jump to the bang entry of the ref doc.

srout [number]

The right outlet reports the sample size of the buffer whenever the buffer is instantiated, modified, or receives a bang.

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

external [bool]

A buffer set to external (default = 0 for data, default = 1 for buffer and buffer~) must be filled from outside the rnbo code. Buffers that have a specified file are always set to external. Buffers that have a specified size are always set to internal.

file [symbol]

File name/path or URL to load into buffer.

fill [symbol]

Allows you to fill a buffer using a constant or a simple function of x, where x is a value ranging from 0 to 1 over the length of the buffer. i.e., @fill .5 will set all values to .5; @fill sin(x*2*pi-1) creates a sin wave that goes between -1 and 1. Requires a fixed size *.

  • Requires some way to jump to specified attribute in the doc.

name [symbol]

The first argument of buffer is required and is the name that other objects use to access the stored buffer data. Buffers with the same name in a rnbo~ object and a parent Max patcher can share data in either direction.

samplerate [number] (default: 0)

Sets the sample rate for the buffer object (default = 44100). This can be set independently from the sample rate of the audio driver and other buffer objects.

type [symbol]

Sets the data type of the buffer to Float32 or Float64 (default).

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

channels [number] (default: 1)

Set the number of channels for the data buffer. Requires that the size be set. If buffer is referencing an external source using the file attribute, the number of channels is automatically determined by the source file."

clear [bang]

Clear the contents of the buffer

info [bang]

Sending a bang into the buffer objects inlet will output the buffer data to the corresponding outlets. The reported data is the size of the buffer in samples, the number of channels, and the sample rate of the currently loaded buffer.

size [number] (default: 0)

Set the size of the buffer in samples.The actual duration of the buffer is determined by the number of samples and the sample rate. (cr) It is important to note that large buffers can take time to allocate and may interrupt audio processing, so it is best not to use arbitrarily large buffers.

sizems [number] (default: 0)

Set the size of the data buffer in milliseconds. The total number of samples is determined by the samplerate. It is important to note that large buffers can take time to allocate and may interrupt audio processing, so it is best not to use arbitrarily large buffers.

See Also

Name Description
buffer~ Store audio samples
groove~ Variable-rate looping sample playback
buffer
groove~ Variable-rate looping sample playback of a sized buffer
peek Read values from a buffer object.
poke Write a sample into an audio buffer.