cmpSignal Modifiers:Comparators and Accumulatorscmpcmp
Compares audio signals or arrays
DescriptionPlugin opcode in emugens.
Compares audio signals or arrays, sample by sample or value by value
All comparison operations are possible: `< `<=, >, >=, ==, !=
An audio signal can be compared against another audio signal, or
against a scalar (i- or k-value).
aOut cmp aL, ">", aR
aOut cmp aIn, ">=", 0.5
aOut cmp aIn, "`<=", kthreshold
An array can be compared against another array, against a scalar,
or checked to be within the range of two scalars. All operations
are available for i- and k- arrays
kOut[] cmp kIn[], ">=", kx
kOut[] cmp kA[], "==", kB[]
kOut[] cmp 0.5, "`<", kIn[], "`<=", 1
Syntaxaout cmp a1, S_operator, a2aout cmp a1, S_operator, kbkOut[] cmp kA[], S_operator, kbkOut[] cmp kA[], S_operator, kB[]kOut[] cmp k1, S_operator1, kIn[], S_operator2, k2InitializationS_operator Math operator, one of ">", ">=", "`<",
"`<=", "=="
Performancea1 / a2 -- Input signalskb / ib -- Scalar termkA[] / kB[] -- array inputs
Some example usages:
aout cmp aL, ">", aR ; aout = aL > aR for every sample
aout cmp aL, ">=", aR
aout cmp aL, "`<", aR
aout cmp aL, "`<=", aR
aout cmp aL, "==", aR
kOut[] cmp kA, ">=", kb ; kA is an array
Examples
Here is an example of the cmp opcode. It uses the file cmp.csd.
Example of the cmp opcode.See alsoArithmetic and Logic OperationsComparators and AccumulatorsArray opcodesCreditsBy: &nameeduardo; 2017