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

histo

Make a histogram of the numbers received

Description

histo records and outputs a simple histogram of the numbers it receives.

Arguments

Name Type Opt Description
size int opt histo takes an optional argument to set the size of the histogram. The default size is 128 (0-127).

Messages

bang In left inlet: Using the number most recently received in the left inlet, histo reports out the right outlet how many times that number has been received, and sends the number itself out the left outlet. If no number has been previously received in the left inlet, 0 is sent out both outlets.
int counted-numbers [int]
In left inlet: histo keeps count of how many times it has received a number between 0 and 127 in the left inlet. When a number is received, histo includes it in the count, sends the number of times that number has been received out the right outlet, and passes the number itself out the left outlet. Numbers outside the range 0-127 are ignored.
  (inlet1) discounted-numbers [int]
In right inlet: Has the same effect as a number in the left inlet, except that the number is not counted by histo.
clear Erases the memory of histo, to begin a new histogram.

Information for box attributes common to all objects

Output

int: Out left outlet: The number received in the inlet.

Out right outlet: The count of the number of times that number has been received.

Examples

Store a histogram of the numbers received display it in a table

See Also

Name Description
anal Make a histogram of number pairs received
itable A table in a patcher window
prob Make a weighted random series of numbers
table Store and graphically edit an array of numbers