gate

Conditional timepoint

The timepoint object automatically and reliably sends out a bang when the specified point in time is reached. How would you specify a point in time, and also make the notification “conditional”, such that it only occurs if a certain condition is met?

Using gate to route messages

You can assign input data to have a different function at different times, simply by sending it to different parts of your program. For example, if you have a control device such as a MIDI keyboard or other MIDI controller with a limited number of keys, buttons, knobs, or faders, you can assign one control element to be the mode selector that changes the functionality of all the other elements.

Delay MIDI note messages

To delay a single bang message by a certain amount of time, use the delay object. But to delay any other sort of message—a number, a list, even a group of different messages—use pipe. The pipe object dynamically allocates memory as it stores more and more messages, so it can keep track of many messages at once, even if they arrived at different times and have different delay times (unlike the delay object, which can only hold one bang at a time).

Filter out too-frequent repetitions

A common way of detecting the onset of a significant event in a continuous stream of data is to look for the data to exceed a certain threshold. For example, detecting when the amplitude exceeds a certain level in an audio signal can indicate that a sonic event has occurred. One common problem with threshold detection is that data might fluctuate around the threshold, going above and below it many times, and thus giving a false reading of multiple triggering events.