From 9f030615df9c282f1a6a331c3adfdac7555d2a7d Mon Sep 17 00:00:00 2001 From: OpenSauce Date: Sun, 31 May 2026 12:56:52 +0100 Subject: [PATCH] chore: remove unintended files from repo CLAUDE.md and the Clean_Eb/Djent_Eb presets were committed by accident during a merge resolution; they were meant to stay local. Untrack them (files remain on disk). CLAUDE.md is not gitignored since it may be checked in deliberately later. --- CLAUDE.md | 133 ------------------------------------------ presets/Clean_Eb.json | 94 ----------------------------- presets/Djent_Eb.json | 103 -------------------------------- 3 files changed, 330 deletions(-) delete mode 100644 CLAUDE.md delete mode 100644 presets/Clean_Eb.json delete mode 100644 presets/Djent_Eb.json diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 7fa6849..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,133 +0,0 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## Project Overview - -Rustortion is a real-time guitar/bass amp simulator built in Rust. It runs as a standalone JACK app and as a VST3/CLAP plugin. The GUI is shared between both targets via the `rustortion-ui` crate. - -## Workspace Crates - -- **`rustortion-core`** — DSP engine, amp stages, IR cabinet, preset management. No GUI dependencies. -- **`rustortion-ui`** — Shared GUI: stages, components, messages, handlers, i18n, `SharedApp`. Uses `iced = "0.14"`. -- **`rustortion-standalone`** — Standalone JACK app. Thin shell wrapping `SharedApp` with MIDI, tuner, settings, recording. -- **`rustortion-plugin`** — VST3/CLAP plugin via nih-plug. Editor uses `iced_baseview` + `SharedApp`. -- **`xtask`** — Build automation. - -## Build & Development Commands - -```bash -# Build and run standalone (requires JACK/PipeWire) -cargo run --release - -# Build plugin -cargo build -p rustortion-plugin --release - -# Lint (formatting + clippy) — this is what CI runs -make lint - -# Run tests -make test # all tests -cargo test test_name # single test - -# Benchmarks -make bench - -# Coverage (requires cargo-tarpaulin) -make cover -``` - -**System dependencies** (must be installed before building): -```bash -sudo apt-get install libjack-jackd2-dev libasound2-dev pkg-config -``` - -**Clippy flags** used in CI: `-D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery` -(`lib.rs` has `#![allow(...)]` overrides for specific pedantic/nursery lints) - -**Dev profile** uses `opt-level = 1` because IR cabinet processing is too slow in pure debug mode. - -## Architecture - -### Shared GUI Pattern - -Both standalone and plugin use `SharedApp` from `rustortion-ui`: - -``` -rustortion-standalone rustortion-plugin - AmplifierApp PluginApp (iced_baseview::Application) - └─ SharedApp └─ SharedApp - └─ StandaloneBackend └─ PluginBackend - └─ Manager/Engine (JACK) └─ EngineHandle + GuiContext -``` - -`ParamBackend` trait (`rustortion-ui/src/backend.rs`) abstracts engine communication. `Capabilities` struct controls which UI sections render (e.g. plugin hides tuner, MIDI config, recording, settings). - -### Audio Signal Flow - -``` -Input → [Tuner bypass] → Input Filters (HP/LP) → [Upsample] → Amp Chain (stages) → [Downsample] → Pitch Shifter → IR Cabinet → Peak Meter → Recorder → Output -``` - -### Key Modules - -#### rustortion-core -- **`src/amp/chain.rs`** — Ordered list of processing stages. -- **`src/amp/stages/`** — 10 registered DSP stages: preamp, compressor, noise_gate, tonestack, poweramp, multiband_saturator, level, delay, reverb, eq. Plus utilities: `clipper`, `filter`, `common`. -- **`src/audio/engine.rs`** — Core audio processing loop. Controlled via crossbeam channels. -- **`src/ir/`** — IR cabinet, convolver (FIR/FFT), loader. -- **`src/preset/`** — Preset save/load/delete, `StageConfig` enum, `InputFilterConfig`. - -#### rustortion-ui -- **`src/app.rs`** — `SharedApp` — shared state, update(), view(), subscription(). -- **`src/backend.rs`** — `ParamBackend` trait, `Capabilities`, `ExternalEvent`. -- **`src/stages/mod.rs`** — `gui_stage_registry!` macro, `ParamUpdate`, all 10 stage view modules. -- **`src/components/`** — Reusable UI components: widgets, dialogs, preset_bar, peak_meter, ir_cabinet_control, minimap, etc. -- **`src/handlers/`** — Portable handlers: preset, hotkey. -- **`src/messages/`** — Message enums for Iced event-driven updates. -- **`src/i18n/`** — `tr!()` macro, EN + ZH_CN locales. -- **`src/tabs.rs`** — Tab navigation: Amp, Effects, Cabinet, IO. - -#### rustortion-standalone -- **`src/gui/app.rs`** — `AmplifierApp` wrapping `SharedApp` + standalone handlers (MIDI, tuner, settings, recording). -- **`src/backend.rs`** — `StandaloneBackend` implementing `ParamBackend` via `Manager`/`Engine`. -- **`src/audio/`** — JACK client, Manager, ports. -- **`src/gui/handlers/`** — Standalone-only: midi, tuner, settings. -- **`src/gui/components/dialogs/`** — Standalone-only dialogs: midi, settings, tuner. - -#### rustortion-plugin -- **`src/lib.rs`** — nih-plug `Plugin` impl, audio processing, initialization. -- **`src/editor.rs`** — `PluginEditor` (nih-plug `Editor` trait) + `PluginApp` (iced_baseview `Application`). -- **`src/backend.rs`** — `PluginBackend` implementing `ParamBackend` via `EngineHandle` + `GuiContext`. -- **`src/params.rs`** — Full nih-plug parameter set: global params + 8 slots × 10 stage types. - -### Stage Registration (`rustortion-ui/src/stages/mod.rs`) - -The `gui_stage_registry!` macro generates `StageType`, `StageConfig`, and `StageMessage` enums plus all boilerplate. Adding a new stage requires: -1. Add one line to the macro invocation -2. Create `rustortion-ui/src/stages/new_stage.rs` with config, message, and view implementations -3. Create `rustortion-core/src/amp/stages/new_stage.rs` implementing the `Stage` trait -4. Add i18n keys to EN and ZH_CN in `rustortion-ui/src/i18n/mod.rs` -5. Add slot params to `rustortion-plugin/src/params.rs` - -### Thread Model - -The JACK process callback (standalone) or nih-plug `process()` (plugin) runs on a real-time thread. The GUI communicates with the engine via crossbeam channels. Shared state (tuner data, peak meter) uses `ArcSwap` for lock-free reads. - -## Common Pitfalls - -- **JACK/PipeWire must be running** before `cargo run --release`. If JACK is not available the app will panic on startup. -- **Dev profile uses `opt-level = 1`** — benchmarks and performance comparisons must use `--release`. -- **The `gui_stage_registry!` macro** in `rustortion-ui/src/stages/mod.rs` generates boilerplate. Do not hand-write — add one line to the macro invocation instead. -- **Preset JSON format** — each preset is a JSON file in `~/.config/rustortion/presets/`. Structure: `{ "name": "...", "stages": [...], "ir_name": "...", "ir_gain": N, "pitch_shift_semitones": N, "input_filters": {...} }`. -- **IR files** are in `impulse_responses/` and `~/.config/rustortion/impulse_responses/`. Loading is async (off RT thread). -- **Clippy is strict** — CI runs `-D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery`. -- **iced_baseview** is a fork at `github.com/OpenSauce/iced_baseview`, upgraded to iced 0.14 crates.io. - -## Conventions - -- Rust edition 2024 -- Conventional commits: `feat:`, `fix:`, `refactor:`, `chore:`, etc. -- Changelog generated via `git-cliff` -- Standalone entry point: `rustortion-standalone/src/bin/gui.rs` -- Releases via `cargo-dist` (`.github/workflows/release.yml`, `dist-workspace.toml`) diff --git a/presets/Clean_Eb.json b/presets/Clean_Eb.json deleted file mode 100644 index 189b80a..0000000 --- a/presets/Clean_Eb.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "Clean Eb", - "description": null, - "author": null, - "stages": [ - { - "Compressor": { - "attack_ms": 1.0, - "release_ms": 100.0, - "threshold_db": -20.0, - "ratio": 4.0, - "makeup_db": 3.9000003 - } - }, - { - "Preamp": { - "gain": 1.1, - "bias": 1.4901161e-8, - "clipper_type": "Triode" - } - }, - { - "ToneStack": { - "model": "British", - "bass": 1.0500001, - "mid": 1.4, - "treble": 1.25, - "presence": 1.45 - } - }, - { - "MultibandSaturator": { - "low_drive": 0.099999994, - "mid_drive": 0.17999999, - "high_drive": 0.11, - "low_level": 1.0, - "mid_level": 1.54, - "high_level": 1.0, - "low_freq": 325.0, - "high_freq": 2850.0 - } - }, - { - "Level": { - "gain": 0.90000004 - } - }, - { - "Eq": { - "gains": [ - -8.6, - -7.0, - -3.3, - 0.0, - 0.0, - 0.0, - 0.0, - 2.8000002, - 3.6000001, - 1.6000001, - 3.1000001, - 3.2000003, - -0.29999983, - -4.9, - -2.9999998, - -4.2999997 - ] - } - }, - { - "Reverb": { - "room_size": 0.24, - "damping": 0.96, - "mix": 0.06 - } - }, - { - "Delay": { - "delay_ms": 300.0, - "feedback": 0.3, - "mix": 0.26 - } - } - ], - "ir_name": "Science Amplification/4x12/G12H-150/MD 421-U Brighter.wav", - "ir_gain": 0.34, - "pitch_shift_semitones": -1, - "input_filters": { - "hp_enabled": true, - "hp_cutoff": 117.0, - "lp_enabled": true, - "lp_cutoff": 7174.0 - } -} \ No newline at end of file diff --git a/presets/Djent_Eb.json b/presets/Djent_Eb.json deleted file mode 100644 index 723d339..0000000 --- a/presets/Djent_Eb.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "Djent Eb", - "description": null, - "author": null, - "stages": [ - { - "Preamp": { - "gain": 3.3, - "bias": 0.0, - "clipper_type": "ClassA" - } - }, - { - "ToneStack": { - "model": "Modern", - "bass": 0.90000004, - "mid": 1.2, - "treble": 1.1, - "presence": 0.95 - } - }, - { - "NoiseGate": { - "threshold_db": -20.0, - "ratio": 10.0, - "attack_ms": 1.4, - "hold_ms": 10.0, - "release_ms": 100.0 - } - }, - { - "Compressor": { - "attack_ms": 1.0, - "release_ms": 80.0, - "threshold_db": -14.0, - "ratio": 4.0, - "makeup_db": 18.5 - } - }, - { - "Preamp": { - "gain": 6.5, - "bias": 0.70000005, - "clipper_type": "Triode" - } - }, - { - "MultibandSaturator": { - "low_drive": 0.42, - "mid_drive": 0.59999996, - "high_drive": 0.64, - "low_level": 0.91999996, - "mid_level": 0.97999996, - "high_level": 0.97999996, - "low_freq": 413.0, - "high_freq": 2410.0 - } - }, - { - "Level": { - "gain": 0.25 - } - }, - { - "Eq": { - "gains": [ - -9.2, - -8.6, - -5.7, - -3.4999998, - -0.29999983, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -0.29999983, - -0.39999983, - -1.9999999, - -6.7 - ] - } - }, - { - "Reverb": { - "room_size": 0.32999998, - "damping": 0.39, - "mix": 0.089999996 - } - } - ], - "ir_name": "Science Amplification/4x12/G12H-150/SM57 Brighter.wav", - "ir_gain": 0.42, - "pitch_shift_semitones": -1, - "input_filters": { - "hp_enabled": true, - "hp_cutoff": 133.0, - "lp_enabled": true, - "lp_cutoff": 7469.0 - } -} \ No newline at end of file