A ring modulation actor
Ring modulation multiplies two signals together, sample by sample.
The two inputs of this actor are called the "Input" and the "Modulation Input".
The ModInput defaults to an internally-generated sine wave (whose
frequency is called the "Carrier Frequency").
But for more complex spectral effects the ModInput may be a sound coming from another actor.
The amplitude of the modulating signal is scaled by the "Modulation Index".
The output contains only those frequencies which are the sum and difference
of frequencies present in the two inputs.
So, for a narrow-band input
bandlimited source with sinewave modulation, ring modulation is like
frequency shifting: the input spectrum is shifted to appear symmetrically, above and
below the carrier frequency, with the input spectrum itself above the carrier, and the
mirror-image of the input spectrum below it.
To use the ring modulation actor, load ring.so and create an actor of type RingModActor.
RingModActor messages
In addition to the messages understood by all generator actors, the RingModActor understands the following messages:
- SetModFreq hActor x
- Set the default modulation frequency for new instances created by this actor to x.
- SetAllModFreq hActor x time
- Set the modulation frequency of all children to x, and set the default carrier frequency for all future children. If time is specified, children will modulate to the new carrier frequency over the specified duration. Default carrier frequency is always set immediately regardless of time.
- SetModIndex hActor x
- Set the default modulation index for new instances created by this actor to x.
- SetAllModIndex hActor x time
- Set the modulation index of all children to x, and set the default modulation index for all future children. If time is specified, children will modulate to the new modulation index over the specified duration. Default modulation index is always set immediately regardless of time.
RingModActor handler messages
In addition to the messages understood by all handlers, the handler for the RingModActor algorithm understands the following messages:
- SetInput hSound hHandler
- Set the input to come from the handler hHandler.
- SetInput hSound
- Set the input to zero (i.e., silence the input).
- SetModInput hSound hHandler
- Set the modulation input to come from the handler hHandler.
- SetModInput hSound
- Set the modulation input back to the internal sine wave generator.
- SetModFreq hSound x time
- Set the modulation frequency to x. If time is specified, modulate to the new carrier frequency over the specified duration.
- SetModIndex hSound x time
- Set the modulation index to x. If time is specified, modulate to the new modulation index over the specified duration.