writeMidiFile: emit PART DRUMS instrument tracks - #74
Open
elicwhite wants to merge 1 commit into
Open
Conversation
This was referenced Apr 20, 2026
Owner
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 20, 2026
elicwhite
commented
Apr 20, 2026
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 20, 2026 05:09
45e2e09 to
f368e1b
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
2 times, most recently
from
April 20, 2026 05:10
e58921d to
3f8ca11
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 20, 2026 05:10
f368e1b to
3c33a1e
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 05:19
3f8ca11 to
8f5478e
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 20, 2026 05:19
3c33a1e to
6794214
Compare
This was referenced Apr 20, 2026
elicwhite
marked this pull request as ready for review
April 20, 2026 16:09
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 04:29
8f5478e to
971638a
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
2 times, most recently
from
April 21, 2026 04:47
9e48e4d to
46f89fd
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 04:48
971638a to
d6aac50
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 21, 2026 05:06
46f89fd to
f5ea6a9
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
2 times, most recently
from
April 21, 2026 16:35
656840c to
eecc72b
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 21, 2026 16:35
f5ea6a9 to
2270012
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 16:38
eecc72b to
931507e
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 21, 2026 16:38
2270012 to
a90551e
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 16:51
931507e to
206bb47
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 21, 2026 16:51
a90551e to
01e7b0e
Compare
Adds drum emission to writeMidiFile: - buildDrumTrack: groups one or more ParsedTrackData entries (one per difficulty) into a single PART DRUMS MIDI track. Emits trackName, delegates per-difficulty notes to emitDrumNotes, collects and dedupes instrument-wide star power (MIDI 116) / solo (MIDI 103) / activation lanes (MIDI 120), emits flex lanes (MIDI 126/127 with per-difficulty LDS velocity), passes through per-track text events and unrecognizedMidiEvents from the first difficulty. - emitDrumNotes: per-difficulty note emission with full modifier support: base drum notes (MIDI 96..100 expert / 84..88 hard / 72..76 medium / 60..64 easy); double-kick as MIDI 95 only, emitted AFTER regular kick at the same tick (YARG insertion order quirk); tom markers (MIDI 110/111/112) only in fourLanePro; accent (velocity 127) / ghost (velocity 1) encoding; one flam marker (MIDI 109) per group; 5-lane green+cymbal remapped to offset 4 (orange pad); blue-at-same-tick-as- green+cymbal remapped to offset 5 so fiveLane detection succeeds; fourLanePro green+tom fallback to offset 5 when a conflicting green+cymbal exists at the same tick across difficulties; disco-flip state-transition text events (`[mix <diff> drums0[d|dnoflip]]`). - fourLanePro sentinel greenTomMarker: when drumType=1 but no tom markers were emitted (all yellow/blue defaulted to cymbal, green-toms used offset-5 encoding), emit a MIDI 112 at a safe tick so scan-chart's drumType detection still picks fourLanePro. - [ENABLE_CHART_DYNAMICS] text event at tick 0 when any accent or ghost was emitted. - computeLengthOverrides: prevents scan-chart's trimSustains from collapsing adjacent short-sustain drum-note chains by attributing the combined chain length to the first note. - Shared helpers: addNoteOnOff, addNoteOnOffWithChannel (with zero-length seq-pairing to survive finalizeMidiTrack's sort), deduplicateSections, instrumentTrackNames table. Fret tracks (PART GUITAR, GHL) and vocal tracks (PART VOCALS, HARM1/2/3) remain no-ops until the follow-up PRs land — the writeMidiFile entry iterates trackData but skips any non-drum instrument group.
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 23:18
206bb47 to
96cb353
Compare
elicwhite
force-pushed
the
midi-writer-drum
branch
from
April 21, 2026 23:18
01e7b0e to
fac4d59
Compare
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.

Adds drum emission to writeMidiFile:
buildDrumTrack: groups one or more ParsedTrackData entries (one per
difficulty) into a single PART DRUMS MIDI track. Emits trackName,
delegates per-difficulty notes to emitDrumNotes, collects and dedupes
instrument-wide star power (MIDI 116) / solo (MIDI 103) / activation
lanes (MIDI 120), emits flex lanes (MIDI 126/127 with per-difficulty
LDS velocity), passes through per-track text events and
unrecognizedMidiEvents from the first difficulty.
emitDrumNotes: per-difficulty note emission with full modifier support:
base drum notes (MIDI 96..100 expert / 84..88 hard / 72..76 medium /
60..64 easy); double-kick as MIDI 95 only, emitted AFTER regular kick
at the same tick (YARG insertion order quirk); tom markers (MIDI
110/111/112) only in fourLanePro; accent (velocity 127) / ghost
(velocity 1) encoding; one flam marker (MIDI 109) per group; 5-lane
green+cymbal remapped to offset 4 (orange pad); blue-at-same-tick-as-
green+cymbal remapped to offset 5 so fiveLane detection succeeds;
fourLanePro green+tom fallback to offset 5 when a conflicting
green+cymbal exists at the same tick across difficulties; disco-flip
state-transition text events (
[mix <diff> drums0[d|dnoflip]]).fourLanePro sentinel greenTomMarker: when drumType=1 but no tom
markers were emitted (all yellow/blue defaulted to cymbal, green-toms
used offset-5 encoding), emit a MIDI 112 at a safe tick so scan-chart's
drumType detection still picks fourLanePro.
[ENABLE_CHART_DYNAMICS] text event at tick 0 when any accent or ghost
was emitted.
computeLengthOverrides: prevents scan-chart's trimSustains from
collapsing adjacent short-sustain drum-note chains by attributing the
combined chain length to the first note.
Shared helpers: addNoteOnOff, addNoteOnOffWithChannel (with
zero-length seq-pairing to survive finalizeMidiTrack's sort),
deduplicateSections, instrumentTrackNames table.
Fret tracks (PART GUITAR, GHL) and vocal tracks (PART VOCALS, HARM1/2/3)
remain no-ops until the follow-up PRs land — the writeMidiFile entry
iterates trackData but skips any non-drum instrument group.