2026-03-22
The synthesis engine — making dub from mathematics
Every sound on the Neuradub generator comes from mathematics.
Not metaphorically. Literally. A sine wave is a function: y = sin(2π × frequency × time). A sawtooth wave is a sum of harmonics. White noise is random numbers. That's it. That's the entire foundation. Everything else is what you do to those numbers before they reach the speaker.
The generator runs in a browser. JavaScript. The Web Audio API renders at 44,100 samples per second. Each sample is a floating-point number between -1 and 1. String enough of them together at 44.1kHz and you have sound. String enough sound together with the right rhythmic patterns and you have dub.
The bass is a sine wave with a touch of triangle wave for harmonic content. The kick drum is a sine wave that sweeps from 150Hz to 45Hz in 80 milliseconds — that downward pitch sweep is what makes a kick sound like a kick rather than a tone. The snare is a mix of a pitched tone and high-passed noise, both with fast envelopes. The hi-hat is bandpass-filtered noise with a very short decay.
The guitar skank is a filtered sawtooth oscillator with a sharp attack and short sustain, triggered on the upbeats. The organ is four sine waves at harmonic intervals — fundamental, octave, 12th, and double octave — which approximates a Hammond with specific drawbar settings. The melodica is a triangle wave with slow vibrato.
Spring reverb is simulated with multiple short delay lines feeding back into each other with slightly different delay times. The metallic character comes from the delays being very short — 20 to 50 milliseconds — creating a dense cluster of reflections that sounds like a coiled spring vibrating. Tape delay is a longer delay line with a low-pass filter in the feedback path, so each repeat is darker than the last, like a signal degrading on magnetic tape.
The dub mixing automation is the part that makes it dub rather than reggae. Every few bars, the code randomly decides to drop an instrument out and route another through the reverb or delay effects. The snare might disappear for 4 bars then come back drenched in spring reverb. The bass might suddenly be the only thing playing. These dropouts and returns — the space created and filled — are the essence of dub production. The mixing desk is a performance instrument, not a static tool.
The psybient layer uses the same oscillators but with different parameters. Pads are sawtooth waves with 3-second attack envelopes and heavy detuning between multiple oscillator voices, creating a slow beating effect. Granular textures are achieved by taking tiny slices of other sounds, pitch-shifting them, and scattering them across the stereo field. Singing bowls are pairs of sine waves at slightly detuned frequencies, creating the characteristic beating overtones.
All of this runs in real time in a browser tab. No plugins. No DAW. No samples downloaded from anywhere. Just mathematics rendered as air pressure variations that your brain interprets as a sound system at 2am playing roots dub through a wall of spring reverb.
The code is open. The maths is universal. The bass is the foundation.