Sync & FM oscillator

ATMOSYNTH built-in module

One oscillator started over by another, which is the oldest way of making a sound too bright for the wave it is made of. Two phases run here: the master is the note, and the slave is what you hear, running at the note times Detune. Every time the master comes round it takes hold of the slave, and because the pitch is the master's, Detune moves the timbre rather than the note — sweep it and the sound climbs without the pitch going anywhere. That is the sync sweep, and an envelope or an LFO on the Detune input plays it. Sync is off at nothing, soft at one and hard at two. Hard throws the slave's phase back to the start mid-cycle, and the wave restarts wherever it had got to — the hard, vocal, tearing sound. Soft reverses the slave's direction instead, so the wave folds back and runs the way it came: nothing jumps, only the slope turns, which is gentler, hollower, and comes round every second master turn, so soft sits an octave under hard. Tuned above the note the slave gets through more of its wave between one reset and the next, which is where the sweep's brightness comes from. Tuned below it the master catches the slave before it has finished, so what comes out is a fraction of the wave and quieter for it — half the swing an octave down, a quarter of it two octaves down. That is sync at those tunings rather than a fault, and it is why the bottom of the knob is most use with sync off, where an octave down is the sub-oscillator most patches want. FM is linear and in hertz rather than a detuning in cents, and it goes through zero: driven below nothing the phase runs backwards instead of stopping there, which keeps the sidebands even once the depth passes the note being modulated. It moves master and slave together, so the sync ratio survives it. Patch an oscillator in for the bells and clangs FM is known for, or an LFO for a vibrato in hertz rather than semitones. Wave travels sine, triangle, sawtooth, square at nothing to three, and any two mixed between; sync is loudest on the last two, which have the most to be cut off. Sync is an input as well: whatever is patched there takes the master over on its rising zero crossings, and silence never crosses, so an empty one leaves the note the job. The code is mostly band-limiting. A reset is a step, it almost never lands on a sample instant, and one rounded to the nearest sample throws off tones at no harmonic of anything — the grit that gives a digital sync away. So every discontinuity is corrected where it actually happened and by however much the wave actually jumped, and soft sync's corner by that correction integrated once. The output is centred on the way out, for the reason an analog oscillator has a capacitor on its own: a wave cut off mid-cycle no longer sits either side of nothing, and two octaves down three quarters of what left would be a constant — which no speaker moves for, which eats the headroom the rest of the patch needs, and which thumps at both ends of the note.

What it is made of

The Web Audio nodes inside this module and how they are wired. Fork it to open the same graph in the editor, where every part can be changed.

A patch connects to it through MIDI input ‘Note’, audio input ‘Sync’, audio input ‘FM’, audio input ‘Detune’ and audio output ‘Out’.

  • ‘note’ is a MIDI input this module declares, set to midiInput midi. Its output modulates the frequency of ‘gen’.
  • ‘gen’ is a audioWorklet node, set to processorName atmosynth-sync, numberOfInputs 0, numberOfOutputs 1. It runs its author's own code (K21). Its output reaches input 0 of ‘out’. A patch can set its wave, through ‘Wave (0 sine, 1 triangle, 2 saw, 3 square)’. A patch can set its mode, through ‘Sync (0 off, 1 soft, 2 hard)’. A patch can set its detune, through ‘Detune (cents)’.
  • ‘syncin’ is an audio input this module declares, set to input sync. Its output modulates the reset of ‘gen’.
  • ‘fmin’ is an audio input this module declares, set to input fm. Its output reaches input 0 of ‘fmdepth’.
  • ‘fmdepth’ is a gain node. Its output modulates the fm of ‘gen’. A patch can set its gain, through ‘FM amount (Hz)’.
  • ‘detunein’ is an audio input this module declares, set to input detune. Its output reaches input 0 of ‘detunedepth’.
  • ‘detunedepth’ is a gain node. Its output modulates the detune of ‘gen’. A patch can set its gain, through ‘Detune amount (cents)’.
  • ‘out’ is an audio output this module declares, set to output out.
  • ‘Wave (0 sine, 1 triangle, 2 saw, 3 square)’ is a setting a patch can turn, from 0 to 3.
  • ‘Sync (0 off, 1 soft, 2 hard)’ is a setting a patch can turn, from 0 to 2.
  • ‘Detune (cents)’ is a setting a patch can turn, from -2400 to 4800.
  • ‘Detune amount (cents)’ is a setting a patch can turn, from 0 to 4800.
  • ‘FM amount (Hz)’ is a setting a patch can turn, from 0 to 4000.

No published patch uses this module yet

When somebody publishes a patch built on it, that patch will be listed here.

Browse Explore