{"id":49952724,"url":"https://github.com/sunsided/synth","last_synced_at":"2026-05-19T22:00:58.332Z","repository":{"id":352651382,"uuid":"1215926522","full_name":"sunsided/synth","owner":"sunsided","description":"A terminal-based polyphonic synthesizer","archived":false,"fork":false,"pushed_at":"2026-05-17T20:20:33.000Z","size":2206,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T20:40:28.502Z","etag":null,"topics":["audio","chiptune","retro-sounds","rust","sid","sythesizer"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/synthie","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-20T11:47:56.000Z","updated_at":"2026-05-17T19:40:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sunsided/synth","commit_stats":null,"previous_names":["sunsided/synth"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sunsided/synth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fsynth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fsynth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fsynth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fsynth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/synth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fsynth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33231158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","chiptune","retro-sounds","rust","sid","sythesizer"],"created_at":"2026-05-17T20:13:54.729Z","updated_at":"2026-05-19T22:00:58.257Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# synthie\n\n[![Test](https://github.com/sunsided/synth/actions/workflows/test.yml/badge.svg)](https://github.com/sunsided/synth/actions/workflows/test.yml)\n[![Format](https://github.com/sunsided/synth/actions/workflows/format.yml/badge.svg)](https://github.com/sunsided/synth/actions/workflows/format.yml)\n[![Fuzz Build](https://github.com/sunsided/synth/actions/workflows/fuzz-check.yml/badge.svg)](https://github.com/sunsided/synth/actions/workflows/fuzz-check.yml)\n\nA polyphonic DSP engine library for Rust. Ships with a terminal synthesizer as its primary demo.\n\n## Workspace\n\n| Crate | Type | Description |\n|---|---|---|\n| [`synthie`](crates/synthie/) | library | DSP engine: oscillators, envelopes, filter, LFO, reverb, preset system |\n| [`synth-tui`](crates/synth-tui/) | binary | Terminal synthesizer — interactive demo of the engine |\n\n## Library\n\n### Features\n\n- **Five waveforms:** Pulse, Sawtooth, Triangle, Noise, Pulse+Saw\n- **ADSR amplitude envelope** with optional reverse (swell/duck) mode\n- **State-variable filter** — Low-pass, Band-pass, and High-pass modes with cutoff, resonance, and pre-filter drive\n- **LFO** with selectable targets: pitch (vibrato), pulse width, filter cutoff, or volume (tremolo)\n- **Reverb FX** with room size and high-frequency damping controls\n- **Global controls:** master volume and portamento (glide) time\n- **Preset system** with built-in SID-style patches and save/load support\n- **Optional `serde` support** for patch serialisation (enabled by default)\n\n### Quick Start\n\nAdd as a path or git dependency, then:\n\n```rust\nuse synthie::prelude::*; // SynthParams, Patch, AudioEvent, MidiNote, setup_audio, …\n\nfn main() -\u003e anyhow::Result\u003c()\u003e {\n    let patches = presets::sid::default_patches();\n    let (_stream, tx, _rx) = setup_audio()?;\n\n    // Load first preset\n    let params = Box::new(patches[0].params.clone());\n    tx.send(AudioEvent::LoadPatch(params))?;\n\n    // Play middle C on channel 0\n    tx.send(AudioEvent::NoteOn(ChannelNo(0), MidiNote(60)))?;\n    std::thread::sleep(std::time::Duration::from_secs(1));\n    tx.send(AudioEvent::NoteOff(ChannelNo(0), MidiNote(60)))?;\n    Ok(())\n}\n```\n\n### Examples\n\nRun any example with `cargo run -p synth --example \u003cname\u003e --release`.\n\n| Example | Description |\n|---|---|\n| `tune` | Multi-channel chords, melody, and drums — general engine showcase |\n| `lazy_jones` | Lazy Jones (David Whittaker, 1984) — the C64 hook that became Kernkraft 400 |\n| `kernkraft` | Kernkraft 400 (Zombie Nation, 1999) — full song structure, two channels |\n\n## TUI Demo\n\n![Screenshot](docs/screenshot.png)\n\n### Build and Run\n\n```sh\ncargo run -p synth-tui --release\n```\n\nOr build first, then run directly:\n\n```sh\ncargo build --release\n./target/release/synth-tui\n```\n\n\u003e **Note:** The synthesizer runs in the terminal's alternate screen with raw mode enabled. Your normal terminal session is fully restored on exit.\n\n### Controls\n\n#### Piano Keyboard\n\nThe keyboard is split into two chromatic octave rows. The lower row plays octave **N**; the upper row plays octave **N+1**.\n\n| Lower row key | `Z` | `S` | `X` | `D` | `C` | `V` | `G` | `B` | `H` | `N` | `J` | `M` |\n|---|---|---|---|---|---|---|---|---|---|---|---|---|\n| Note | C | C# | D | D# | E | F | F# | G | G# | A | A# | B |\n\n| Upper row key | `Q` | `2` | `W` | `3` | `E` | `R` | `5` | `T` | `6` | `Y` | `7` | `U` |\n|---|---|---|---|---|---|---|---|---|---|---|---|---|\n| Note | C | C# | D | D# | E | F | F# | G | G# | A | A# | B |\n\n\u003e **Terminal compatibility:** Note-off (key release) events require keyboard enhancement support (e.g. kitty protocol or WezTerm). In terminals that do not report key release, a note will sustain until another key is pressed.\n\n#### Navigation\n\n| Key | Action |\n|---|---|\n| `Tab` | Next parameter section |\n| `Shift+Tab` | Previous parameter section |\n| `←` / `→` | Select previous / next parameter within the section |\n| `↑` / `↓` | Increase / decrease the selected parameter value |\n| `Enter` | Load the selected preset (in the Presets section) |\n| `1` – `8` | Quick-load preset slot 1–8 (in the Presets section) |\n\n#### Utility\n\n| Key | Action |\n|---|---|\n| `F1` | Toggle help overlay |\n| `Esc` | Panic — silence all active notes immediately |\n| `Ctrl+S` | Save current parameters as a new user patch |\n| `Ctrl+C` / `Ctrl+Q` | Quit |\n| `F12` | Quit |\n\n#### Octave and Volume\n\n| Key | Action |\n|---|---|\n| `[` or `,` | Octave down |\n| `]` or `.` | Octave up |\n| `+` or `=` | Volume up |\n| `-` or `_` | Volume down |\n\n## Development\n\n### Pre-commit hooks\n\nThis repository uses [`prek`](https://github.com/j178/prek) (a Rust-native pre-commit manager) to enforce hygiene checks before each commit.\n\n**One-time setup:**\n\n```sh\ncargo install prek\nprek install\n```\n\n| Hook | Command | Trigger |\n|---|---|---|\n| `fmt-check` | `cargo fmt --all -- --check` | Any `.rs` change |\n| `clippy` | `cargo clippy --all-targets -- -D warnings` | Any `.rs` or `Cargo.toml` change |\n| `fuzz-build` | `task fuzz:build` | Any `.rs`, `Cargo.toml`, or `Cargo.lock` change |\n\nThe `fuzz-build` hook requires `cargo-fuzz` and the nightly toolchain (see [Fuzzing](#fuzzing) below).\n\nRun all hooks manually without committing:\n\n```sh\nprek run --all-files\n```\n\n### Fuzzing\n\nThe DSP core (`SvFilter`, `Oscillator`) and `SynthParams` serialisation paths are covered by\n[`cargo-fuzz`](https://github.com/rust-fuzz/cargo-fuzz) harnesses under `fuzz/fuzz_targets/`.\n\n**One-time setup:**\n\n```sh\ncargo install cargo-fuzz\nrustup toolchain install nightly\n```\n\n**List available targets:**\n\n```sh\ntask fuzz:targets\n```\n\nExpected output:\n\n```\nfuzz_filter_stability\nfuzz_osc_safety\nfuzz_params_serde\n```\n\n**Run a target:**\n\n```sh\ntask fuzz -- fuzz_filter_stability\ntask fuzz -- fuzz_osc_safety\ntask fuzz -- fuzz_params_serde\n```\n\nThe `fuzz` task sets `RUSTFLAGS=-Z sanitizer=address` and uses the nightly toolchain automatically.\nPass additional `cargo fuzz` flags after `--` if needed:\n\n```sh\ntask fuzz -- fuzz_filter_stability -- -max_total_time=60\n```\n\n**Harness summary:**\n\n| Target | What it tests | Invariant |\n|---|---|---|\n| `fuzz_filter_stability` | `SvFilter::process` across all modes/params | Output always finite |\n| `fuzz_osc_safety` | `Oscillator::next_sample` for all waveforms | Output always finite |\n| `fuzz_params_serde` | `SynthParams` JSON deserialise + round-trip | No panic; round-trip consistent |\n\n## License\n\nLicensed under the [European Union Public Licence v1.2 (EUPL-1.2)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fsynth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fsynth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fsynth/lists"}