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

bucket

Pass a number from outlet to outlet, out each one in turn

Description

bucket acts as an n-stage shift register which can shift its contents from outlet to outlet in either direction.

Arguments

Name Type Opt Description
number of outlets int opt Sets the number of outlets. If there is no argument, there will be one outlet.
echo-to-output-enable-flag (0 or non-zero) int opt A second non-zero argument sets the bucket object to "echo to output" mode, whereby the number received in the inlet is stored and sent out the left outlet when it is received. This makes it somewhat easier to visualize the data coming from the outlets.

Messages

bang All stored values are sent out, but their position is not shifted.
int input [int]
The numbers currently stored in bucket are sent out, then each number is moved one outlet to the right and the new number is stored to be sent out the left outlet the next time a number is received.
float input [float]
The numbers currently stored in bucket are sent out, then each number is moved one outlet to the right and the new number is stored to be sent out the left outlet the next time a number is received.
L2R Sets bucket to shift its stored values from left to right (the default) whenever it receives a number in its inlet.
R2L Sets bucket to shift its stored values from right to left whenever it receives a number in its inlet, placing the incoming number in the rightmost outlet.
freeze Suspends the bucket output, but new incoming numbers continue to shift the stored values internally.
l2r Sets bucket to shift its stored values from left to right (the default) whenever it receives a number in its inlet.
set input [list]
The word set, followed by a number, sends that number out each outlet, and stores the number as the next value to be sent out each of its outlets.
r2l Sets bucket to shift its stored values from right to left whenever it receives a number in its inlet, placing the incoming number in the rightmost outlet.
roll The word roll, followed by any number, causes bucket to use the value stored in its rightmost outlet as input; thus, it sends its output, shifts all stored values to the right, then stores the value which had been in the rightmost outlet in the leftmost outlet (as if it had been received in the inlet).
thaw Resumes bucket output.

Information for box attributes common to all objects

Output

int or float: When a number is received, it is not sent out immediately, but the numbers stored in bucket are sent out. The numbers are all moved one outlet to the right, and the newly received number is stored in the left position. When using the "echo to output" mode (set with a non-zero second argument to the object) the number received is sent out immediately, instead of the previous input value.

Examples

Numbers are passed from one outlet to another

See Also

Name Description
cycle Send a stream of data to individual outlets
decode Send 1 or 0 out a specific outlet
gate Pass the input out a specific outlet
spray Distribute a value to a numbered outlet
Max Basic Tutorial 15: Abstractions Max Basic Tutorial 15: Abstractions