Created
October 8, 2012 18:54
-
-
Save emanchado/3854210 to your computer and use it in GitHub Desktop.
Silly alphaTab patch (improves support for GuitarPro mobile-generated .gpx files)
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
--- lib/alphaTab/alphaTab.js 2011-01-07 23:13:06.000000000 +0100 | |
+++ /var/www/alphatab/lib/alphaTab/alphaTab.js 2012-10-08 20:52:35.000000000 +0200 | |
@@ -2173,8 +2173,12 @@ | |
beat.id = Std.parseInt(beatNode.att.resolve("id")); | |
beat.dyn = beatNode.node.resolve("Dynamic").getInnerData(); | |
beat.rhythmId = Std.parseInt(beatNode.node.resolve("Rhythm").att.resolve("ref")); | |
+ try { | |
beat.noteIds = this.toIntArray(beatNode.node.resolve("Notes").getInnerData()); | |
this.gpxDocument.beats.push(beat); | |
+ } catch(e) { | |
+ // We don't really care | |
+ } | |
} | |
}} | |
} | |
@@ -6475,7 +6479,13 @@ | |
var b = 0; | |
while(b < gpxVoice.beatIds.length) { | |
var gpxBeat = this._document.getBeat(gpxVoice.beatIds[b]); | |
- var rhythm = this._document.getRhythm(gpxBeat.rhythmId); | |
+ var rhythm; | |
+ try { | |
+ rhythm = this._document.getRhythm(gpxBeat.rhythmId); | |
+ } catch(e) { | |
+ b++; | |
+ continue; | |
+ } | |
var beat = this.getBeat(measure,start); | |
var voice = beat.voices[v % beat.voices.length]; | |
voice.isEmpty = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment