cmp Signal Modifiers:Comparators and Accumulators cmp cmp Compares audio signals or arrays Description Plugin 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 Syntax aout cmp a1, S_operator, a2 aout cmp a1, S_operator, kb kOut[] cmp kA[], S_operator, kb kOut[] cmp kA[], S_operator, kB[] kOut[] cmp k1, S_operator1, kIn[], S_operator2, k2 Initialization S_operator Math operator, one of ">", ">=", "`<", "`<=", "==" Performance a1 / a2 -- Input signals kb / ib -- Scalar term kA[] / 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 also Arithmetic and Logic Operations Comparators and Accumulators Array opcodes Credits By: &nameeduardo; 2017