Add writeMidiFile() with TEMPO/EVENTS/unrecognized-track emission - #72
Open
elicwhite wants to merge 1 commit into
Open
Add writeMidiFile() with TEMPO/EVENTS/unrecognized-track emission#72elicwhite wants to merge 1 commit into
elicwhite wants to merge 1 commit into
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. |
elicwhite
marked this pull request as ready for review
April 20, 2026 04:16
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 04:18
d34492e to
6392059
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 04:19
d376a03 to
3a10d87
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 04:40
6392059 to
384bfaf
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 04:40
3a10d87 to
f8da23b
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 04:45
384bfaf to
6251e3a
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 04:45
f8da23b to
0e82a25
Compare
This was referenced Apr 20, 2026
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 05:09
6251e3a to
c88be8b
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 05:09
0e82a25 to
e58921d
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 05:10
c88be8b to
88f54cf
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 05:10
e58921d to
3f8ca11
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 20, 2026 05:19
88f54cf to
ae62751
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 20, 2026 05:19
3f8ca11 to
8f5478e
Compare
This was referenced Apr 20, 2026
This was referenced Apr 20, 2026
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 21, 2026 04:29
ae62751 to
b9fc02c
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
2 times, most recently
from
April 21, 2026 04:47
971638a to
d6aac50
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 21, 2026 04:48
b9fc02c to
0c2d229
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
chart-writer-tracks
branch
from
April 21, 2026 16:38
46def19 to
78f6b77
Compare
elicwhite
force-pushed
the
midi-writer-core
branch
2 times, most recently
from
April 21, 2026 16:51
931507e to
206bb47
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 21, 2026 16:51
78f6b77 to
143d91d
Compare
Port of the core MIDI writer infrastructure: - writeMidiFile(chart) entry point: builds a Format-1 MIDI and returns Uint8Array via midi-file's writeMidi - TEMPO TRACK: trackName + setTempo (from chart.tempos) + timeSignature (from chart.timeSignatures), all at their absolute ticks - EVENTS track: trackName + section text events (unwrapped so YARG's NormalizeTextEvent doesn't strip names containing ]) + [end] events + global events (bracket-wrap when source is .chart so MIDI output follows convention) + [coda] derived from drumFreestyleSections when not already present in unrecognizedEvents - Unrecognized MIDI tracks: verbatim pass-through with abs-tick → delta-tick conversion; duplicate track names suffixed to keep the internal trackMap unique - finalizeMidiTrack helper: sorts by tick with a type-priority tiebreaker, converts absolute ticks to delta times, appends endOfTrack Instrument tracks (PART DRUMS, PART GUITAR, …) and vocal tracks (PART VOCALS, HARM1/2/3) land in follow-up PRs.
elicwhite
force-pushed
the
midi-writer-core
branch
from
April 21, 2026 23:18
206bb47 to
96cb353
Compare
elicwhite
force-pushed
the
chart-writer-tracks
branch
from
April 21, 2026 23:18
143d91d to
914ea70
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.

Port of the core MIDI writer infrastructure:
Uint8Array via midi-file's writeMidi
(from chart.timeSignatures), all at their absolute ticks
NormalizeTextEvent doesn't strip names containing ]) + [end] events +
global events (bracket-wrap when source is .chart so MIDI output
follows convention) + [coda] derived from drumFreestyleSections when
not already present in unrecognizedEvents
delta-tick conversion; duplicate track names suffixed to keep the
internal trackMap unique
tiebreaker, converts absolute ticks to delta times, appends endOfTrack
Instrument tracks (PART DRUMS, PART GUITAR, …) and vocal tracks
(PART VOCALS, HARM1/2/3) land in follow-up PRs.