thresh Reference

Combine numbers and lists when received close together

thresh

Description

Collects items into a list if they appear within a certain specifiable amount of time. Each time an item arrives, the time is reset.

Examples

If threshold time is exceeded without a new number being received, thresh sends out what it holds

Arguments

threshold [int]

Optional

Sets an initial value for the threshold time. If no argument is present, the initial value is 10 milliseconds.

threshold-time [float]

Optional

Converted to int.

Attributes

Common Box Attributes

Messages

int

Arguments

input [int]
In left inlet: Numbers and lists are combined into a list if received within a certain time of each other. When the time between incoming numbers is greater than the specified threshold, the list is sent out the outlet, and a new list is started.

  (inlet1)

Arguments

threshold [int]
In right inlet: The number is stored as the time, in milliseconds, to wait before sending out the compiled list of numbers. If no new number is received in the left inlet within that time, the list is sent out and a new list is started.

float

Arguments

input [float]
In left inlet: Numbers and lists are combined into a list if received within a certain time of each other. When the time between incoming numbers is greater than the specified threshold, the list is sent out the outlet, and a new list is started.

In right inlet: The number is stored as the time, in milliseconds, to wait before sending out the compiled list of numbers. If no new number is received in the left inlet within that time, the list is sent out and a new list is started.

list

Arguments

input [list]
In left inlet: The entire list is appended to the list stored in thresh.

Output

list

Each number or lists received in the left inlet is appended to a list stored by thresh. If a certain time passes without a new number being received, thresh sends out the list and starts a new list.

See Also

Name Description
bondo
buddy
iter
join
pack
quickthresh
zl