peak Reference

Output larger numbers

peak

Description

Compares a number to a previous peak-value and, if larger, it is sent out the output while the new peak-value is set to that number.

Examples

Find the greatest in a series of numbers... A number in the right inlet always sets a new peak

Arguments

format [float]

Optional

The initial value stored in peak is 0. Providing a float argument will cause peak to operate with floating point numbers instead of integers.

Attributes

Common Box Attributes

Messages

bang

Sends the currently stored peak value out the left outlet.

int

Arguments

input [int]
In left inlet: If the input is greater than the value currently stored in peak, it is stored as the new peak value and is sent out.

  (inlet1)

Arguments

input [int]
In right inlet: The number is stored in peak as the new peak value, and is sent out.

float

Arguments

input [float]
In left inlet: If the input is greater than the value currently stored in peak, it is stored as the new peak value and is sent out.

  (inlet1)

Arguments

input [float]
In right inlet: The number is stored in peak as the new peak value, and is sent out.

list

Arguments

input [number]
peak [number]
In left inlet: The second number is stored as the new peak value and is sent out, then the first number is received in the left inlet.

Output

int

Out left outlet: New peak values are sent out. (A number received in the right inlet is always the new peak value.)

Out middle outlet: If the number received is a new peak value, the output is 1. If the number received in the left inlet is not a new peak value, the output is 0.

Out right outlet: If the number received is a new peak value, the output is 0. If the number received in the left inlet is not a new peak value, the output is 1.

See Also

Name Description
maximum
past
trough
>
Max Data Tutorial 2: Data Scaling Max Data Tutorial 2: Data Scaling