Commit 23e7106
authored
fix(player): run gen_block through the language's dialect dispatch (#22)
* fix(player): run gen_block through the language's dialect dispatch
`Apply` stored the raw `gen_block` — `{ generatorId, lines }` — straight onto
`ch.generatorSpec`, so a dialect registered through `registerGenBlockDialect` was never
consulted. The language has the extension point (`parseGenBlock` dispatches to the
registered handler and falls back to a raw shape when there is none); the player just
wasn't calling it.
The effect is silent: a voice that needs the parsed graph, like `matrixFm` or `patch`,
finds `generatorSpec.graph` empty, falls back to a default tone, and plays something
that is not the patch in the file. No error, no substitution recorded.
Additive and non-breaking. `generatorId` and `lines` stay where they were; `kind`,
`tplHeaderId` and `version` are now populated, and `graph` appears when a dialect
provides one. Hosts registering no dialect see the same shape as before.
Note this is necessary but not sufficient. deck-player and @spacedevin/deck-synths each
inline their own copy of @spacedevin/deck — the player against the monorepo working copy,
the synths against 1.5.3 from npm — so they hold two separate dialect registries and a
dialect registered in one is invisible to the other. Deduplicating the language package
is what makes this fix reach across hosts.
* docs(player): the bake does not agree on `square` yet
The comment added with the waveform fallback fix claimed `square` ignores `duty` "on
both sides". It does not. deckpack.rs `pcm_table` has no `square` arm, so the bake falls
through to pulse and honours `duty` — `gen waveform square duty 25` is 50% in the browser
and 25% in the ROM. Say so rather than asserting a parity that isn't there.1 parent 6171ef2 commit 23e7106
2 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
577 | 593 | | |
578 | 594 | | |
579 | 595 | | |
| |||
0 commit comments