Previous topic

Shorthand Declarations

Next topic

Random Number Generation

This Page

Ring and Amplitude Modulation

Ring Modulation

AudioIn[1] * AudioIn[2] >> AudioOut[1];

Amplitude Modulation

AudioIn[2]
>> Level (
        gainType:       'Linear'
        gain:           AudioIn[1] * 0.5
        offset:         0.5
        bypass:         off
)
>> AudioOut[1:2];

The following is equivalent to the previous code:

( AudioIn[1] * 0.5 + 0.5 ) * AudioIn[2] >> AudioOut[1];

Amplitude modulation through a processor with an analog input source. The control is set to run at ControlRate.

signal Modulator {
        default:        1.0
        rate:           ControlRate
        reset:          MasterReset
        meta:           'Analog input mapped to 0.0 to 1.0'
}

# Stream analog in 1 to the modulation control
ControlIn[1]
>> Map (
        mode:           'Linear'
        minimum:        0.0
        maximum:        1.0
        bypass:         off
)
>> Modulator;

AudioIn[2]
>> Level (
        gainType:       'Linear'
        gain:           Modulator
        offset:         0.0
        bypass:         off
)
>> AudioOut[1:2];