docs: Faust effects guide with a doc-as-source-of-truth audio test#148
Open
petersalomonsen wants to merge 2 commits into
Open
docs: Faust effects guide with a doc-as-source-of-truth audio test#148petersalomonsen wants to merge 2 commits into
petersalomonsen wants to merge 2 commits into
Conversation
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>
Deploying webassemblymusic with
|
| Latest commit: |
d55ed08
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ad488305.webassemblymusic.pages.dev |
| Branch Preview URL: | https://docs-faust-effects-verified.webassemblymusic.pages.dev |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns the Faust effects cheat sheet into proper, verified documentation.
What's here
wasmaudioworklet/docs/effects.md— the effects guide, relocated from theuntracked
presentations/copy and linked from the docs index. CoversPattern A (channel effect via
effect =) and Pattern B (master effect inpostprocess()).wasmaudioworklet/e2e/effects-doc.spec.js— a documentation-as-regressiontest for Pattern B. It extracts the
postprocess()wiring and the Tapiirfield-settings code blocks straight out of
docs/effects.md, transpiles aTapiir effect in the browser, renders a note to WAV through the app's export
pipeline, and asserts the doc's two claims:
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
echo tail RMS = 0.015vsdry = 0.0002(~75x),note level identical in both renders.
delaySec = 0.0in the doc collapses the tail to0.0004and theecho-tail assertion fails — confirming the test is genuinely wired to the doc.
CI / notes for reviewers
npx playwright test --workers=1(
.github/workflows/main.yml), which serializes every spec — required becausethe sandbox specs share a single
NEAR_REPO_CONTRACT. This new spec is pickedup automatically (no file filter) and runs serially with the NEAR sandbox up,
so nothing needs changing for CI. (Locally,
npx playwright testdefaults toparallel, so run sandbox specs with
--workers=1.)ascoptimizeLevel-3 compilesplus two offline renders. That's the main trade-off.
Draft for review.
🤖 Generated with Claude Code