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

The PolyBuffer Object

The PolyBuffer Object

The PolyBuffer object in JS is a companion to the polybuffer~ object you create in a Max patcher. It provides the ability to access a group of buffer~ objects associated with a name.

PolyBuffer Constructor

var d = new PolyBuffer("name")

If no name is provided as an argument then instantiation will fail.

PolyBuffer Properties Overview

The following properties mirror the attributes of the same name from the Max polybuffer~ object. See the polybuffer~ reference for more details.

Polybuffer Properties

name [symbol]

g/s(get)

count [symbol]

g/s(get)

size [Number]

g/s(get)

PolyBuffer Methods Overview

The following methods mirror the messages of the same name from the Max polybuffer~ object. See the polybuffer~ reference for more details.

Polybuffer Methods

open

wclose

readfolder

Arguments

folder path [String]

writefolder

Arguments

folder path [String]

append

Arguments

soundfile path [String]

appendempty

Arguments

duration [Number]
channels [Number]

clear

print

send

Arguments

index [Number]
message [Anything]

The following methods are unique to the JS Polybuffer object.

Unique Polybuffer Methods

dump

Return an array containing index, name, path, duration, channel, and sample rate.

getshortname

Arguments

filename [symbol]

Return an array containing names of the buffer~ objects and file names.

getbufferlist

Arguments

filename [symbol]

Return an array containing names of all the buffer~ objects.

Examples

Example code can be found in the "JavaScript" tab of the polybuffer~ help patcher.

See Also

Name Description
JavaScript Usage JavaScript Usage