First the interaction:
Frequency of Oscillator1: 440.0 Hz
Frequency of Oscillator2: 440.0 Hz
Frequency of Oscillator3: 440.0 Hz
Frequency of Oscillator4: 440.0 Hz
You can start and stop the sound with the corresponding buttons. The frequency and the volume of the oscillators can be manipulated separately and a master volume slider can be used.
The following diagram shows the connections between the used audio nodes:
First the oscillator is created. Its type is set and it is started:
var oscillator1 = context.createOscillator();
oscillator1.type = 0;
Now a gain node is created and the oscillator is connected to it.
var oscillator1VolumeNode = context.createGain();
oscillator1VolumeNode.gain.value = 0.25;
This is repeated for the other three oscillators. The masterVolumeNode will now be created and all the gain nodes (of the the oscillators) are connected to it:
var masterVolumeNode = context.createGain();
Finally the last connection is now set with:
Now you can generalize this concept yourself and connect all kind of audio nodes of the Web Audio API together which will part of the future tutorials.