A newer version of Max is available. Click here to access the latest version of the documentation

peek~ Reference

Read and write sample values

peek~

Description

Use peek~ to read and write sample values to a named buffer~. Unlike related objects index~ and poke~, values and indices are specified as Max messages, and the object will function even when the audio is not turned on.

Examples

Peek at samples in a buffer~, and/or set the value of the samples

Arguments

buffer-name [symbol]

Buffer name

buffer-channel [int]

Optional

Buffer channel to read/write

clipping-enable-flag [int]

Optional

If set to 1, then values written to the buffer~ will be clipped to within -1.0 to 1.0. See the clip message.

Attributes

Common Box Attributes

Messages

int

Arguments

sample-index [int]
The value stored at the specified sample-index is sent out the peek~ object's outlet. However, if a value has just been received in the middle inlet, peek~ stores that value in the buffer~ at the specified sample index instead. If the sample-index is out of range for the buffer~, no data is read or written.

float

Arguments

sample-index/buffer-channel [float]
Floating-point values are converted to int values.

In left inlet: Set the sample to be stored.
In right inlet: Set the buffer channel.

list

Arguments

sample-index [int]
value [number]
buffer-channel [int]
The value is stored in the buffer~ at the specified sample-index and buffer-channel. If the buffer-channel is omitted, the most recent channel is used. If the sample-index is out of range for the buffer~, no data is written.

clip

Arguments

clipping-enable-flag [int]
If set to 1, then values written to the buffer~ will be clipped to within -1.0 to 1.0. Disable by setting to 0.

(mouse)

Double-click to view the buffer~ contents

set

Arguments

buffer-name [symbol]
Set buffer~ to read/write

Output

float

The sample value in a buffer~, located at the table index specified by a float or int received in the left inlet, is sent out the peek~ object's outlet.

See Also

Name Description
Working with Video in Jitter Working with Video in Jitter
buffer~
buffir~
index~
poke~
table