Skip to content

docs: Faust effects guide with a doc-as-source-of-truth audio test#148

Open
petersalomonsen wants to merge 2 commits into
masterfrom
docs/faust-effects-verified
Open

docs: Faust effects guide with a doc-as-source-of-truth audio test#148
petersalomonsen wants to merge 2 commits into
masterfrom
docs/faust-effects-verified

Conversation

@petersalomonsen

@petersalomonsen petersalomonsen commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Turns the Faust effects cheat sheet into proper, verified documentation.

What's here

  • wasmaudioworklet/docs/effects.md — the effects guide, relocated from the
    untracked presentations/ copy and linked from the docs index. Covers
    Pattern A (channel effect via effect =) and Pattern B (master effect in
    postprocess()).

  • wasmaudioworklet/e2e/effects-doc.spec.js — a documentation-as-regression
    test for Pattern B. It extracts the postprocess() wiring and the Tapiir
    field-settings code blocks straight out of docs/effects.md
    , transpiles a
    Tapiir effect in the browser, renders a note to WAV through the app's export
    pipeline, and asserts the doc's two claims:

    1. with the field settings, an audible echo tail appears, and
    2. with the defaults, it does not.

    Because the test reads the snippets from the markdown, the doc and the test
    cannot drift apart — if the wiring or Tapiir field names in the doc stop
    matching what the transpiler produces, the test fails.

Verified both ways

  • Passes with the current doc: echo tail RMS = 0.015 vs dry = 0.0002 (~75x),
    note level identical in both renders.
  • Setting delaySec = 0.0 in the doc collapses the tail to 0.0004 and the
    echo-tail assertion fails — confirming the test is genuinely wired to the doc.

CI / notes for reviewers

  • Serialization is already handled. CI runs npx playwright test --workers=1
    (.github/workflows/main.yml), which serializes every spec — required because
    the sandbox specs share a single NEAR_REPO_CONTRACT. This new spec is picked
    up automatically (no file filter) and runs serially with the NEAR sandbox up,
    so nothing needs changing for CI. (Locally, npx playwright test defaults to
    parallel, so run sandbox specs with --workers=1.)
  • Runtime: this spec is slow (~6-7 min) — two asc optimizeLevel-3 compiles
    plus two offline renders. That's the main trade-off.

Draft for review.

🤖 Generated with Claude Code

Move the Faust effects cheat sheet into docs/effects.md (linked from the
docs index) as proper example documentation: Pattern A (channel effect via
`effect =`) and Pattern B (master effect in `postprocess()`).

Add e2e/effects-doc.spec.js, which keeps Pattern B honest: it extracts the
postprocess() wiring and the Tapiir field-settings code blocks *from
docs/effects.md*, transpiles a Tapiir effect in the browser, renders a note
to WAV through the app's export pipeline, and asserts an audible echo tail
appears with the settings (echo tail RMS 0.015 vs dry 0.0002, ~75x) and not
with the defaults. If the wiring or field names in the doc drift from what
the transpiler produces, the test fails.

Verified both ways: passes with the current doc; setting delaySec=0 in the
doc makes the echo-tail assertion fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploying webassemblymusic with  Cloudflare Pages  Cloudflare Pages

Latest commit: d55ed08
Status: ✅  Deploy successful!
Preview URL: https://ad488305.webassemblymusic.pages.dev
Branch Preview URL: https://docs-faust-effects-verified.webassemblymusic.pages.dev

View logs

effects-doc.spec.js runs before faust-save-then-play-bug.spec.js (alpha
order, --workers=1) and pushed faust/simplesynth.ts to the shared NEAR
sandbox repo — exactly the file faust-save-then-play needs ABSENT at clone
time, so its "first play fails (no .ts yet)" precondition broke in CI.

Use a unique voice name (echovoice) so this spec's pushes never collide.
It writes only .ts (no .dsp), so faust-editor's .dsp-list assertions are
unaffected. Verified: both specs pass run serially on a fresh sandbox.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@petersalomonsen petersalomonsen marked this pull request as ready for review June 14, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant