-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regressions introduced by new version of musicxml-midi
- Loading branch information
1 parent
df8f152
commit 5cb9854
Showing
12 changed files
with
86 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
* musicxml-player v0.12.2 | ||
* musicxml-player v0.12.3 | ||
* (c) Karim Ratib <[email protected]> (https://github.com/infojunkie) | ||
* Released under the GPL-3.0-only License. | ||
*/ | ||
|
@@ -13809,7 +13809,7 @@ class WebAudioFontOutput { | |
} | ||
|
||
var name = "musicxml-player"; | ||
var version = "0.12.2"; | ||
var version = "0.12.3"; | ||
var description = "A simple JavaScript component that loads and plays MusicXML files in the browser using Web Audio and Web MIDI."; | ||
var main = "dist/musicxml-player.esm.js"; | ||
var type = "module"; | ||
|
@@ -13911,16 +13911,15 @@ var pkg = { | |
dependencies: dependencies | ||
}; | ||
|
||
const XSL_UNROLL = 'https://raw.githubusercontent.com/infojunkie/musicxml-mma/main/musicxml-unroll.sef.json'; | ||
const XSL_UNROLL = 'https://raw.githubusercontent.com/infojunkie/musicxml-midi/main/build/unroll.sef.json'; | ||
const RESIZE_THROTTLE = 100; | ||
class Player { | ||
constructor(_output, _renderer, _converter, _container, _musicXml, _timingsrc, _title) { | ||
constructor(_output, _renderer, _converter, _container, _musicXml, timingsrc, _title) { | ||
this._output = _output; | ||
this._renderer = _renderer; | ||
this._converter = _converter; | ||
this._container = _container; | ||
this._musicXml = _musicXml; | ||
this._timingsrc = _timingsrc; | ||
this._title = _title; | ||
// Create the MIDI player. | ||
this._midiPlayer = create({ | ||
|
@@ -13960,8 +13959,9 @@ class Player { | |
}); | ||
this._observer.observe(this._container); | ||
// Set up TimingObject listeners. | ||
this._changeEventListener = (event) => this._handleTimingsrcChange(event); | ||
this.timingsrc = this._timingsrc; | ||
this._timingsrc = null; | ||
this._timingsrcListener = (event) => this._handleTimingsrcChange(event); | ||
this.timingsrc = timingsrc; | ||
} | ||
static load(options) { | ||
var _a, _b, _c, _d; | ||
|
@@ -14064,9 +14064,9 @@ class Player { | |
set timingsrc(timingsrc) { | ||
var _a, _b, _c; | ||
(_a = this._timingsrc) === null || _a === void 0 ? void 0 : _a.update({ position: 0, velocity: 0 }); | ||
(_b = this._timingsrc) === null || _b === void 0 ? void 0 : _b.removeEventListener('change', this._changeEventListener); | ||
(_b = this._timingsrc) === null || _b === void 0 ? void 0 : _b.removeEventListener('change', this._timingsrcListener); | ||
this._timingsrc = timingsrc; | ||
(_c = this._timingsrc) === null || _c === void 0 ? void 0 : _c.addEventListener('change', this._changeEventListener); | ||
(_c = this._timingsrc) === null || _c === void 0 ? void 0 : _c.addEventListener('change', this._timingsrcListener); | ||
} | ||
// We implement IMidiOutput here to capture any interesting events | ||
// such as MARKER events with Groove information. | ||
|
@@ -14156,7 +14156,9 @@ class Player { | |
stylesheetLocation: XSL_UNROLL, | ||
sourceText: musicXml, | ||
destination: 'serialized', | ||
stylesheetParams: { renumberMeasures: true }, | ||
stylesheetParams: { | ||
renumberMeasures: true | ||
}, | ||
}, 'async'); | ||
return unroll.principalResult; | ||
} | ||
|
@@ -16997,13 +16999,13 @@ const midiJsonParser = load(url); | |
const parseArrayBuffer = midiJsonParser.parseArrayBuffer; | ||
URL.revokeObjectURL(url); | ||
|
||
const XSL_TIMEMAP = 'https://raw.githubusercontent.com/infojunkie/musicxml-mma/main/musicxml-timemap.sef.json'; | ||
const XSL_TIMEMAP = 'https://raw.githubusercontent.com/infojunkie/musicxml-midi/main/build/timemap.sef.json'; | ||
/** | ||
* Implementation of IMidiConverter that simply fetches given MIDI file and timemap JSON file URIs. | ||
* | ||
* The timemap JSON file can be generated using the script midi-timemap which is distributed with musicxml-mma | ||
* @see https://github.com/infojunkie/musicxml-mma/blob/main/scripts/midi-timemap.js | ||
* It assumes that the MIDI file is itself generated using musicxml-mma. | ||
* The timemap JSON file can be generated using the script midi-timemap which is distributed with musicxml-midi | ||
* @see https://github.com/infojunkie/musicxml-midi/blob/main/src/js/midi-timemap.js | ||
* It assumes that the MIDI file is itself generated using musicxml-midi. | ||
* | ||
* The timemap JSON structure is simple enough to be generated by other tools as well. | ||
*/ | ||
|
@@ -17049,6 +17051,9 @@ class FetchConverter { | |
stylesheetLocation: XSL_TIMEMAP, | ||
sourceText: musicXml, | ||
destination: 'serialized', | ||
stylesheetParams: { | ||
useSef: true | ||
} | ||
}, 'async'); | ||
return JSON.parse(unroll.principalResult); | ||
} | ||
|
@@ -17061,7 +17066,7 @@ class FetchConverter { | |
} | ||
|
||
/** | ||
* Implementation of IMidiConverter that queries the musicxml-mma API (@see https://github.com/infojunkie/musicxml-mma) | ||
* Implementation of IMidiConverter that queries the musicxml-midi API (@see https://github.com/infojunkie/musicxml-midi) | ||
* to convert a MusicXML to a MIDI file. It extracts the timemap contained within the MIDI file, expressed as MIDI marker events. | ||
*/ | ||
class MmaConverter { | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.