Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

...

Child pages (Children Display)

Control Signals and Boolean Logic

Control signals are defined as having a block size of one. This useful for reducing the computational load when only a single value is needed. Wires holding control signals are shown as dashed lines (--------->).

...

The first step is to reduce the signal level by VolumeSetting. This is accomplished using the ScalerDBControl module. This module takes its gain setting from an input pin rather than from an inspector and allows for a control signal-dependent gain.

 

Image RemovedImage Added

ScalarDBControl

Simple dB scalar; gain controlled by control signal input

...

Another example of a control signal module is the SOFControl module.

Image RemovedImage Added

SOF Control

Second-order filter with gain determined by control signal input

...

Since the purpose of this filter is to boost bass frequencies, a filter type of “Peak EQ” and a frequency of 30 Hz are selected in the module’s inspector. The upper input pin of the SOFControl module requires a control signal input. This control input will originate from the DCSource controlling the volume. To achieve the equal-loudness contour, the bass must be boosted in relation to the volume. The mapping between the volume and the bass boost is accomplished with the TableInterp module:

Image RemovedImage Added

TableInterp

Second-order filter with gain determined by control signal input

...

This TableInterp will use a slightly different relation but will achieve fundamentally the same function – boosting the level at lower volumes:

...

Boolean Signals

A Boolean signal has only two possible values, 0 and 1. Boolean data is useful for controlling systems. Boolean signals are represented using 32-bit integer values. Audio Weaver includes several modules that perform logical operations on Boolean signals.

Image RemovedImage Added

BooleanInvert 

Inverts a Boolean signal (logical NOT gate)

Image RemovedImage Added

LogicAll 

Resolves to 1 if and only if all its inputs are non-zero (logical AND gate)

Image RemovedImage Added

LogicAny 

Resolves to 1 if any of its inputs are non-zero (logical OR gate)

...

By default the LogicAll and LogicAny modules do not have any output wires; they store the output in an internal variable (“.result”). By checking the box next to “outputValue” in the module properties, an output pin can be created.

Image RemovedImage Added

LogicBinaryOp 

Performs binary operations on Boolean data

The LogicBinaryOp module allows the user to select a logical operation (logical AND, OR, and XOR). It takes two control signals as input and outputs one wire with the computed Boolean value.

Image RemovedImage Added

BooleanSource 

Source module with Boolean data output

The BooleanSource module is a source module that supplies a buffer of Boolean data. As with any source module, the number of channels, block size, and sample rate are user-specified in the module properties.

Image RemovedImage Added

LogicCompare 

Compares input values

Image RemovedImage Added

LogicConstCompare 

Compares input to constant

...

If RMS1 < RMS2 then the LogicCompare module outputs 1 and the louder right channel is selcted; if RMS1 >= RMS2 then the module outputs 0 and the louder left channel is selected.

ParamSet and ParamGet

Control signals can be used to adjust parameters of modules. This can also be accomplished with the Param Get and Param Set modules. These are found in the Misc. folder. The example from the previous section can be made even cleaner by using ParamSet.

...