thresh~
Detect input above a certain level
Description
Use the thresh~ object to detect signals that exceed a specified level.
The thresh~ object initially outputs a signal of 0. It outputs a signal 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 signal is output again. If the low and high thresholds are the same, a reset occurs when the incoming signal is less than the threshold value. Otherwise, a reset occurs when the incoming signal is less than or equal to the low threshold. The low and high thresholds can be specified as arguments or as floats or signals in the middle and right inlets.
Arguments
lowThresh [auto]
The threshold below which the object will reset and output a signal of 0.
highThresh [auto]
The threshold above which the object will output a signal of 1.
Inlets
x [auto]
The input signal used for threshold comparisons.
lowThresh [auto]
The threshold below which the object will reset and output a signal of 0.
highThresh [auto]
The threshold above which the object will output a signal of 1.
Outlets
out1 [signal]
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).
Dynamic Attributes
These attributes can be modified in the code during execution using the set object
highThresh [auto]
The threshold above which the object will output a signal of 1.
lowThresh [auto]
The threshold below which the object will reset and output a signal of 0.
reset [bang] (default: 0)
Banging this attribute will reset the object to its default state.
x [auto]
The input signal used for threshold comparisons.
See Also
Name | Description |
---|---|
thresh~ | |
thresh | Detect input above a certain level |
adsr~ | Attack-Decay-Sustain-Release envelope generator |
change~ | Report signal direction |
edge~ | detect logical signal transitions |
silencedetector~ | Outputs a bang if a signal buffer of silence is detected after a note off |