Skip to content

Commit 2404322

Browse files
authored
feat: wav (#20)
1 parent 187923e commit 2404322

17 files changed

Lines changed: 983 additions & 33 deletions

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ audio-free; everything that list excludes lives in `packages/player/`, which has
2424
clamping, no defaults, no range checks. Those are host policy and the hosts genuinely differ.
2525
- Format helpers (`formatTplBeat`, `formatTplFloat`)
2626
- Scale root/mode vocabulary
27-
- Bar selectors + Euclidean step fill + wavetables (`wave`, including the `harmonics` fill)
27+
- Bar selectors + Euclidean step fill + wavetables (`wave`, including the `harmonics`, `levels` and
28+
`shape` fills)
2829
- Empty registries: generator id aliases, param key aliases, macros, gen_block dialects, body-line
2930
dialects, host top-level statements
3031
- Highlight classification (`classifyLine` / keyword sets)

conformance/013-wave.expected.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
"name": "organ_hex",
102102
"mode": "hex",
103103
"harmonics": null,
104+
"shape": null,
105+
"duty": null,
104106
"hex": "8beffecbbbbaa9888776554444310014",
105107
"levels": [
106108
8,
@@ -147,6 +149,8 @@
147149
0.33,
148150
0.2
149151
],
152+
"shape": null,
153+
"duty": null,
150154
"hex": null,
151155
"levels": [
152156
8,
@@ -190,6 +194,8 @@
190194
"harmonics": [
191195
1
192196
],
197+
"shape": null,
198+
"duty": null,
193199
"hex": null,
194200
"levels": [
195201
8,
@@ -237,6 +243,8 @@
237243
0,
238244
0.2
239245
],
246+
"shape": null,
247+
"duty": null,
240248
"hex": null,
241249
"levels": [
242250
8,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# The two spellings that make `wave` exhaustive. `harmonics` can only reach tables whose partials
2+
# are all in sine phase, so on its own it leaves hand-tuned curves with no readable form. `levels`
3+
# closes that: it is the wave RAM in decimal, so every table hex can hold, it can hold too.
4+
#
5+
# `pure_lev`, `pure_hex` and `pure_harm` MUST resolve to identical `levels` — the same equality
6+
# 013-wave pins for `harmonics`, now pinned across all three notations. `shape` is the third form:
7+
# the classic waveform names, resolved here rather than guessed at by each host, which is why
8+
# `sq_shape` and `sq_duty` must also agree, and `round` — `shape sine` — must land on the same table
9+
# as `pure_harm`, since one harmonic IS a sine.
10+
#
11+
# One wave track only: the LR35902 has a single wave channel, and the GBA profile lists this case as
12+
# mustAccept, so it has to stay inside that subset.
13+
deck 1
14+
bpm 100
15+
16+
wave pure_harm harmonics 1
17+
wave pure_hex 89acdeefffeedca98653211000112356
18+
wave pure_lev levels 8 9 10 12 13 14 14 15 15 15 14 14 13 12 10 9 8 6 5 3 2 1 1 0 0 0 1 1 2 3 5 6
19+
20+
wave sq_shape shape square
21+
wave sq_duty shape pulse duty 50
22+
wave thin shape pulse duty 12.5
23+
wave ramp shape saw
24+
wave peak shape triangle
25+
wave round shape sine
26+
27+
track Wave id wv gen gameBoyDmg
28+
gen type wave wave_shape pure_lev vol 15
29+
note 48 0 2 v 110
30+
31+
track Lead id lead gen gameBoyDmg
32+
gen type pulse duty 50 vol 12
33+
note 60 0 1 v 100

0 commit comments

Comments
 (0)