User Tools

Site Tools


This is an old revision of the document!

Numeric arrays are simply sequences of numbers stored in memory in Pd. [table] is an object that can be used to add an array in a patch; the array is stored as a subpatch, which means it will not be visible in the main patch unless you select “graph-on-parent” in the subpatch properties. To create an array that is visualized in the patch you need a graph.

Create an array

There are three ways to create an array:

  • Select “Array” from the Put menu. This will automatically create a new graph to place on the patch canvas.
  • Select “Graph” from the Put menu to place a graph, then select “Array” and choose “in last graph” to associate it with the graph you just placed.
  • Select “Object” from the Put menu and call the object table. This will create the subpatch with a graph and array. See the help on table for creation arguments.

Initializing Properties

You can initialize array properties using dialog boxes.

  • At creation time, give the array a name and size (and several miscellaneous choices)
  • Use the Properties menu to select the X and Y ranges for the array. For example, an array of 100 elements will have an X range of 0..99. By default, the Y range is -1..1 for audio values. For control values, change the range to whatever is appropriate for the control. For example, 0..127 for MIDI pitch numbers.

Storing Values in an Array

Reading Values from an Array

It is very common when working with audio to store values in arrays that exceed the range. This won't (necessarily) cause problems in the patch, but the values will be drawn outside the bounds of the graph. This can be disturbing!

See also numeric arrays from the Pd Documentation website.

tasc/tables_and_arrays.1216242022.txt.gz · Last modified: 2008/07/16 16:00 by scarl