mc.sah~ Reference

Sample and hold a signal according to a trigger (multichannel)

mc.sah~

Description

Use sah~ to capture ("sample") and continually output ("hold") the value of an input signal whenever another "control" signal rises above a specified threshold value. The sampled value is "held" until the control signal drops below and then rises above the threshold value once more, at which point the input is sampled again. Generally this allows one signal to be synchronized to the behavior of another.

Arguments

initial-trigger-value [number]

Optional

Initial trigger value

Attributes

Common Box Attributes

Multichannel Group Attributes

Messages

float

Arguments

trigger-value [float]
Set trigger threshold

signal

In left inlet: A signal to be sampled. When the control signal (in the right inlet) goes from being at or below the current trigger value to being above the trigger value, the signal in the left inlet is sampled and its value is sent out as a constant signal value.

In right inlet: The control signal. In order to cause a change in the output of sah~, the control signal must go from being at or below the trigger value to above the trigger value. When this transition occurs, the signal in the left inlet is sampled and becomes the new output signal value.

Multichannel Group Messages

Output

signal

When the control signal received in the right inlet goes from being at or below the trigger value to being above the trigger value, the output signal changes to the current value of the signal received in the left inlet. This signal value is sent out until the next time the trigger value is exceeded by the control signal.

See Also

Name Description
gate~
phasor~
thresh~
train~