feat(gp2rs): emit lyrics + vocal_pitch sidecars from GP vocal tracks#1037
Open
ChrisBeWithYou wants to merge 1 commit into
Open
feat(gp2rs): emit lyrics + vocal_pitch sidecars from GP vocal tracks#1037ChrisBeWithYou wants to merge 1 commit into
ChrisBeWithYou wants to merge 1 commit into
Conversation
GP files with a vocal track previously produced only the legacy vocals arrangement XML; the melody sidecar converter existed but was never wired, so imported paks had no karaoke-ready pitch data. - convert_file() now calls _emit_vocal_sidecars() after writing the vocals XML (best-effort: a sidecar failure never breaks conversion, matching the notation-sidecar posture) - lyrics sidecar is projected from the just-built vocals XML so timing stays in lockstep; the XML lyric convention's trailing '+' (join) is mapped to the spec 7.1 '-' (join) - a passthrough would have turned every joined word into a line break - convert_vocal_track_to_pitch_sidecar() gains require_lyric=False for lyric-less melody tracks (pitch sidecar only) - attach_vocal_sidecars_to_sloppak() added as the assembly-step helper (companion to attach_notation_to_sloppak): writes the sidecars into a directory-form pak and sets manifest lyrics/lyrics_source/vocal_pitch with no-clobber guards - gp2rs_gpx registered in the spec-conformance READERS list Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughGPX vocal conversion now supports lyric-less pitch notes, emits lyrics and vocal pitch sidecars, and attaches validated sidecars to sloppak directories and manifests with provenance metadata. ChangesVocal karaoke sidecars
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GPX_converter
participant vocals_XML
participant sidecar_writer
participant sloppak_manifest
GPX_converter->>vocals_XML: write vocal track XML
GPX_converter->>sidecar_writer: generate lyric and pitch payloads
sidecar_writer->>sloppak_manifest: attach sidecars and manifest keys
sloppak_manifest-->>GPX_converter: preserve existing claimed lyrics
Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
8 tasks
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
GP imports currently drop the vocal melody: the vocal-track detector and the pitch-sidecar converter both exist, but
convert_file()never calls the converter, so a GP file with a charted vocal part yields only the legacy vocals arrangement XML and no karaoke-ready sidecars.This wires the orphaned path in, mirroring the keys-notation sidecar pattern one-for-one:
convert_file()vocal branch now emits<stem>.lyrics.json(spec §7.1) and<stem>.vocal_pitch.json(spec §7.2) next to the vocals XML, best-effort (a sidecar failure never breaks the XML conversion).+= join to next token, while feedpak §7.1 uses trailing+= end of line. A passthrough would turn every joined word into a line break, so XML+maps to §7.1-(both mean join). Line-end+is never emitted — GP stores lyrics per beat with no derivable line structure.convert_vocal_track_to_pitch_sidecar()gains opt-inrequire_lyric=False, used only for vocal tracks with zero lyric text (pitch sidecar only). With lyrics present, alignment behavior is unchanged.attach_vocal_sidecars_to_sloppak()— the assembly-step companion toattach_notation_to_sloppak(): writes both sidecars into a directory-form pak, sets manifestlyrics/lyrics_source: "authored"/vocal_pitch, validates shapes, and never clobbers an existing key or file. (The editor plugin's pak save needs a small follow-up PR to call it, exactly as it did for notation — tracked on the org board.)lib/gp2rs_gpx.pyregistered intools/check_spec_conformance.pyREADERS (the spec gate's self-check requires it; all keys touched are spec-declared).Tests
require_lyric=False, XML→lyrics projection (shape/suffix/bad-XML),convert_fileend-to-end (vocal+lyrics → both sidecars; guitar-only → none; lyric-less vocal → pitch only), attach helper (writes+manifest, no-clobber, rejects bad payloads).tests/test_gp2rs_gpx.py: 99 passed. GP-adjacent suites (gp2notation/gp2rs/drums/xml-encoding/autosync): 175 passed.Notes for review
lyrics_source: "authored"(from an authored chart); thelyric_transcription/pitch_extractionblocks are reserved for automated engines and are deliberately not written (asserted in tests).vocal_pitchas lyric-aligned; the lyric-less-track case (pitch-only sidecar) is slightly ahead of that framing — flagged for a reviewer sanity-check. The upcoming unified vocal-track FEP formalizes this case..gp/.gpx) only — the GP3/4/5 binary path has no vocal converter today.🤖 Generated with Claude Code
Summary by CodeRabbit