{"id":50888657,"url":"https://github.com/cucuwritescode/adac","last_synced_at":"2026-06-15T19:30:43.137Z","repository":{"id":351554646,"uuid":"1187318643","full_name":"cucuwritescode/adac","owner":"cucuwritescode","description":"Automatic Differentiable Audio Compilation: differentiable audio graphs to real-time DSP","archived":false,"fork":false,"pushed_at":"2026-06-14T12:31:12.000Z","size":566,"stargazers_count":4,"open_issues_count":12,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T16:22:00.871Z","etag":null,"topics":["audio-processing","compilers","ddsp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cucuwritescode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":null,"dco":null,"cla":null}},"created_at":"2026-03-20T15:34:05.000Z","updated_at":"2026-06-14T12:32:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cucuwritescode/adac","commit_stats":null,"previous_names":["cucuwritescode/flamo-rt","cucuwritescode/flamo_rt","cucuwritescode/rt-fdn","cucuwritescode/rt_fdn","cucuwritescode/adac"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cucuwritescode/adac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucuwritescode%2Fadac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucuwritescode%2Fadac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucuwritescode%2Fadac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucuwritescode%2Fadac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cucuwritescode","download_url":"https://codeload.github.com/cucuwritescode/adac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucuwritescode%2Fadac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34377872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-processing","compilers","ddsp"],"created_at":"2026-06-15T19:30:42.558Z","updated_at":"2026-06-15T19:30:43.132Z","avatar_url":"https://github.com/cucuwritescode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ADAC\n\n**Automatic Differentiable Audio Compilation**\n\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/licence-MIT-green.svg)](LICENSE)\n[![Tests](https://img.shields.io/badge/tests-200%20passing-brightgreen.svg)](#testing)\n![Status](https://img.shields.io/badge/status-beta-yellow.svg)\n\n*from differentiable audio research to efficient real-time DSP*\n\n\u003c/div\u003e\n\n---\n\n## the problem\n\nresearchers design and optimise audio processors in differentiable frameworks such as [FLAMO](https://github.com/gdalsanto/flamo), but deploying them as real-time plugins requires manual reimplementation. this is error-prone and creates a gap between research prototypes and usable tools. the worked example throughout is the feedback delay network (FDN), which exercises every part of the compiler.\n\n```\nbefore:   FLAMO model (PyTorch)  →  ???  →  real-time plugin\n                                     ↑\n                                manual rewrite\n\nafter:    FLAMO model (PyTorch)  →  adac  →  FAUST  →  plugin\n```\n\n## how it works\n\n```\n┌──────────────┐       ┌──────────────┐       ┌──────────────┐\n│    FLAMO     │  ───▶ │     JSON     │  ───▶ │    FAUST     │\n│    model     │  ◀─── │    config    │       │    code      │\n│  (PyTorch)   │       │              │       │   (.dsp)     │\n└──────────────┘       └──────────────┘       └──────────────┘\n       flamo_to_json() ──▶     json_to_faust() ──▶\n       json_to_flamo() ◀──\n         ╰───────────── flamo_to_faust() ──────────────╯\n```\n\nthe pipeline traverses a FLAMO model graph, extracts all parameters (delays, gains, matrices, filters), serialises them to a JSON intermediate representation, and generates valid FAUST DSP code. extraction is map-aware: matrix types with non-identity maps (orthogonal, hadamard, householder) serialise the effective matrix the model applies, with the raw trainable weights preserved for round-tripping. `json_to_flamo` reconstructs the original model from the config.\n\non top of the codegen core:\n\n- `HotReload` republishes the model to a running FAUST plugin during training, so you hear the optimisation while it runs\n- macro-controls (`rt60`, `dry_wet`, `pre_delay`) add performance knobs to the generated plugin without touching the trained parameters\n- `certify` computes a stability certificate for every feedback loop, written as `.cert.json` next to the `.dsp`\n- `export_juce` turns a config into an installed VST3/AU plugin in one call\n\n## installation\n\n```bash\npip install -e .\n```\n\nfor full FLAMO model support (requires PyTorch):\n\n```bash\npip install -e \".[full]\"\n```\n\nbuilding plugins additionally requires the [FAUST](https://faust.grame.fr) distribution and [JUCE](https://juce.com).\n\n## quick start\n\n```python\nimport adac\n\n#given a trained FLAMO model and sample rate\nfaust_code = adac.flamo_to_faust(model, fs=48000, name=\"MyReverb\")\n\n#write to file\nwith open(\"reverb.dsp\", \"w\") as f:\n    f.write(faust_code)\n```\n\nor use the two-step pipeline for inspection:\n\n```python\nconfig = adac.flamo_to_json(model, fs=48000, name=\"MyReverb\")\nfaust_code = adac.json_to_faust(config, controls={\"rt60\": True, \"dry_wet\": True})\n```\n\n### hear it while it trains\n\n```python\nlive = adac.HotReload(fs=48000, name=\"MyReverb\", controls={\"rt60\": True})\nfor step in range(n_steps):\n    loss = criterion(model(x), target)\n    loss.backward()\n    optimiser.step()\n    live.update(model)\nlive.update(model, force=True)\n```\n\nthe hot-reload CLAP plugin (FAUST interpreter plus file watcher) lives in `faust/architecture/clap/`. reloads take about 100 ms and knob positions survive them. full script: `examples/live_training.py`.\n\n### ship it\n\n```python\nadac.export_juce(\n    adac.flamo_to_json(model, fs=48000, name=\"MyReverb\"),\n    \"exported/\", name=\"MyReverb\",\n    controls={\"rt60\": True, \"dry_wet\": True, \"pre_delay\": True},\n    juce_modules=\"~/JUCE/modules\",\n    build=True,\n)\n```\n\none call: FAUST generation, stability certificate, JUCE project, release build, install into the user plugin folders (macOS). the export refuses to build a model whose certificate says `unstable` or `not-certified`; pass `strict=False` to override. full script: `examples/export_plugin.py`.\n\n### certify\n\n```python\ncert = adac.certify(config)\nprint(cert[\"verdict\"])\n```\n\nthe criterion is small-gain: the product of per-element spectral norms around each feedback loop must stay below one at every frequency, evaluated on the parameter values as emitted (single precision). verdicts are `certified-stable`, `marginally-stable`, `indeterminate`, `not-certified`, `unstable`. a lossless prototype is marginally stable; with the `rt60` control it is certified at any knob position.\n\n## equivalence\n\ngenerated FAUST matches FLAMO sample-exactly, direct paths included. the energy decay of the compiled plugin follows the FLAMO reference throughout, and the underlying impulse responses agree to within single-precision arithmetic noise. all four stereo paths match identically; the suite pins them.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"plots/edc_match.png\" width=\"55%\"\u003e\n\u003c/p\u003e\n\nthe rt60 macro-control on the compiled plugin, measured by Schroeder integration, follows the ideal decay for the slider value:\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"plots/rt60_validation.png\" width=\"55%\"\u003e\n\u003c/p\u003e\n\nregenerate the figures with `python examples/make_plots.py`.\n\n## supported modules\n\n| FLAMO module | FAUST output | description |\n|---|---|---|\n| `parallelDelay` | `@(n)` / `de.fdelay` | integer or fractional sample delays |\n| `Gain` / `Matrix` | sum-of-products function | mixing matrices (hoisted, map-aware) |\n| `HouseholderMatrix` | sum-of-products function | emitted as the effective matrix |\n| `parallelGain` | `*(g)` | per-channel diagonal gains |\n| `parallelSOSFilter` | `fi.tf2(...)` | cascaded biquad filters |\n| `Series` | `:` | sequential composition |\n| `Parallel` | `,` / `:\u003e` | side-by-side or summing |\n| `Recursion` | `~` | feedback loops (FDN core) |\n| `Biquad` / `SVF` | `fi.tf2` / `fi.svf.*` | single-channel filters |\n| `Shell` | *(unwrapped)* | FFT wrapper skipped |\n\n## testing\n\n```bash\n#unit tests (no external dependencies)\npytest tests/ -q --ignore=tests/integration\n\n#integration tests (requires flamo venv + faust compiler)\npytest tests/integration/ -v\n```\n\n200 unit tests validate the full pipeline: map-aware parameter extraction, delay quantisation, SOS normalisation, gain classification, graph traversal, code generation, macro-control wiring, multichannel arities, hot-reload publishing, certificate verdicts, and export orchestration.\n\nintegration tests compare impulse responses between FLAMO (frequency domain) and generated FAUST (time domain) sample-by-sample.\n\n## project structure\n\n```\nsrc/adac/\n  codegen/\n    flamo_to_json.py     parameter extraction and graph traversal\n    json_to_faust.py     FAUST code generation and macro-controls\n    json_to_flamo.py     model reconstruction from JSON config\n    flamo_to_faust.py    convenience wrapper (both steps)\n  hotreload.py           training-time live publishing\n  certificate.py         small-gain stability certificate\n  export.py              JUCE plugin export\nexamples/\n    live_training.py\n    export_plugin.py\n    make_plots.py\ntests/\n    test_flamo_to_json.py\n    test_json_to_faust.py\n    test_flamo_to_faust.py\n    test_param_extraction.py\n    test_hotreload.py\n    test_certificate.py\n    test_export.py\n    integration/\n        test_ir_comparison.py\n        generate_flamo_ir.py\n```\n\n## related projects\n\n- [FLAMO](https://github.com/gdalsanto/flamo) — differentiable audio processing framework\n- [pyFDN](https://github.com/artificial-audio/pyFDN) — python feedback delay networks\n- [FAUST](https://faust.grame.fr/) — functional audio stream\n\n## licence\n\nMIT — see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucuwritescode%2Fadac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcucuwritescode%2Fadac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucuwritescode%2Fadac/lists"}