Repository navigation
feat(drums): stream drum gameplay metadata on the highway WS - #1105
Open
mattromano wants to merge 2 commits into
Open
mattromano wants to merge 2 commits into
mattromano wants to merge 2 commits into
Conversation
Rhythm-game drum charts are the largest pool of authored drum parts, but core had no way to bring one in. Add a converter for CH/YARG song folders (notes.mid PART DRUMS or notes.chart, song.ini, audio) and .sng packages, and an exporter back to a CH folder. - lib/drumchart.py parses the drums part with rules ported from YARG.Core (LGPL-3.0, attributed): tom markers, 5-lane -> pro, disco flip, dynamics, 2x kick, song.ini delay, all four difficulties, star power / fills / solos / sections. It encodes to drum_tab.json via lib/drums.py piece-ids and the feedpak 1.20.0 drum gameplay metadata (a, x2, star_power, fills, solos, levels), and to song_timeline.json. - lib/drumchart_gen.py reduces missing lower levels from Expert (marked generated) and generates YARG-style activation fills. - lib/sngfile.py reads .sng packages (no numpy: lib must not need it). - scripts/ch_to_sloppak.py writes a type: drums arrangement with the song-level drum_tab alias and a song_timeline; scripts/sloppak_to_ch.py exports a pack's drum part (via sloppak.load_song) as notes.mid. Depends on the feedpak-spec 1.20.0 drum gameplay metadata PR for the drum_tab keys; every manifest key written is already in the spec, so the feedpak-spec gate passes against spec main and the spec branch alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: mattromano <42412983+mattromano@users.noreply.github.com>
The drum_tab stream now carries the feedpak 1.20.0 gameplay keys the chart importer writes, so a drums renderer can score a chart the way a rhythm game does: drum_hits keep the accent (a) and double-kick (x2) flags, the drum_tab frame carries star_power / fills / solos and a levels index, and each easier level's hits follow as chunked drum_level_hits frames. highway.js keeps all of it on bundle.drumTab. Everything is sanitised like the hits already are and strictly additive: a tab without the keys streams the exact frames it did before, and older clients ignore the new frame type and play hits[]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: mattromano <42412983+mattromano@users.noreply.github.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mattromano
marked this pull request as ready for review
October 15, 2026 03:52
Author
|
Marking ready: this is part of the drum gameplay metadata chain (feedpak-spec#68 → feedBack#1105 streams it → feedBack#1091 imports it) that got-feedBack/feedBack-plugin-drums#25 uses for star power, fills, solos and per-difficulty levels. |
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.
What
Closes #1104
The highway WebSocket now delivers the feedpak 1.20.0 drum gameplay metadata so a drums renderer can read it from
bundle.drumTab:lib/drums.py:hit_to_wirekeepsa(accent) andx2(double kick). Sanitised like the other keys: a hit is never sent both accented and ghosted (spec forbids the pair; the ghost wins), andx2only appears on akickin the top-levelhits[](top=Falsefor level hits, per spec). Newranges_to_wire(star_power/fills/solos→ sorted{start_time, end_time}, malformed / reversed ranges dropped) andlevels_to_wire(closed id list easy/medium/hard, unknown ids ignored, empty levels dropped).lib/routers/ws_highway.py: thedrum_tabframe carries the non-empty range lists and alevelsindex{id: {total, generated}}; each level's hits follow the top-leveldrum_hitsasdrum_level_hitschunks ({level, data, total}, 500 per frame, likedrum_hits), so a long level stays under frame limits. Works per drum part (the selected part's tab is streamed).static/highway.js: thedrum_tabcase copiesstar_power/fills/solosand buildslevels.<id> = {hits: [], generated}; a newdrum_level_hitscase appends to the announced level only (unknown ids, including__proto__, are ignored).Strictly additive: a tab without the keys produces exactly the old frames (tested), and a client predating this ignores the new frame type and keeps playing
hits[](the full part, x2 kicks included — the spec's intended fallback). The drums plugin PRs (feedBack-plugin-drumsfeature/ISSUE-yarg-scoring-engineand its stack) consume this.feedpak surface
drum_tab.json) that the loader already reads verbatim; no manifest key is touched.Checklist
CHANGELOG.md[Unreleased]updated (user-visible changes)tests/test_drums_lib.py(+5):a/x2on the wire, accent+ghost, x2 only on top-level kicks, range sanitising, level sanitising.tests/test_highway_ws_drum_metadata.py(new, 3): real app over a temp DLC — metadata frames, level chunk order/contents/totals, unchanged frames for a pre-1.20.0 tab, 500-per-frame chunking.tests/js/drum_tab_metadata.test.js(new, 3): the highway.js cases in a vm sandbox.pytest2797 passed, 10 failed — all pre-existing Windows-only failures (symlink / tailwind / feedpak_extension / plugin_asset / settings-export), none touched here;node --test tests/js/drum_tab_metadata.test.js3/3;npx eslint static/highway.js tests/js/drum_tab_metadata.test.jsclean (only the existing max-lines warning on highway.js).scripts/ch_to_sloppak.pyfrom a synthetic chart (5 SP phrases, 3 fills, a solo, 3 levels) played in the drums plugin; the difficulty menu offered Easy..Expert+ and star-power notes rendered — see the plugin PR screenshots.git commit -s)🤖 Generated with Claude Code