gizmobench

Virtual Synthesizer

Two oscillators, each with its own wave, octave, semitones, fine tune and level, run through a lowpass, highpass or bandpass filter, an ADSR envelope that can also open the filter, and an LFO that can move the pitch, the cutoff or the volume. Play it from the on-screen keys or the computer keyboard, where Z to M and Q to U are two octaves, with up to eight notes sounding at once. Record what you play as a sequence at your tempo, or type MIDI-style note messages such as 0 on C4 100, then play the sequence back, snap it to sixteenth notes and render it to a mono WAV of up to 120 seconds. Every sound setting lives in a patch you can copy or download as JSON and load again later, and a limiter keeps the output below full scale however loud the patch gets. Nothing is uploaded and no account is asked for.

Patch

Default patch
Oscillator 1
0
0
0
80%
Oscillator 2
-1
0
+7 cents
40%
Filter
2400 Hz
4 dB
1.5 octaves
Envelope
10 ms
300 ms
60%
400 ms
LFO
5 Hz
0%
Output
80%
440 Hz

Play

Audio starts with your first key
Keyboard from

Z to M play the lower octave and Q to U the upper one; S D G H J and 2 3 5 6 7 are their sharps. Keys work while focus is not in a text box.

Note
A4 (reference)
Frequency
440.000 Hz
Voices
0 of 8
Sequence
0 notes, 0 beats

Press a key on screen, or a letter on your keyboard, to play.

Sequence

0 notes at 120 BPM

Patch JSON

Default patch
{
  "format": "gizmobench.virtual-synthesizer.patch",
  "version": 1,
  "osc1": {
    "wave": "sawtooth",
    "octave": 0,
    "semitones": 0,
    "cents": 0,
    "level": 0.8
  },
  "osc2": {
    "wave": "square",
    "octave": -1,
    "semitones": 0,
    "cents": 7,
    "level": 0.4
  },
  "filter": {
    "type": "lowpass",
    "cutoff": 2400,
    "resonance": 4,
    "envAmount": 1.5
  },
  "envelope": {
    "attack": 0.01,
    "decay": 0.3,
    "sustain": 0.6,
    "release": 0.4
  },
  "lfo": {
    "wave": "sine",
    "target": "pitch",
    "rate": 5,
    "depth": 0
  },
  "volume": 0.8,
  "a4": 440
}
  • Round bassSquare and saw an octave down, a closed filter the envelope snaps open
    square and sawtooth, lowpass at 300 Hz
  • Soft padTwo detuned saws, slow attack and a long release
    sawtooth and sawtooth, lowpass at 1400 Hz
  • Vibrato leadSquare with a fifth above it, and a pitch LFO for vibrato
    square and triangle, lowpass at 3500 Hz
  • Filter wobbleA resonant bandpass swept by a square LFO
    sawtooth and square, bandpass at 700 Hz
How the sound is made. Live notes use the browser's own oscillators and filter, so they can sound a little different from one device to another. The WAV is rendered in this page, sample by sample, from the same patch numbers, so rendering the same patch, sequence and tempo again gives the same file. The patch, tempo, keyboard octave and current sequence are remembered in this browser, and nothing is uploaded.

Common questions

Which computer keys play which notes?
With the keyboard starting at C4, the bottom letter row Z X C V B N M plays C4 to B4 and the row above it carries the sharps on S, D, G, H and J. The qwerty row Q W E R T Y U plays C5 to B5, with its sharps on 2, 3, 5, 6 and 7. The Keyboard from buttons move both octaves to start at C2, C3, C4 or C5. Letters typed into a text box, such as the note messages, type rather than play. The letters are the ones a US QWERTY keyboard sends, so on another layout the rows sit in the same place but send different letters; clicking or tapping a key always works.
How many notes can sound at once?
Eight. When a ninth note starts, the synth takes over the oldest voice that has already been released, or the oldest held one if none has, and fades it out over 5 milliseconds instead of cutting it with a click. Sequence playback and the WAV export follow the same rule, so both give way on the same notes. After the voices, a limiter passes quiet signals unchanged and bends loud ones smoothly, so no output sample reaches 98 percent of full scale however many notes are stacked.
How do I record a sequence, and what are note messages?
Press Record and play: recording starts at your first note, and Stop recording turns what you played into the sequence, timed in beats at the tempo you set and kept to 1/960 of a beat. A recording with no notes leaves the previous sequence as it was. The sequence is also written out as note messages, one per line, in MIDI's own terms: a beat, on or off, a note name such as C4 or F#3 or a MIDI number, and a velocity from 1 to 127, which is 100 if you leave it out. An on with velocity 0 counts as an off, as in MIDI. Edit or type messages and press Load messages; a mistake on a line is reported with its line number and the current sequence is kept. Quantize to 1/16 moves every start and end to the nearest sixteenth note, gives a note that would shrink to nothing one sixteenth, and refuses a change that would make two notes of one pitch overlap. A sequence holds up to 1000 notes and 4096 beats.
What does the WAV export contain?
The current sequence, played through the current patch at the current tempo, from beat 0 to the end of the last note's release, as mono 16-bit PCM at 44,100 Hz. It is rendered in the page, sample by sample, in steps you can cancel, so rendering the same patch, sequence and tempo again gives identical bytes. Exports stop at 120 seconds including the release tail: a longer sequence is refused rather than cut short, so raise the tempo or shorten it. Changing the patch, the tempo or the sequence sets a finished render aside, so the file you download always matches the current patch, tempo and sequence.
Will the WAV sound exactly like live playback?
Very close, but not identical. Live notes use the browser's own oscillators and biquad filter. The WAV renderer uses its own oscillator formulas, with a correction that reduces aliasing on the sawtooth and square, and the filter formulas the Web Audio specification gives, updated every 16 samples. The envelope, pitch, filter settings, LFO and voice limit are the same numbers in both. Live sound also depends on your device's sample rate and audio output, and no patch here claims to reproduce a particular hardware synthesizer.
What is in a patch file, and what happens to a bad one?
A patch is every sound control on the page: each oscillator's wave, octave, semitones, fine tune and level, the filter type, cutoff, resonance and envelope amount, the attack, decay, sustain and release, the LFO wave, target, rate and depth, the volume and the A4 tuning. Copy patch JSON and Download patch JSON write exactly the patch you hear. A pasted or opened patch is checked in full before it replaces anything: an unknown setting, a missing one or a value out of range is named, and the current patch stays. If the browser refuses the clipboard, the full JSON appears in a box to copy by hand.
Why is there no sound, or why did my notes stop?
Browsers start audio only after a click, tap or key press on the page, so the first key both wakes the audio and plays; Start audio does the same without a note. Held notes are released when the window loses focus, because a key held at that moment never sends its key up, and hiding the tab or pressing Stop silences every note within 30 milliseconds and closes the audio engine until you play again. If the browser has no Web Audio at all, the page says so, and patches, note messages and WAV export still work.
Is A4 really 440 Hz?
Yes. At the default tuning every key is the equal-tempered frequency measured from A4 = 440 Hz, so A5 is 880 Hz and middle C is 261.626 Hz, and the readout shows the last key's frequency to three decimals. The A4 tuning control moves the reference anywhere from 415 to 466 Hz, and each oscillator's octave, semitones and fine tune then shift from the key's pitch.

Original synthesis; patch sound varies with device/sample rate and no hardware-emulation claims.