Simple Web Synth Architecture

The Simple Web Synth is a software synthesizer that uses the common technique of subtractive synthesis to produce sound using two oscillators, a noise source, and a filter. The volume contour and filter are controlled by envelopes. Detailed notes follow.

All of these are basic building blocks you see everywhere in synthesizers, hence the name "Simple". This synthesizer is not intended to be particularly interesting. It's purpose is to run in modern web browsers without plugins, which empowers me to create interactive audio features on this web site. This is possible with WebAssembly and the Web Audio API, using RNBO to generate the WebAssembly code (alternately: in theory, I could have coded it in C++ and compiled the C++ to WebAssembly using Emscripten).

The diagram below shows the signal flow of the Simple Web Synth. The diagram is generated with Mermaid.js.

Notes:

flowchart TD

Oscillator1 ----> MIX
Oscillator2 ---> MIX
Noise --> MIX
MIX(unity mixer) --> AMP
AMP(amplitude envelope) --> Filter
Filter --> MA
MA(main level) --> S
S(saturator) --> L
L(limiter)

subgraph Oscillator1[Oscillator 1]
  O1_SIN(sine
        wave) --> O1_SEL
  O1_TRI(triangle
         wave) --> O1_SEL
  O1_SAW(saw
         wave) --> O1_SEL
  O1_PUL(pulse
         wave) --> O1_SEL
  O1_PWM(PWM) --> O1_PUL
  O1_SEL{wave
         shape
         selector} --> O1_AMP
  O1_AMP(level)
end

subgraph Oscillator2[Oscillator 2]
  O2_SIN(sine
  wave) --> O2_SEL
  O2_TRI(triangle
  wave) --> O2_SEL
  O2_SAW(saw
  wave) --> O2_SEL
  O2_PUL(pulse
  wave) --> O2_SEL
  O2_PWM(PWM) --> O2_PUL
  O2_SEL{wave
         shape
         selector} --> O2_AMP
  O2_AMP(level)
end

subgraph Noise[Noise Source]
  WHITE(white
        noise) --> N_SEL
  PINK(pink
       noise) --> N_SEL
  N_SEL{noise
        color
        selector} --> N_AMP(level)
end

subgraph Filter[State Variable Filter]
  none --> F
  LP(lowpass) --> F
  HP(highpass) --> F
  BP(bandpass) --> F
  NOTCH(notch) --> F
  F{filter
    type
    selector}
  FENV(
    filter
    frequency
    envelope) --> LP & HP & BP & NOTCH
end