Namespaces

Variants
Actions

bucket

From Cycling '74 Wiki
(Difference between revisions)
Jump to: navigation, search
({{maxword|name=bucket}} Tips and Workarounds)
({{maxword|name=bucket}} Tips and Workarounds)
Line 7: Line 7:
 
=={{maxword|name=bucket}} Tips and Workarounds==
 
=={{maxword|name=bucket}} Tips and Workarounds==
  
While 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.
+
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:
 +
 
 +
* 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:
  
 
<maxpat>
 
<maxpat>
Line 50: Line 56:
 
CKoD.YpH+8s8ylrHvTpLlPsabu3Q4g3geaAy6mpNqmJMO1aJQtufMUfbZbdM
 
CKoD.YpH+8s8ylrHvTpLlPsabu3Q4g3geaAy6mpNqmJMO1aJQtufMUfbZbdM
 
7efczjOq
 
7efczjOq
 +
-----------end_max5_patcher-----------
 +
</maxpat>
 +
 +
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):
 +
 +
<maxpat>
 +
----------begin_max5_patcher----------
 +
778.3oc2X10bhBCEF9Z7WACWy5jOfjvd296Xmc1A0Ta5ffCDacam9eeIm.pc
 +
KsDEw05zYTOGfj22mdxW7xDufYEakUA9e2+m9dduLwyCRYR30D6ErJc67rzJ
 +
31BVIqpRWJCBsWSK2pg72UrorMY9lUp7LoFdBRSx0kxJYtNUqJx+cobt11q7
 +
D9z3PeBYJJzG07g+u12REazsMEtsoR0yuWku78MSLzLTh42XwAMjZAnxhYO7
 +
MJtUm2UjqySWIgK8iRUZV6Urcp9Oqk1lOHXWKYdnJ0yvEv0cmI6qSlX9HbfL
 +
TeeoTdRPjJL9lDMPHRoG.QnI+PHhtZg3SEmBBYLKBGXcHiCOqK0gjjqUDVj+
 +
4UgtSCbryzP7UkFePAkHhCETb9vpnDTfdDjEknOaTIgciMpjyvf4E3ANyVTh
 +
6PL9la8AF2Ze9.wHiwcGiQWqXr2sp3LOhEQtyC5+adjKepVHuCGOm4WJWdRk
 +
U1o2wwtruCRuKSfiguhPVl9AX7j18V3WDTRPnAhxDg6nDcihR6jTX9vPIWfb
 +
Fk3ja5pRgXXnTvntiR5ULJ09Y9yL+0IMwcxkn9m3CYWdtc00tAC+D4xrz7ku
 +
6aWXEbOAYp7+8MD.Nwj+s.rpdc04s8bih8w65oExJsJGJwN3dLSB4u2u2qVr
 +
PBWG0jYkZw5BUttQCbDeJlUeZMdcaSXFfYRE2Dsu2TUoyxj.95t.3XbAoGWX
 +
F+eTtPjLUPoTLcuKpSMxtf1mKnGmKDbxNIG9lnQv.lCHdf351A7iy.LRjQxB
 +
X32AAig7SFA4yStTxmhN+xmGAqJbQjO97KeAheojO2A0Sv8H+yXsrKECly+c
 +
vr+iodvtL1xbr9KkdntnG1ESODWp9MmO8Z5+W39zSGKoBueQ3vnhHbGQQw1Q
 +
rzcQiwL8tL5.P.9311yd+viSrupg2D03NLZTcmS0RniycMyd13GFm0Qj0cbh
 +
vc2Y2.a550OJKqZTHXr585+PQoIjEBgpbaHrC9fR4ip16mBYRKq25ttde6aJ
 +
sa6dqfELwzOuN4u.mi5K2B
 
-----------end_max5_patcher-----------
 
-----------end_max5_patcher-----------
 
</maxpat>
 
</maxpat>

Revision as of 05:18, 30 April 2013

Contents

bucket online refpage

Using the bucket object

bucket Tutorials

bucket Tips and Workarounds

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

Third-Party Max externals similar to the bucket object

Maxobjects.com listing for the bucket object

People who looked at/used this object also looked at....

The cycle object

Errors or Clarifications

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