Skip to content

Music lab: game music built around a hum (ritmo-tools music) - #138

Merged
SandroMaglione merged 4 commits into
mainfrom
claude/project-thread-dynhk8
Oct 29, 2026
Merged

SandroMaglione merged 4 commits into
mainfrom
claude/project-thread-dynhk8

Conversation

@SandroMaglione

Copy link
Copy Markdown
Member

Requested by Sandro · project thread

A third tool in @typeonce/ritmo-tools, following the sound lab's pattern: an agent-readable format and CLI, plus a local review page in the pixel fixer's look.

The flow

  1. The person hums (recorded on the page, or a WAV). music listen <song> <audio> hears its tempo, key, and melody (YIN pitch tracking, onset-based tempo, Krumhansl key profiles) and writes them into the song as its reference. It creates the song if it does not exist.
  2. The agent writes tracks of notes around it (music instruments lists 12 synthesized instruments: piano, electric piano, guitar (Karplus-Strong), bass, strings, flute, marimba, bells, pad, two chiptune voices, and a drum kit).
  3. music check measures what can be known without hearing: clipping, loudness, notes out of key or range, a buried track, and how closely the melody follows the hum (follows).
  4. music review opens the page. It has an arrangement view, a note grid (click to add, drag to move or stretch, double-click to remove), mute/solo, instrument swap, mic recording, playing the hum with the song, and comments on bars. music notes returns the comments plus the person's hand edits in words.
  5. music render writes a seamless-loop WAV, a MIDI file, and --stems.

Like the sound lab, the scope ends at audio files, with no in-game player.

Also

  • ritmo-music skill in packages/core/skills, linked in SETUP.md, checked by pack-check and listed in llms.txt
  • examples/village.song.json with a synthesized test hum as its reference
  • test/music.test.ts covers: format round-trip, every instrument rendered then heard back in tune, the hum heard note for note, checks, WAV/MIDI, edits in words, and the CLI end to end
  • A few icons added to the shared kit
  • Changeset included; pnpm check passes

Generated by Claude Code

`ritmo-tools music` keeps game music as JSON songs (tempo, key, bars,
tracks of notes on twelve synthesized instruments). The agent cannot
hear, so `music listen` turns a hum or recording into a tempo, a key, and
a melody on the song's grid for it to build around; `music check`
measures what it can without listening; `music review` opens a page in
the pixel fixer's look where the person plays, edits notes, records a
hum, and comments on bars, and `music notes` hands that back.

Ships the `ritmo-music` skill and an example song built around a test hum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNdbrF7BLwx5WKX2ruk
@SandroMaglione SandroMaglione self-assigned this Oct 29, 2026
SandroMaglione and others added 3 commits October 29, 2026 12:31
…ck fixes

Four new synthesized instruments for music the acoustic and chiptune voices
cannot make: a distorted guitar (`rockGuitar`), a reese bass (`reese`), a
supersaw lead (`synthLead`), and a punchy drum kit (`breaks`, the same drum
names as `drums`). A song's new `compressor` (off by default) squeezes the
mix louder and punchier, its peaks held under -1 dBFS; stems and the check's
per-track loudness stay uncompressed.

The review page: the hum's play button stops it (it stacked a new copy on
every click), Play/Pause carries on from where it paused with a separate
Stop, and a start marker set by clicking the bar numbers or a lane shows
where Play starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is not one voice

`music listen` measures how far off pitch a voice sits over all its notes
(a mean on a circle of semitones, weighted by how long each note is held)
and takes it out before naming them, so a hum sung a third of a semitone
flat no longer comes out a semitone low on half its notes. The report
gives it as `tuning`, in cents.

A recording with too few notes for its length (a full song played in the
room, a noisy one) is now called out by `music listen` and the page: hum
the part alone. `music listen` suggests `--tempo` when the song already has
a different one, and the page says the review server is not running when a
save cannot reach it, instead of "could not listen".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SandroMaglione
SandroMaglione merged commit 5368d55 into main Oct 29, 2026
4 checks passed
@SandroMaglione
SandroMaglione deleted the claude/project-thread-dynhk8 branch November 1, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants