DetectIndex:
Filter:
Classes | UGens > Buffer

DetectIndex : Index : PureUGen : UGen : AbstractFunction : Object

Search a buffer for a value
Source: Osc.sc

Description

Linearly searches a buffer for a value (i.e., loops over the frames in the buffer from the beginning, checking for float equality), and returns index of first occurrence of said value. Returns -1 if value is not found. The object performs a search whenever a change in the in argument is detected; changes in the bufnum argument do not trigger searches. Checks for changes occur at the selected rate (ar or kr).

Class Methods

DetectIndex.ar(bufnum, in: 0.0, mul: 1.0, add: 0.0)

From superclass: Index

DetectIndex.kr(bufnum, in: 0.0, mul: 1.0, add: 0.0)

From superclass: Index

Arguments:

bufnum

index of the buffer

in

the input signal.

Returns:

index of first occurrence of value, or -1 if value is not found.

Inherited class methods

Instance Methods

Inherited instance methods

Examples