OnRepeat
Emit a unit when a number of repetitions are observed
Syntax
OnRepeat options
Options
- -name
- Optional user-defined name for the transform
- -repeat
- Number of repetitions
- Type: Integer
- Default: 2
Inlets
- input
- Input to check for repetition
- Type: Changeable
- repeat
- Number of repetitions
- Type: Integer
- Default: 2
Outlets
- foundUnit
- Unit value emitted when repetition is found
- Type: Unit
- found
- Repeated value that triggered sequence
- Type: Any
Comments
OnRepeat looks for a sequence of repeated inputs. The length of the sequence is determined by the parameter or inlet repeat. Once such a sequence is discovered, the repeated value is emitted. For example, if repeat is set to 5, then a succession of five equal inputs of any type will trigger an output. See the help patch for more examples.
If the actual repeated value is not necessary, the foundUnit outlet can be used instead of the found outlet. foundUnit always emits a value of unit type that can be easily used to trigger other actions in response to the repetition. Both outlets may be used simultaneously.
See Also
- Change
- IntRange
- TypeFilter
- Multitrigger