From Cycling '74 Wiki

(Difference between revisions)

(→People who looked at/used this object also looked at....) |
(→{{maxword|name=bucket}} Tips and Workarounds) |
||

Line 10: | Line 10: | ||

=={{maxword|name=bucket}} Tips and Workarounds== | =={{maxword|name=bucket}} Tips and Workarounds== | ||

+ | |||

+ | ===Velocity and Acceleration=== | ||

Lots of people use the <strong>bucket</strong> object for shifting data in series, it's computationally useful for calculating first and second derivatives for streams of data. The terms "first and second derivative" are math-speak for keeping track of: | Lots of people use the <strong>bucket</strong> object for shifting data in series, it's computationally useful for calculating first and second derivatives for streams of data. The terms "first and second derivative" are math-speak for keeping track of: | ||

Line 45: | Line 47: | ||

-----------end_max5_patcher----------- | -----------end_max5_patcher----------- | ||

</maxpat> | </maxpat> | ||

+ | |||

+ | ===Running Averages=== | ||

I also tend to use the object quite a bit in situations where I desire a running average over some finite set of events (if you want a running average for an stream or unspecified set of values, you'd use the {{maxword|name=mean}} object). Here's an example that calculates the average of the last 8 floating point input values: | I also tend to use the object quite a bit in situations where I desire a running average over some finite set of events (if you want a running average for an stream or unspecified set of values, you'd use the {{maxword|name=mean}} object). Here's an example that calculates the average of the last 8 floating point input values: | ||

Line 64: | Line 68: | ||

-----------end_max5_patcher----------- | -----------end_max5_patcher----------- | ||

</maxpat> | </maxpat> | ||

+ | |||

+ | ===A Bucket for Symbols=== | ||

The {{maxword|name=bucket}} object is a little unusual in that you don't need to worry about using arguments to the object in order to have it work with floating point values. In fact, {{maxword|name=bucket}} is ''so'' useful that people often ask whether or not there's a Max object that is similar but will work with symbols or lists. While there isn't a specific object, here's a Max patch that does exactly that (and it also helpfully outputs stuff in standard right-to-left order, too): | The {{maxword|name=bucket}} object is a little unusual in that you don't need to worry about using arguments to the object in order to have it work with floating point values. In fact, {{maxword|name=bucket}} is ''so'' useful that people often ask whether or not there's a Max object that is similar but will work with symbols or lists. While there isn't a specific object, here's a Max patch that does exactly that (and it also helpfully outputs stuff in standard right-to-left order, too): |

## Contents |

The bucket object implements a bucket brigade device (in the electronics world, this is sometimes referred to as a discrete time-analogue delay line). As the examples below suggest, it's useful for single-sample delay lines, calculating averages, computing velocity and acceleration, and permutating lists by rotating them.

In the Max tutorial on abstractions, you can find a classic example of why the bucket object is so useful - this Max tutorial demonstrates its use as a single sample delay for number values useful for constructing drawing commands.

Lots of people use the **bucket** object for shifting data in series, it's computationally useful for calculating first and second derivatives for streams of data. The terms "first and second derivative" are math-speak for keeping track of:

- the rate that things are changing (that's what velocity (the first derivative) is - the rate of change in a value over time.

- the
*rate of the rate*that things are changing - that's what acceleration (the second derivative) is.

Here's a patch that does that:

-- Pasted Max Patch, click to expand. --

I also tend to use the object quite a bit in situations where I desire a running average over some finite set of events (if you want a running average for an stream or unspecified set of values, you'd use the mean object). Here's an example that calculates the average of the last 8 floating point input values:

-- Pasted Max Patch, click to expand. --

The bucket object is a little unusual in that you don't need to worry about using arguments to the object in order to have it work with floating point values. In fact, bucket is *so* useful that people often ask whether or not there's a Max object that is similar but will work with symbols or lists. While there isn't a specific object, here's a Max patch that does exactly that (and it also helpfully outputs stuff in standard right-to-left order, too):

-- Pasted Max Patch, click to expand. --

Maxobjects.com listing for the bucket object

The zl object (in its **zl rot** form). Useful for performing rotations of lists where the list offset is an odd number greater than 1.

The cycle object

(please list things that you believe to be errors or omissions from the existing refpage)