Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

op=1, CONST 1 (out = 1).

op=2, Pass through the first input unchanged (out = in1).

op=3, Sum (out = in1 + in2).

...

op=6, Time Derivative (out = (in1[n] - in1[n-1]) * SR)

op=17, Multiplication (out = in1 * in2).

op=7, Division (out = in1 / in2).

op=8, UNDB20 Const Gain (if (in1 == 0) --> out = undb20(in2"channelIndex2"), else out = undb20(-in2"-channelIndex2"))

op=18, Dynamic Gain (out = undb20(in1)).

op=9, Max (in1, in2)

op=10, Min (in1, in2)

...

op=13, Greater Than, (if (in1 >= in2) --> out = 1, else out = 0)

op=14, Boolean invert Invert (if (in1 < 0.5) --> out = 1, else out = 0)

op=15, FlipFlop FlipFlop1 - 1 for in1 = 1 until in2 = 1, else output 0

op=16, FlipFlop FlipFlop2 - 1 if in1 = 1 for sample count in in2, else output 0

Column 2 contains the channel index of the first input argument (0-based). Column 3 contains the channel index of the second input argument (0-based).

Example (sum): 0x01 00 03 = Ch 0 + Ch 1 = 65539. Example (sum): 0x00 01 03 = Ch 1 + Ch 0 = 259. Example (mul): 0x02 01 07 = Ch 1 * Ch 2 = 131335.

If an index is out of range or the op is out of range then the module outputs 0 for that operation.

...

Code Block
typedef struct _ModuleControlOp
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 numOps;                                 // Number of operations to be computed
    INT32 numOpsPackedSize;                       // Size in 4 bytes packed for internal use
    INT32 updateActive;                           // Specifies whether the configuration is updating (=1) or fixed (=0).
    INT32* config;                                // Controls the operations. One row per op.
    INT32* packedConf;                            // Operations configuration with each row packed into a word.
    FLOAT32* lastValue;                           // Previous sample value on all input channels
    INT32* firstBlock;                            // Array of flags set on first block of each channel before lastValue is valid
    INT32* triggerPulse;                          // Array of flags set on in operation 16 to trigger pulse output
    INT32* prevTriggerState;                      // Array of flags set on in operation 16 to trigger pulse output
    INT32* outPulseCnt;                           // Array of pulse high period count in samples for operation 16
    INT32* triggerPulse2;                         // Array of flags set on in operation 15 to trigger pulse output
} ModuleControlOpClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

numOps

int

const

0

1

Unrestricted

numOpsPackedSize

int

const

0

1

Unrestricted

updateActive

int

parameter

1

1

0:1

config

int*

derived

0

[1 x 3]

Unrestricted

packedConf

int*

parameter

0

[1 x 1]

-2147483648:2147483647

lastValue

float*

state

1

[1 x 1]

Unrestricted

firstBlock

int*

state

1

[1 x 1]

Unrestricted

triggerPulse

int*

state

1

[1 x 1]

Unrestricted

prevTriggerState

int*

state

1

[1 x 1]

Unrestricted

outPulseCnt

int*

state

1

[1 x 1]

Unrestricted

triggerPulse2

int*

state

1

[1 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: Input signal

...