feat: read, play and emit named wavetables - #9
Merged
Conversation
Deckard could not read a `wave` line. The statement originated in tish-gba and deck-player added its own copy, but the reference host never had one — so a `.deck` with a named table loaded with "unexpected top-level: wave", and the DMG wave channel offered three hardcoded shapes and nothing else. `wave` is core grammar now (spacedevin/deck#16), which resolves both the hex and `harmonics` spellings to 32 levels before Deckard sees them. What was missing here is the rest of the path: - the project model holds the tables, keyed by name - Apply collects them and points each channel at the table its `wave_shape` names; a UI knob turn arrives as a one-track `.deck` fragment through the same path, so the binding stays current when the shape is changed by hand - the DMG wave channel plays a named table in preference to a built-in shape, which is the order the GBA bake uses - the Wave selector lists the song's tables instead of only Saw/Square/Sine Emit writes the tables back, and writes a `harmonics` line AS harmonics rather than flattening it to 32 digits. That is the whole reason the parser keeps the source spelling: a save should not throw away what the author wrote. Only tables a channel actually names are emitted, or a project would grow a dead `wave` line every time it loaded a file.
The released language package, where `wave` is core grammar — which is what makes this branch work against a real install rather than a linked build. All 12 wavetable tests pass against the published package, and the existing suites are unchanged.
spacedevin
marked this pull request as ready for review
August 27, 2026 23:47
Owner
Author
|
Unblocked and out of draft — on the released Everything now verifies against a real install rather than a linked local build:
|
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.
Deckard could not read a
waveline. The statement originated in tish-gba, and deck-player later added its own copy, but the reference host never had one — so a.deckcarrying a named table failed to load withunexpected top-level: wave, and the DMG wave channel offered three hardcoded shapes and nothing else. There was no way to author a wavetable here at all.waveis core grammar now, which resolves both spellings to 32 levels before Deckard sees them:What this adds
mode/harmonics/hexalongsidelevels.wave_shapenames. A UI knob turn arrives as a one-track.deckfragment through this same path, so the binding stays correct when the shape is changed by hand rather than only on load.GameBoyDmgplays a named table in preference to the built-in shapes — the samenamed_waves.get(wave_shape).unwrap_or_else(built_in)order the GBA bake uses. Levels are already on the 16-level grid wave RAM holds, so unlike the built-ins they need no quantization step.harmonicsline as harmonics rather than flattening it to 32 digits. That is the whole point of the parser keeping the source spelling: a save should not throw away what the author wrote. Only tables a channel actually names are emitted, or a project would accumulate a deadwaveline every time it loaded a file.Verification
New
test/wavetables.tish(wired intotest:js), 12 assertions covering: both spellings collected,harmonicsresolving to the same levels as its hex literal, channel binding,harmonicssurviving emit unflattened, hex emitting as hex, unused tables not emitted, a full round trip preserving levels and mode, and a built-in shape name binding no table.Existing suites unchanged:
PASS=516,279,278,52,13,12,11,7, all withFAIL=0.Note this repo's
originis an HTTPS URL, so the branch was pushed over SSH.