AquaSynth/README.md

88 lines
3.2 KiB
Markdown
Raw Normal View History

2026-05-16 05:49:44 +01:00
# AquaSynth
2026-05-08 03:00:53 +01:00
2026-05-16 05:49:44 +01:00
C# front-end for AquaSynth patch scripts. It parses the AquaSynth patch DSL
2026-05-08 03:00:53 +01:00
into a serializable patch graph, emits Faust `.dsp`, and can ask an installed
Faust compiler to generate backend code such as C#, C++, C, or Rust.
2026-05-16 05:49:44 +01:00
This repo is the C# bridge for AquaSynth/Vortice-land. Rust remains the reference
2026-05-08 03:00:53 +01:00
lab; this project is the tool that lets the engine script Faust without dragging
2026-05-16 05:49:44 +01:00
the AquaSynth-rs crate into the room by the ankle.
2026-05-08 03:00:53 +01:00
## Run
```powershell
dotnet test
```
DX7 reference-render tests use `dexed-py` when a Python with `dexed` and
2026-05-16 05:49:44 +01:00
`numpy` is available. Set `AQUASYNTH_DX7_PYTHON` to that interpreter to force a
specific runtime; otherwise the tests skip the render path and still parse the
vendored public-domain fixture.
2026-05-14 23:31:33 +01:00
ZynAddSubFX is pinned as a GPL test/development reference under
`external/zynaddsubfx`. Initialize it with:
```powershell
git submodule update --init --recursive
```
2026-05-16 05:49:44 +01:00
That source is a parity oracle only. AquaSynth does not ship Zyn code, link it
from `AquaSynth.Dsl`, or treat it as runtime machinery.
2026-05-14 23:31:33 +01:00
2026-05-13 00:19:02 +01:00
## Package Boundary
2026-05-16 05:49:44 +01:00
Downstream consumers should pin this library as an `AquaSynth.Dsl` NuGet
package, not use it as a live project reference. Breaking synth-library work
should happen here freely, then consumers should intentionally update only after
a new package version is packed and tested.
2026-05-13 00:19:02 +01:00
```powershell
2026-05-16 05:49:44 +01:00
dotnet pack src\AquaSynth.Dsl\AquaSynth.Dsl.csproj -c Release
2026-05-13 00:19:02 +01:00
```
2026-05-14 23:31:33 +01:00
The test suite verifies that development fixtures, Python render helpers,
external reference synth sources, and SysEx banks do not ship in
2026-05-16 05:49:44 +01:00
`AquaSynth.Dsl.nupkg`.
2026-05-08 03:00:53 +01:00
## Shape
- `PatchScript.Parse(script)` lowers terse script into `SynthPatch`.
- `FaustEmitter.Emit(patch)` emits Faust source.
- `FaustCompiler.ValidateAsync(source)` compile-checks with Faust when present.
- `FaustCompiler.CompileAsync(source, options)` writes generated backend code.
2026-05-12 22:10:02 +01:00
- `BuiltInScripts.ReferenceScripts()` carries readable SFXR, BFXR-flavored,
2026-05-12 22:38:24 +01:00
808, FM bell, wobble bass, and advanced layered patches. They are stable
references for testing and for judging whether the DSL can express useful
sound designs cleanly.
2026-05-08 10:34:07 +01:00
- `SfxrParams`, `PatchScriptScoring`, `AudioAnalyzer`, and `Presets` carry the
2026-05-16 05:49:44 +01:00
reusable AquaSynth-rs-side analysis, scoring, SFXR, and preset tools.
2026-05-08 03:00:53 +01:00
Faust `2.85.5` supports `-lang csharp`, so the intended hot path is:
```csharp
2026-05-12 22:10:02 +01:00
var patch = PatchScript.Parse("""
voice
wave=saw
freq=55
gain=0.2
sustain=0.5
decay=0.2
""");
2026-05-08 03:00:53 +01:00
var export = FaustEmitter.Emit(patch, new FaustExportOptions("bass"));
await FaustCompiler.CompileAsync(
export.Source,
new FaustCompileOptions(FaustTargetLanguage.CSharp, "Generated/Bass.cs"));
```
## Status
2026-05-12 22:10:02 +01:00
The current slice covers the modular graph surface needed by the reference
2026-05-08 10:34:07 +01:00
scripts, SFXR atoms, script scoring, audio comparison, presets, Faust emission,
and installed Faust validation. Migration coverage is tracked in
2026-05-08 10:21:32 +01:00
[`docs/migration-checklist.md`](docs/migration-checklist.md), because leaving
important things behind in the old repo would be a very efficient way to become
our own haunted house.
2026-05-12 22:53:22 +01:00
Reference-driven DSL growth is tracked in
[`docs/reference-synth-roadmap.md`](docs/reference-synth-roadmap.md). Agent
handoff state lives in [`state/spine.yaml`](state/spine.yaml).