Skip to content

Commit

Permalink
Ignore invalid track name meta events
Browse files Browse the repository at this point in the history
  • Loading branch information
Geomitron committed Dec 21, 2023
1 parent 58935c5 commit d62a214
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-radios-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"scan-chart": patch
---

Ignore invalid track name meta events
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
},
"[typescript]": {
Expand Down
2 changes: 1 addition & 1 deletion src/chart/midi-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class MidiParser {
switch (midiEvent.type) {
case EVENT_META: {
switch (midiEvent.subtype) {
case EVENT_META_TRACK_NAME: trackNameEvents.push(midiEvent); break
case EVENT_META_TRACK_NAME: if (midiEvent.playTime === 0) { trackNameEvents.push(midiEvent) } break
case EVENT_META_SET_TEMPO: this.tempoMap.push(midiEvent); break
case EVENT_META_TIME_SIGNATURE: this.timeSignatures.push(midiEvent); break
case EVENT_META_LYRICS: break // Ignored
Expand Down

0 comments on commit d62a214

Please sign in to comment.