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

polybuffer~

Manage multiple buffer~ objects

Description

polybuffer~ lets you operate with a group of buffer~ objects. Each buffer~ will be named after polybuffer~ first argument and an index (aka for a polybuffer~ toto object, each buffer~ will be named toto.N where N is the index).

Arguments

name [symbol]

Sets the name of the polybuffer~ and defines the names of the buffer~. For instance, if the polybuffer~ object's name is toto , the buffer~ will be named toto.1 , toto.2 , toto.3 .... polybuffer~ objects with the same name share the same buffer~.

Attributes

embed [int]

Save the buffer references in the patcher, on save. Note: empty buffers will be stored as empty buffer: their size and number of channels will be saved, but not the contents.

quiet [int]

Suppress the warning when loading multiple patches with polybuffer~ with the same name.

Common Box Attributes

annotation [symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background [int] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color [4 floats]

Sets the color for the object box outline.

fontface [int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic

Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname [symbol]

Sets the object's font.

fontsize [float]

Sets the object's font size (in points).

Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

hint [symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick [int] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation [int] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 0. 0. 0. 0.)

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect [4 floats]

g/s(set)

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size [2 floats]

g/s(set)

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor [float]

Sets the color for the object's text in RGBA format.

textjustification [int]

Text Justification

Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname [symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

Messages

(drag)

Drag a sound file and a buffer~ will be added to the list. Drag a folder and the sound files contained in the folder will be loaded in buffer~ objects.

append

Arguments

filename [list]
Display a dialog box to choose a sound file to add to polybuffer~ or load the sound file specified in argument.

appendempty

Arguments

length () [float]
channels [int]
Adds an empty buffer~ of the specified lenght and channels.

(mouse)

Double-click on the polybuffer~ object in a locked patcher to open a window where you can see information about the buffers.

clear

Delete every buffer~.

dump

Outputs list with the following information: index, buffer name, path of the sound file, length, channel and sampling rate.

getcount

Outputs the message count, followed by the number of buffer~ objects contained in the polybuffer~ object.

getbufferlist

Outputs the message bufferlist followed by the name of the buffer~. When every buffer~ name has been sent out the outlet, the done message is sent.

getsize

Outputs the memory size used by polybuffer~ in Bytes.

getshortname

Outputs the buffer~ name followed by the sound files name without the extension. Outputs done when the iteration is finished.

open

Open polybuffer~ object's window see information about the buffers.

readfolder

Arguments

name [list]
Loads multple sound files from the specified folder. If no argument is provided a dialog box will show up.

send

Arguments

index [int]
anything [list]
Sends messages to the buffer~ objects. The index corresponds to the buffer~ index, and an index of 0 send the message to every buffer~. For instance, send 0 clear sends the message clear to every buffer~ contained in this polybuffer~.

wclose

Close the window editor

writetofolder

Arguments

name [list]
Writes every buffer~ in a folder. If no argument is provided a dialog box will show up.

See Also

Name Description
buffer~ Store audio samples