Repository navigation
feat(drums): import Rock Band / Clone Hero / YARG drum charts - #1091
Open
mattromano wants to merge 1 commit into
Open
mattromano wants to merge 1 commit into
mattromano wants to merge 1 commit 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>
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 |
This was referenced Oct 10, 2026
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 #1090
Adds a Rock Band / Clone Hero / YARG drum chart importer, and an exporter for the other direction.
lib/drumchart.pyparses a song folder's drums part (notes.midPART DRUMS ornotes.chart, plussong.ini) with rules ported from YARG.Core: tom markers 110–112, 5-lane → 4-lane pro, disco flip,[ENABLE_CHART_DYNAMICS]accents/ghosts, 2x kick (95 /N 32), Easy/Medium/Hard, star power (116 /S 2), fills (120–124 /S 64), solos (103), sections, and the song.inidelay/.chartOffset. It encodes the result asdrum_tab.json, using piece-ids fromlib/drums.py(midi_to_piece, so it can't drift from the vocabulary the drums plugin renders) and the feedpak 1.20.0 gameplay keys (a,x2,star_power,fills,solos,levels). It also writessong_timeline.json(tempos, time signatures, beats, sections).lib/drumchart_gen.pycovers charts that lack gameplay data. It reduces missing lower levels from Expert (rules fitted on 136 authored charts; markedgenerated), and generates YARG-style activation fills for charts with star power but no fills (SongChart.AutoGeneration).lib/sngfile.pyreads.sngpackages (SngFileFormat v1) in pure Python. numpy is test-only in core, so I rewrote the unmask as a 256-byte-period big-int XOR. It refuses directory components in member names and skips videos.scripts/ch_to_sloppak.pytakes a folder or.sngand writes a pack withfeedpak_version: 1.20.0: onetype: drumsarrangement pointing atdrum_tab.json, the song-leveldrum_tabalias (spec §7.5 "Multiple drum parts";arrangementsmay not be empty),song_timeline, the stems (lonesong.ogg→full; CH stems → guitar/bass/drums/vocals/piano/other; crowd dropped), and the cover. A single.oggper stem is copied verbatim; mixing or transcoding uses core'saudio._ffmpeg_cmd().scripts/sloppak_to_ch.pyloads a pack throughsloppak.load_song(zip/dir, drum parts,song_timelineall handled by core) and writes PART DRUMS for the primary part or--part <id>. That includes the tempo map rebuilt from the beat grid (pickup / delay detection), tom markers, dynamics, Easy–Hard fromlevels, and SP/fill/solo phrase notes, plus EVENTS sections,song.iniand OGG stems.Licensing: the parsing rules and
auto_fillsare ports of YARG.Core, which is LGPL-3.0 (not MIT — I checked its LICENSE). Its MoonscraperChartParser files are © Alexander Ong.lib/drumchart.py/lib/drumchart_gen.pycarry the attribution and the note that LGPL-3.0 code may be combined into this AGPL-3.0 project.reduce_leveland the exporter are original.No
print()inlib/(the scripts log throughlogging, likescripts/lift_keys_notation.py). No JS changes.feedpak surface
got-feedback/feedpak-spec#68(once it merges, re-run this PR's checks and the gate goes green)Dependency: stacked on got-feedBack/feedpak-spec#68 (FEP got-feedBack/feedpak-spec#67). The
drum_tabkeys this writes (hits[].a,hits[].x2,star_power,fills,solos,levels) are defined there. Please merge that first. All manifest keys written (feedpak_version,title,artist,album,year,duration,cover,stems,arrangementswithtype/drum_tab,drum_tab,song_timeline) already exist in specmain, and the gate only scans top-level manifest keys. So thefeedpak-specCI job passes today against specmainas well as the spec branch (verified locally, all 4 layers). It won't mechanically block. Holding the merge for the spec PR is a process rule, not a CI one.feedpak-spec-exceptions.ymlisn't involved and can't be used here: CI fails any PR that adds to it, and there's no in-repo bypass (docs/feedpak-spec-gate.md).Core reads nothing new. Streaming the gameplay keys over the highway WS to a drums renderer is a follow-up: today
drums.hits_to_wireforwardst/p/v/g/f/konly.Checklist
CHANGELOG.md[Unreleased]updated (user-visible changes)git commit -s)Tests:
tests/test_drumchart.py(26) andtests/test_sloppak_to_ch.py(5), with fixtures intests/drum_fixtures.py. They use synthetic MIDI/.chart/.sng files and stand-in OGG bytes, so no ffmpeg or audio is needed in CI. Coverage: tempo maps, tom markers, dynamics, 5-lane, disco flip, delay/offset, lower levels, encoding (every pad ↔ piece,x2only at the top level, empty metadata omitted, payload passesdrums.validate_drum_tabandhits_to_wire), reduction rules, auto fills, folder → pack →sloppak.load_song(a drum part, a placeholder-only arrangement list so nothing is graded as fretted, timeline loaded), CH stem mapping,.snginput, CLI errors, a CH → pack → CH round trip (hits, levels, SP/fills/solos, sections, beats within 2 ms; second conversion identical), part selection, unknown pieces, pickup handling, and.sngunmask against a byte-wise reference plus path-traversal stripping.pytest tests/test_drumchart.py tests/test_sloppak_to_ch.pyplus the existing drums tests (test_drums_lib,test_sloppak_drum_parts,test_sloppak_drumtab_load,test_midi_import_drums,test_spec_gate): 108 passed.tools/check_spec_conformance.py --spec <feedpak-spec main>and--spec <spec branch>: OK.tools/validate.py: PASS.🤖 Generated with Claude Code
🤖 Generated with Claude Code