Repository navigation
Ship the tracker and fourths keymaps (keyboard-instrument.md chunk 3) - #181
Conversation
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 5m 15s
This pull request ships the two other built-in keymaps the keyboard-instrument plan chose, tracker and fourths, as YAML files in keymaps/, so field keys --keymap tracker and --keymap fourths resolve by bare name. The files are the text that chunk 1's schema tests carried as inline fixtures. Those tests now read the shipped files, and a new test resolves and loads every built-in. docs/keys.md gains a section on both keymaps, and the plan records chunk 3 as built in §11. Criteria 28 and 29 ran in a pseudo-terminal through the real helper, and a run at a real keyboard is left for later.
0 finding threads: 0 resolved, 0 open
Covered 6 of 6 changed files; none are generated.
The full pnpm test suite was not run, because the scratch checkout has no native build for the daemon tests. The focused keymap, schema, and print tests ran instead. Criteria 28 and 29 were not run here, because they need a terminal session and a virtual MIDI source. The linux CI job was still pending when this review was published.
Suggestions
docs/projects/keyboard-instrument/readme.md:976: add a "still owed" line to §11 for criteria 28 and 29 at a real keyboard, as §9.3 and §10.4 do for their chunks. The pull request body says real keys are still owed "as plan §9.3 says", but §9.3 names only criteria 1 to 20, so the plan never records the debt for these two.docs/projects/keyboard-instrument/readme.md:988: "where the tables above say" points at tables that §11 does not have, because §11 holds one table. Name the notes instead, such as C3 onKeyZin both diagrams and C4 onKeyQandCommaintracker.
What was checked
- Every
trackerbinding, by hand. The white keysZ X C V B N M , . /play offsets 0, 2, 4, 5, 7, 9, 11, 12, 14, and 16, andQ W E R T Y U I O P [ ]play 12 to 31. Black keys sit only where a piano has them, soF,K,4,8, and-are unbound. That is 37 positions and 32 distinct notes from C3 (48) to G5 (79), withKeyZ48,KeyQandComma60, andKeyI72. - The
fourthsgrid, by hand. Each offset is the key's column index plus 5 times its row index, over rows of 10, 11, 12, and 12 keys. That gives 27 distinct notes from 48 to 74, withKeyZ48,KeyA53,KeyQ58, andDigit163.KeyZ KeyB KeyDplay 48, 52, and 55, andKeyX KeyN KeyFplay 49, 53, and 56, as criterion 29 expects. - Both diagrams. Both keymaps were rendered through
loadKeymapandprintKeymap, the two calls--printmakes. They match the hand results and the pull request's Testing section, including the line that listsSpaceand the arrows. - The shipped files are the fixtures. Both files are byte-identical to the base's
TRACKERandFOURTHSstrings, as §11 says, andfourths.yamlmatches the example in §2.4. - The tests read the shipped files. Changing
tracker'sKeyIfrom 24 to 23 fails the tracker test, with 31 distinct notes where 32 are expected. - Every reader of
keymaps/.builtinKeymapNames()feeds only the unknown-name error and the tests. The error test's pattern still matches with three names. - The docs. The new section of
docs/keys.mdmatches the files: C3 onZin both keymaps, transpose ±12 and velocity ±20 on the arrows, and sustain held onSpace. No other doc namesmusical-typingas the only built-in. In §11, the lettersz b s,x k t, anduareKeyZ KeyB KeyD,KeyX KeyN KeyF, andKeyIunder Colemak, so the criteria rows name the right positions. - Commands.
pnpm typecheckexits 0.vitest run src/schema/keymap.test.ts src/keys/keymap.test.ts src/keys/print.test.tspasses 27 tests.project checkreports the plans valid. The plan staysin-progress, so no readiness gate applies.
…ll owes Review of #181 found that §11's diagram row pointed at tables the section does not have, and that §11 never recorded criteria 28 and 29 at a real keyboard as owed, as §9.3 and §10.4 do for theirs.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 0m 41s
This pull request ships the two other built-in keymaps the keyboard-instrument plan chose, tracker and fourths, as YAML files in keymaps/, so field keys --keymap tracker and --keymap fourths resolve by bare name. The files are the text that chunk 1's schema tests carried as inline fixtures. Those tests now read the shipped files, and a new test resolves and loads every built-in. docs/keys.md describes both keymaps, and the plan records chunk 3 as built in §11. Since the review of 57c18fb, one commit changes only §11: its diagram row names the notes the diagrams show, and a new line records criteria 28 and 29 at a real keyboard as still owed.
0 finding threads: 0 resolved, 0 open
Covered 6 of 6 changed files; none are generated.
The new commit changes only docs/projects/keyboard-instrument/readme.md. Every other file is byte-identical to 57c18fb, so the typecheck and the focused tests that ran there cover this head, and they were not run again. The full pnpm test suite was not run, because the scratch checkout has no native build for the daemon tests. Criteria 28 and 29 were not run here, because they need a terminal session and a virtual MIDI source.
What was checked
- Both earlier suggestions are addressed. The diagram row in §11 no longer points at tables the section lacks. It names C3 under
KeyZin both diagrams, C4 underKeyQandCommaintracker, and F3, A#3, and D#4 underKeyA,KeyQ, andDigit1infourths. Those are MIDI 48, 60, 53, 58, and 63, which match the diagrams rendered at57c18fbthroughloadKeymapandprintKeymap, the calls--printmakes. The new "Still owed" line records criteria 28 and 29 at a real keyboard in Ghostty and iTerm2, and it describes §9.3 correctly as covering criteria 1 to 20. - Every
trackerbinding, by hand. The white keysZ X C V B N M , . /play offsets 0, 2, 4, 5, 7, 9, 11, 12, 14, and 16, andQ W E R T Y U I O P [ ]play 12 to 31 on the white notes. Black keys sit only where a piano has them. That is 37 positions and 32 distinct notes from C3 (48) to G5 (79), withKeyZ48,KeyQandComma60, andKeyI72. - The
fourthsgrid, by hand. Each offset is the key's column index plus 5 times its row index, over rows of 10, 11, 12, and 12 keys. That gives 27 distinct notes from 48 to 74, withKeyZ48,KeyA53,KeyQ58, andDigit163.KeyZ KeyB KeyDplay 48, 52, and 55, andKeyX KeyN KeyFplay 49, 53, and 56, as criterion 29 expects. - The shipped files are the fixtures. Both files are byte-identical to the base's
TRACKERandFOURTHSstrings, and changingtracker'sKeyIfrom 24 to 23 fails the tracker test. - The docs. The new section of
docs/keys.mdmatches the files, and no other doc namesmusical-typingas the only built-in. - Commands. At
57c18fb, whose code this head shares:pnpm typecheckexits 0, andvitest run src/schema/keymap.test.ts src/keys/keymap.test.ts src/keys/print.test.tspasses 27 tests. At this head,project checkreports the plans valid. The plan staysin-progress, so no readiness gate applies.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 1m 03s
This pull request ships the two other built-in keymaps the keyboard-instrument plan chose, tracker and fourths, as YAML files in keymaps/, so field keys --keymap tracker and --keymap fourths resolve by bare name. The schema tests that carried both as inline fixtures now read the shipped files, docs/keys.md describes both keymaps, and the plan records chunk 3 as built in §11, including what is still owed. This head rebases the same two commits onto keys/chunk-2 after chunks 1 and 2 gained fixes. This pull request's own diff is unchanged, apart from one hunk header in docs/keys.md that moved from line 194 to line 197.
0 finding threads: 0 resolved, 0 open
Covered 6 of 6 changed files; none are generated.
The full pnpm test suite was not run, because the scratch checkout has no native build for the daemon tests. Criteria 28 and 29 were not run here, because they need a terminal session and a virtual MIDI source.
What was checked
- This pull request's own diff is the one reviewed at
a4a55a1. The diff from the new merge base to this head matches the diff from the old merge base toa4a55a1line for line, apart from that one hunk header. - The base changes these keymaps depend on. The schema now checks named grid rows for a position given twice, and
fourthsnames four rows that share no key, so it still validates.print.tsonly exportssigned(). The session change turns off toggled controllers at quit, panic, and reload, and neither keymap binds a toggle. The base's edits todocs/keys.mdand the plan only spell out the monitor command's path, and they do not touch the sections this pull request adds. - Both diagrams, again. Both keymaps were rendered at this head through
loadKeymapandprintKeymap, the two calls--printmakes. The output is identical to the earlier heads:trackerhas 37 positions and 32 distinct notes from 48 to 79, andfourthshas 27 distinct notes from 48 to 74. The notes §11 names underKeyZ,KeyQ,Comma,KeyA, andDigit1match. - Commands at this head.
pnpm typecheckexits 0.vitest run src/schema/keymap.test.ts src/keys/keymap.test.ts src/keys/print.test.ts src/keys/session.test.tspasses 49 tests.project checkreports the plans valid. The plan staysin-progress, so no readiness gate applies.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 0m 55s
This pull request ships the two other built-in keymaps the keyboard-instrument plan chose, tracker and fourths, as YAML files in keymaps/, so field keys --keymap tracker and --keymap fourths resolve by bare name. The schema tests that carried both as inline fixtures now read the shipped files, docs/keys.md describes both keymaps, and the plan records chunk 3 as built in §11, including what is still owed. This head rebases the same two commits onto keys/chunk-2 after more fixes to chunks 1 and 2. This pull request's own diff is unchanged, apart from two hunk headers: one in docs/keys.md moved from line 197 to line 200, and one in the plan moved from line 972 to line 989.
0 finding threads: 0 resolved, 0 open
Covered 6 of 6 changed files; none are generated.
The full pnpm test suite was not run, because the scratch checkout has no native build for the daemon tests. Criteria 28 and 29 were not run here, because they need a terminal session and a virtual MIDI source.
What was checked
- This pull request's own diff is the one reviewed at
f2b7c2b. The diff from the new merge base to this head matches the diff from the old merge base tof2b7c2bline for line, apart from those two hunk headers. - The base changes since that review. They touch the voice host,
src/commands/keys.ts, and the docs. None of them changes the keymap schema, the loader, the print code, the session, orkeymaps/. The newdocs/keys.mdtext resets a toggled controller on quit, panic, and reload, and both new keymaps hold sustain rather than toggle it, so their section still reads true. The plan's additions all fall in §10.2, so §11 still follows §10 and makes no claim that the additions affect. - Both diagrams, again. Both keymaps were rendered at this head through
loadKeymapandprintKeymap, the two calls--printmakes. The output is byte-identical to the output atf2b7c2b:trackerhas 37 positions and 32 distinct notes from 48 to 79, andfourthshas 27 distinct notes from 48 to 74. - Commands at this head.
pnpm typecheckexits 0.vitest run src/schema/keymap.test.ts src/keys/keymap.test.ts src/keys/print.test.ts src/keys/session.test.tspasses 49 tests.project checkreports the plans valid. The plan staysin-progress, so no readiness gate applies.
keymaps/tracker.yaml plays the layout trackers use, two piano octaves on the bottom and top rows; keymaps/fourths.yaml is an isomorphic grid with a semitone per key and a perfect fourth per row. Both were chunk 1's schema fixtures, and the tests now read the shipped files. docs/keys.md describes them, and the plan records chunk 3 as built in §11, including criteria 28 and 29 played through CoreMIDI under a ColemakC layout.
…ll owes Review of #181 found that §11's diagram row pointed at tables the section does not have, and that §11 never recorded criteria 28 and 29 at a real keyboard as owed, as §9.3 and §10.4 do for theirs.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 0m 32s
This pull request ships the two other built-in keymaps the keyboard-instrument plan chose, tracker and fourths, as YAML files in keymaps/, so field keys --keymap tracker and --keymap fourths resolve by bare name. The schema tests that carried both as inline fixtures now read the shipped files, docs/keys.md describes both keymaps, and the plan records chunk 3 as built in §11, including what is still owed. This head rebases the same two commits onto keys/chunk-2, whose only change since the last review is a rewrapped paragraph in docs/keys.md. This pull request's own diff is unchanged, hunk headers included.
0 finding threads: 0 resolved, 0 open
Covered 6 of 6 changed files; none are generated.
No TypeScript changed since the review of a972089. Every file outside docs/keys.md is byte-identical between the two heads, so the typecheck and the keymap and session tests that passed at a972089 cover this head, and they were not run again. The full pnpm test suite and criteria 28 and 29 were not run, for the reasons that review gave.
What was checked
- This pull request's own diff is the one reviewed at
a972089. The diff from the new merge base to this head matches the diff from the old merge base toa972089line for line, hunk headers included. - The only base change since that review. One commit rewraps the paragraph in
docs/keys.mdthat describes reloading a keymap, below the section this pull request adds. Between the two heads, nothing else differs: no other file in the base, and no line of this pull request. - Commands at this head.
project checkreports the plans valid, and the plan staysin-progress, so no readiness gate applies. Ata972089, whose code this head shares:pnpm typecheckexited 0, and the schema, keymap, print, and session test files passed 49 tests.
…rd-instrument.md chunk 4) (#182) `field keys` lets you play an instrument, but until now nothing you played could be kept: the moment you found a part, it was gone. This last chunk of the keyboard-instrument plan, stacked on #181, records it. Give a track's record entry an instrument, run `field record` against the song as you would for a vocal, and the take lands as the notes you played. The build then renders those notes through the instrument, where you played them in the song. The design is the one the plan's §12 settled, building on the audio recording already in Field rather than beside it. A MIDI take is a transaction like an audio take, lands in the same `takes.yaml` with `chosen`, is placed by the same arithmetic, and is picked with the same `field choose`. It differs only where it must. The daemon arms for MIDI instead of an input: it opens every MIDI source and stamps each message on the audio callback's clock, so the take lines up with the song as an audio take does. The take lands as a small text file of notes, `audio/<track>/<take>.notes.yaml`, pinned in the song's ledger, and its row carries `sources` where an audio row carries `device` and `input`. Its latency is the output latency alone, because you play in time with what you hear. The build mints a `voice-render` node for the chosen take, which runs Field's own `sc/voice-render.scd`. That script plays the instrument's voice from the notes with `sc/voicer.scd`, the same voicing `field keys` plays live, so sustain and pitch bend sound as they did while you played. The notes file, the instrument, and both scripts key the cache, so editing the instrument re-renders every take recorded for it. The kinds stay apart. A take of the other kind than its entry records will not land, and `field check` treats a mismatch or an instrument with no program as an error. `field record` refuses `--input`, `--device`, and `--loop` on a MIDI entry before it touches the daemon. The canonical spelling is `instrument:` on its own line under `record:`, which is what `field fmt` writes. The daemon's half came from a parallel branch as three commits, `c9ce60f`, `6341242`, and `9025aad`: arming for MIDI, the `take.midi.ndjson` transaction with recovery, and the protocol with its daemon tests and docs. `docs/keys.md` gains "Record what you play"; `tracks.md`, `project-model.md`, `build-graph.md`, `architecture.md`, and `audio-engine.md` describe the entry, the take, the render node, and the capture. The plan records the chunk as built in §13, with criteria 30 to 36. The criteria that need ears are still owed, so the plan stays `in-progress`. ## Testing From the repository root of this branch, with the native helper built (`pnpm build:native`) and SuperCollider installed: ```sh pnpm typecheck FIELD_AUDIOD=$PWD/native/audiod/build/field-audiod_artefacts/Release/field-audiod pnpm test project check ``` You should see the typecheck pass, `929 passed | 1 skipped`, and `Project plans are valid.` The skip is the no-MIDI-source refusal, which runs only where there is no MIDI service. The tests that cover this chunk: - `src/commands/land.test.ts` (the MIDI cases): a take landed on a track placed at bar 5 sits at sample 48000 with latency 128, the output's alone, and the notes file, row, and ledger pin are exact. - `src/generators/voice-render.test.ts`: the render's cache inputs, and a real-`sclang` render that is the same bytes from a cold cache. - `src/commands/record-midi-daemon.test.ts`: `field record` end to end through the null output with a source the helper publishes. A failure in the last one that reads `cannot create a virtual MIDI source` after retries means CoreMIDI is refusing sources outright, not the brief refusal plan §13.2 describes. If the Mac sleeps during the suite, every test running at that moment times out together; run it under `caffeinate -s -i`, as I did. To try it by hand without sound, in a scratch project (`field init`, `field song create creek`, copy `examples/bloom/shared/instruments/still-water-pad.scd` into `shared/instruments/`, then create a `played` track whose record entry has `instrument: still-water-pad`): 1. Publish a source with `native/audiod/build/field-audiod_artefacts/Release/field-audiod --keys "Field Keys Verify"`, or run `field keys still-water-pad`, which plays aloud. 2. In another terminal, from the scratch project, run `FIELD_AUDIOD_NULL=1 field record creek/track:played --at 1.2.1`. Send a few notes (in `field keys`, type them), then press Ctrl-C. 3. Run `field record --list`, then `field build creek`. I ran exactly this with a script sending two notes. Expect `armed MIDI from Field Keys Verify`, then `recording take-… from 1.2.1 (0:00.5)`, then `take creek/played ← take-… at bar 1.2, chosen (audio/played/take-….notes.yaml, 2.3 s, 4 events)`. The notes file holds one row per note, timed to within 5 ms of when they were sent. `field build creek` builds `//songs/creek/gen:played` and the track over it. A take with no `.notes.yaml`, or `gen:played` missing from the build, means the MIDI path did not run. The run leaves the scratch project with the take, its ledger row, and `.field/out/` renders; nothing outside it changes. Criteria 30, 31, 35, and 36 still need a real output device and ears: record with `field keys still-water-pad` playing, then `field play creek`. <!-- projector-summary v=1 sha=98ca869ecd1af6dbdf8de990df6c2d9961972c74 --> 📽️ **Projector summary** of 98ca869: https://field.amnes.ac/reviews/182
Musical Typing is the keymap most musicians know from a computer keyboard, but it reaches only 18 notes before you transpose. This chunk of the keyboard-instrument plan, stacked on #179, ships the two alternatives the plan chose as built-ins:
tracker, the layout trackers have used from FastTracker 2 to Renoise, with two piano octaves on the bottom and top rows (32 notes), andfourths, an isomorphic grid with a semitone per key and a perfect fourth per row (27 notes), where a chord shape plays the same in every key.Both are plain keymap files in the format #178 introduced, and both were already that chunk's schema fixtures, so the format was known to express them; the tests now read the shipped files instead. Each puts transpose and velocity on the arrows and sustain on
Space, because their notes take the rows Musical Typing keeps for controls.docs/keys.mddescribes them, and the plan records the chunk as built in §11.Testing
Run these from the repository root of this branch.
field keysneeds the daemon (pnpm build:native);--printdoes not.pnpm install --frozen-lockfile pnpm typecheck pnpm test pnpm field keys --keymap tracker --print pnpm field keys --keymap fourths --printpnpm testpasses; when I ran it on this head, 904 tests passed with none skipped. Thetrackerdiagram puts C3 underZand C4 under both,andQ; thefourthsdiagram puts C3 underZ, F3 underA, A#3 underQ, and D#4 under1. A diagram with notes elsewhere means a keymap file is wrong.Then play them in Ghostty or iTerm2 with
pnpm field keys --keymap trackerand, in a second terminal,native/audiod/build/field-audiod_artefacts/Release/field-audiod --midi-monitor "Field Keys". PressingZ,Q, andIprints note-ons 48, 60, and 72, and→showstranspose +12on the status line. With--keymap fourths, pressingZ B Dtogether and thenX N Ftogether prints 48, 52, 55 and then 49, 53, 56. I ran both in a pseudo-terminal through the real helper and CoreMIDI, typing as this Mac's ColemakC keyboard layout does, and the monitor heard exactly those notes, each with one note-off. Real keys in a real terminal are still owed, as plan §9.3 says. The commands leave no state behind.📽️ Projector summary of 07e7208: https://field.amnes.ac/reviews/181