RNBO Objects & Operators thresh
Open Help

thresh

Detect input above a certain level

Description

Use the thresh object to detect values that exceed a specified level.

The thresh object initially outputs a value of 0. It outputs a value of 1 when the input is equal or greater than a set "high" threshold, until it goes below the reset or "low" threshold, at which point the 0 value is output again. If the low and high thresholds are the same, a reset occurs when the incoming value is less than the threshold value. Otherwise, a reset occurs when the incoming value is less than or equal to the low threshold. The low and high thresholds can be specified as arguments or as floats in the middle and right inlets.

Arguments

lowThresh [number]

Optional

The threshold below which the object will reset and output a value of 0.

highThresh [number]

Optional

The threshold above which the object will output a value of 1.

Inlets

x [number]

The input float used for threshold comparisons.

lowThresh [number]

The threshold below which the object will reset and output a value of 0.

highThresh [number]

The threshold above which the object will output a value of 1.

Outlets

out1 [number]

Outputs a 0 until the high threshold has been met and a 1 whenever the high threshold has been exceeded and not yet reset (meaning the incoming value has not yet dipped below the low threshold).

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

hot [bool] (default: false)

Trigger computation on all inlets.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

highThresh [number]

The threshold above which the object will output a value of 1.

lowThresh [number]

The threshold below which the object will reset and output a value of 0.

reset [bang] (default: 0)

Banging this attribute will reset the object to its default state.

x [number]

The input float used for threshold comparisons.

See Also

Name Description
thresh~
thresh~ Detect input above a certain level
adsr~ Attack-Decay-Sustain-Release envelope generator
change Filter out repetitions
edge~ detect logical signal transitions
silencedetector~ Outputs a bang if a signal buffer of silence is detected after a note off