Skip to content

Latest commit

Β 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ›οΈ Rusted Moog

A real-time, glitch-free virtual analog synthesizer β€” written from scratch in Rust.

A Minimoog-inspired 3-oscillator polysynth with a Moog ladder filter, born from a Python synth that couldn't stop clicking.

Rust CI License: MIT Tests Platform

(The actual Rust + egui app compiled to WASM β€” same panel, same knobs, same sound. No install.)

⚠️ In the browser, audio can crackle or lag a little β€” WebAssembly schedules audio on the main thread. The native desktop build runs flawlessly (audio on its own real-time thread). See Build & run.

Rusted Moog β€” Minimoog Model D-inspired panel rendered in Rust + egui: anodized panel, brushed-aluminium fluted knobs, red paddle switches, oak wood cheeks

Why does this exist?

It started as VOOG, a synth written in Python + NumPy. It sounded great β€” until you played a chord. Then it clicked, popped, and dropped out. The culprit wasn't CPU power; it was garbage-collection pauses and GIL contention firing inside the audio callback, blowing the 5.8 ms real-time deadline at random.

You can't fix that with faster Python. So we rewrote the whole thing in Rust:

No garbage collector. No locks in the audio thread. No allocations in the hot path. No glitches.

Same synth architecture, deterministic real-time audio, and a GUI that actually looks like hardware.

✨ Features

  • 🎚️ 3 oscillators β€” sine / saw / square / triangle, band-limited wavetables, per-osc octave, semitone, detune & level
  • πŸ”Š Moog ladder filter β€” authentic Huovilainen 24 dB/oct model with resonance, envelope & key-tracking
  • πŸ“ˆ Dual ADSR envelopes β€” independent amp & filter contours
  • 🌊 LFO β€” 4 waveforms, routable to filter / pitch / amp
  • 🎹 Jupiter-8-style arpeggiator β€” Up / Down / Up&Down / Random, 1–4 octaves, rate, gate and hold (latch)
  • πŸŒ€ Master effects β€” modulated chorus (rate + depth) and feedback delay (time + feedback)
  • 🎹 8-voice polyphony Γ— 4 multitimbral channels with oldest-note voice stealing
  • πŸŽ›οΈ Glide/portamento (off / always / legato) + white & pink noise
  • 🎼 37 factory presets β€” from sub basses to screaming leads, many ported from classic Minimoog patch charts (Parliament, ELP, Wakeman, Taurus…)
  • 🎨 Minimoog-inspired GUI β€” custom rotary knobs, VU meter, virtual keyboard (mouse + QWERTY)
  • 🎹 MIDI input with a full CC map (graceful fallback with no device)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  crate: voog  (binary)                                         β”‚
β”‚                                                                β”‚
β”‚   egui GUI  ──params/notes──►  lock-free queue  ──►  audio     β”‚
β”‚   (main thread)                (crossbeam)          callback   β”‚
β”‚        β–²                                            (cpal RT)   β”‚
β”‚        └──────────── VU / voices ◄─── atomics β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                                                                β”‚
β”‚   midir  ──MIDI events──►  same lock-free queue                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ depends on
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  crate: voog-dsp  (library β€” no I/O, 100% unit-tested)         β”‚
β”‚   oscillator Β· moog filter Β· adsr Β· lfo Β· noise Β· glide        β”‚
β”‚   voice Β· allocator Β· channel Β· synth Β· presets Β· params       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The real-time contract: the audio callback never allocates and never locks. The GUI and MIDI threads push events onto a lock-free ring; the callback drains them, renders one block, and publishes meters via atomics. That single discipline is what killed the dropouts.

πŸš€ Build & run

Tip

Run the native build for the real experience. The audio thread is allocation- and lock-free, so it's rock-solid β€” no clicks, no dropouts. The in-browser WASM demo is great for a quick try, but browsers schedule audio on the main thread (no cross-origin isolation on GitHub Pages β†’ no audio worklet thread), so it can crackle or add latency. Native has none of that.

Requires a stable Rust toolchain (edition 2021).

git clone https://github.com/gpasquero/rusted-moog.git
cd rusted-moog
cargo run --release

Play with your mouse on the on-screen keyboard, your computer keyboard (A W S E D F T G Y H U J K), or a MIDI controller.

πŸ§ͺ Testing

The entire DSP + engine core is pure and unit-tested β€” no audio device required:

cargo test --workspace   # 62 tests
cargo clippy --workspace # zero warnings

πŸ—ΊοΈ Roadmap

  • Patch save/load to disk (JSON, VOOG-compatible)
  • Oversampling for the filter at high resonance
  • Effects: chorus / delay / drive
  • Stereo spread & unison
  • Web build via WASM + WebAudio β€” live

πŸ™ Credits

Ladder filter after Antti Huovilainen's model. Pink noise via Paul Kellet's approximation. Inspired by the Moog Minimoog Model D and Subsequent 37. Rebuilt in Rust with cpal, midir and egui.

πŸ“„ License

MIT Β© gpasquero β€” see LICENSE.

Built because software instruments should never click.

About

πŸŽ›οΈ Real-time, glitch-free virtual analog synthesizer in Rust β€” Minimoog-inspired, Moog ladder filter, cpal + egui + MIDI. Rebuilt from a Python synth that couldn't stop clicking.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages