skip to content

Modulator

An operator that uses its own oscillator’s frequency to modulate the frequency of its parent <carrier-blam> or <modulation-blam> element. In other words, an operator that enables FM (Frequency Modulation) synthesis.

DRAFT! This element is in early development and is liable to change or possibly be replaced.

class
Modulator
extends
Operator
tag
<modulator-blam>
see

Props

name type default description
ratio number 1

The frequency multiplier based on the parent element’s frequency. For example, if the parent <carrier-blam> or <modulator-blam> has a frequency of 440Hz and the ratio is 2, then the modulation frequency will be 880Hz.

gain number 1

For <modulator-blam>, gain represents the amount by which the parent operator element’s frequency is modulated. To hear a change, high values—often in the 100s—are needed.

type string ‘sine’

The basic waveform used by the operator. Can be ‘sine’, ‘triangle’, ‘square’, or ‘sawtooth’.

curve string ‘0 0, 1 0.005’

The amplitude envelope for the operator’s principle oscillator.

release number 1

In HYPERBLAM, the R (release) in ADSR is defined separately to the main envelope (curve). This enables synchronizing the diminishing of amplitude curves with events.

feedback number 0

How much of the operator’s oscillator to loop back into its own frequency param. This is good for creating interesting overtones. At very high numbers, you can create pseudo-noise.

detune number 0

How much to detune to apply, in cents. For example, -100 would detune the output 1 semitone.

out string

The element to which the output is connected. This should rarely be changed, since SynthBase-derived elements have good sensible defaults.

Events

type description
blam

Fired whenever the element’s play() method is executed.

Examples

OH FUN! There are currently no examples using Modulator.