This LV2 plugin is a direct port of the experiments/disyn distortion synthesizer. It provides 7 distortion synthesis algorithms in a monophonic LV2 instrument plugin.
The plugin features seven distortion-based synthesis algorithms, each with two parameters:
-
Dirichlet Pulse - Band-limited pulse via Dirichlet kernel
- Param 1: Harmonics (1-64)
- Param 2: Tilt (-3 to +15 dB/oct)
-
DSF Single-Sided - Moorer discrete summation formula
- Param 1: Decay (0-0.98)
- Param 2: Ratio (0.5-4)
-
DSF Double-Sided - Symmetric sideband generation
- Param 1: Decay (0-0.96)
- Param 2: Ratio (0.5-4.5)
-
Tanh Square - Hyperbolic tangent waveshaping (default)
- Param 1: Drive (0.05-5)
- Param 2: Trim (0.2-1.2)
-
Tanh Saw - Square-to-saw transformation
- Param 1: Drive (0.05-4.5)
- Param 2: Blend (0-1)
-
PAF - Phase-Aligned Formant oscillator
- Param 1: Formant (0.5-6 ×f0)
- Param 2: Bandwidth (50-3000 Hz)
-
Modified FM - Modified FM synthesis with exponential modulator
- Param 1: Index (0.01-8)
- Param 2: Ratio (0.25-6)
MIDI Input → Voice Management → Algorithm Oscillator
→ Attack/Release Envelope → Schroeder Reverb → Master Gain → Audio Output
- CMake (≥ 3.16)
- C++17 compiler
- LV2 development files
On Ubuntu/Debian:
sudo apt install build-essential cmake lv2-devcd lv2/disyn
cmake -S . -B build
cmake --build buildThe DSP plugin (disyn.so) and metadata (manifest.ttl, disyn.ttl) are generated in build/.
Copy the bundle to your LV2 directory (commonly ~/.lv2 on Linux):
cmake --install build --prefix ~/.lv2After installation, your LV2 path will contain:
~/.lv2/disyn.lv2/
├── manifest.ttl
├── disyn.ttl
└── disyn.so
Verify the plugin is recognized:
lv2ls | grep disyn
# Should output: https://danja.github.io/flues/plugins/disyn
lv2info https://danja.github.io/flues/plugins/disynLoad in an LV2 host:
- Jalv:
jalv.gtk https://danja.github.io/flues/plugins/disyn - Ardour: Plugins → Instrument → Flues Disyn
- Carla: Add Plugin → Instrument → Flues Disyn
| Port | Name | Range | Default | Description |
|---|---|---|---|---|
| Algorithm | Algorithm | 0-6 | 3 (Tanh Square) | Algorithm selector (enumeration) |
| Param 1 | Parameter 1 | 0-1 | 0.55 | Algorithm-specific parameter 1 (normalized) |
| Param 2 | Parameter 2 | 0-1 | 0.5 | Algorithm-specific parameter 2 (normalized) |
| Attack | Envelope Attack | 0-1 | 0.5 | Envelope attack time (0.001-1.0s) |
| Release | Envelope Release | 0-1 | 0.5 | Envelope release time (0.01-3.0s) |
| Size | Reverb Size | 0-1 | 0.5 | Reverb room size |
| Level | Reverb Level | 0-1 | 0.3 | Reverb wet/dry mix |
| Master | Master Gain | 0-1 | 0.8 | Output level |
Note: Parameters 1 and 2 are normalized (0-1) and internally mapped to algorithm-specific ranges. The meaning changes based on the selected algorithm.
- Load the plugin in your LV2 host
- Connect MIDI input and audio output
- Select an algorithm from the dropdown (default: Tanh Square)
- Play MIDI notes (monophonic)
- Adjust Param 1 and Param 2 to shape the sound
- Tune envelope attack/release for desired articulation
- Add reverb to taste
The plugin follows the established pattern from lv2/pm-synth:
- Header-only modules in
src/modules/OscillatorModule.hpp- Seven algorithm implementationsEnvelopeModule.hpp- AR envelope generatorReverbModule.hpp- Schroeder reverb (4 comb + 2 allpass)
- Main engine:
DisynEngine.hpp- Coordinates modules, voice management - Plugin glue:
disyn_plugin.cpp- LV2 interface, MIDI handling - Metadata:
disyn.lv2/*.ttl- Port definitions, plugin metadata
The C++ port is a line-by-line translation of the JavaScript AudioWorklet code:
- Identical algorithms - Same math, same constants (TWO_PI, EPSILON)
- Identical parameter mapping - Same exponential/linear curves
- Identical signal flow - oscillator → envelope → reverb
- Sample-accurate MIDI - Events processed at exact sample positions
- Voice tail detection - Automatically stops processing when envelope finishes
- Real-time safe - No allocations in audio callback
- Low latency - Direct synthesis, no look-ahead
- CPU efficient - Optimized C++ with minimal overhead
- Monophonic - Single voice for low CPU usage
- Monophonic only (no polyphony)
- No preset system (yet)
- No GUI (uses generic host controls)
- Parameter 1/2 labels don't change per algorithm (host limitation)
- Polyphony (4-8 voices with voice stealing)
- GTK3 UI with algorithm-specific parameter labels
- LV2 state extension for preset save/load
- Pitch bend support
- Modulation wheel → parameter mapping
- Per-algorithm parameter value displays
MIT License - See repository root for details.
- Source:
experiments/disyn/- JavaScript browser version - Related:
lv2/pm-synth/- Physical modeling synth LV2 plugin - Documentation:
experiments/disyn/docs/DISYN-LV2.md- Implementation plan