bucket Reference

Pass numbers from outlet to outlet

bucket

Description

Outputs incoming values to outlets in bucket-brigade fashion. bucket acts as an n-stage shift register which can shift its contents from outlet to outlet in either direction.

Examples

Numbers are passed from one outlet to another

Arguments

outlets [int]

Optional

Sets the number of outlets. If there is no argument, there will be one outlet.

output-flag [int]

Optional

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.

Attributes

Common Box Attributes

Messages

bang

All stored values are sent out, but their position is not shifted.

int

Arguments

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

Arguments

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.

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).

set

Arguments

input [number]
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.

thaw

Resumes bucket output.

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.

See Also

Name Description
cycle
decode
gate
spray
Max Basic Tutorial 15: Abstractions Max Basic Tutorial 15: Abstractions