- C 97.8%
- Makefile 2.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
synth
A small modular MIDI synthesizer written in C.
synth is a lightweight software synthesizer focused on simplicity, real-time performance, and experimentation. It provides a basic MIDI event system, multiple voices, and customizable synthesis engines without the complexity of large plugin frameworks.
The goal is not to recreate every feature of commercial synthesizers, but to provide a small and hackable foundation for building instruments.
MIDI Device (/dev/midi*) -> synth program -> ALSA output (aplay) -> speakers
Features
- Written entirely in C
- Real-time audio generation
- MIDI input support
- Polyphonic voices
- Pitch bend support
- Multiple synthesis approaches
- No external plugin frameworks
- Designed for experimentation
Building
Requires:
- GCC or Clang
- Make
make
Run:
cat /dev/midi* | ./out/{instrument} | aplay -f S16_LE -c 1 -r 48000 -B 1024 -F 256
Architecture
The synthesizer is built around independent voices.
Each voice contains:
- oscillator/string state
- envelope state
- synthesis parameters
- MIDI-controlled properties
Audio is generated one sample at a time:
for each voice:
update synthesis state
generate sample
mix into output
Design Goals
This project prioritizes:
- Simple code
- Low latency
- Hackability
- Understanding DSP concepts
It intentionally avoids:
- Large dependency trees
- Complex plugin APIs
- Hidden processing pipelines
The entire instrument should be understandable by reading the source.
License
MIT License