F
is the carrier, and E
and D
are modulators.
Simple FM Synthesis with only one modulator, is pretty straightforward in webaudio.
var ctx = new AudioContext || webkitAudioContext();
var out = ctx.destination;
// Instantiating
var E = ctx.createOscillator(); // Modulator
var F = ctx.createOscillator(); // Carrier
// Setting frequencies
E.frequency.value = 440;
F.frequency.value = 440;
// Modulation depth
var E_gain = ctx.createGain();
E_gain.gain.value = 3000;
// Wiring everything up
E.connect(E_gain);
E_gain.connect(F.frequency);
F.connect(out);
// Start making sound
E.start();
F.start();
But now I would like to make something like this.
Two modulators that is. How can this be implemented in webaudio?