Add createEmptyChart() counterpart to parseChartAndIni#99
Open
elicwhite wants to merge 1 commit into
Open
Conversation
1d776fe to
dbef712
Compare
60fcd5e to
42d80e2
Compare
This was referenced Apr 20, 2026
c6f1e16 to
0b28f17
Compare
2 tasks
a3c4753 to
d6f9c4f
Compare
Builds a minimal valid ParsedChart from scratch: default 480 resolution, 120 BPM at tick 0, 4/4 time signature at tick 0, empty tracks/sections/ metadata/vocal parts/unrecognized events. chartBytes defaults to an empty Uint8Array (no source bytes), format defaults to 'chart', iniChartModifiers to the library defaults. Options let callers override resolution, bpm, timeSignature, and format. Useful for programmatic chart generation (e.g. downstream code that builds charts up from scratch rather than parsing source bytes).
d6f9c4f to
84b0e83
Compare
3 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.
Context
Adds a programmatic builder for `ParsedChart` — the counterpart to `parseChartAndIni` for consumers who construct charts from scratch (e.g. generating a chart from ML-transcribed drum data) rather than parsing source bytes.
Shape
```ts
export function createEmptyChart(options?: {
format?: 'chart' | 'mid' // default 'chart'
resolution?: number // default 480
bpm?: number // default 120
timeSignature?: { numerator: number; denominator: number } // default 4/4
}): ParsedChart
```
Returns a minimal valid `ParsedChart` with defaults filled in: requested resolution, single tempo at tick 0, single time signature at tick 0, empty tracks/sections/vocalTracks/unrecognized events, `chartBytes` as an empty `Uint8Array` (no source), `iniChartModifiers` set to `defaultIniChartModifiers`.
Depends on
PRs #97 + #98 — stacked on the same line. Diff against master currently includes those changes; once they merge upstream, this diff becomes clean (~60 lines of new code + tests).