@coderline/alphatab 1.9.0-alpha.1853 → 1.9.0-alpha.1860

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * alphaTab v1.9.0-alpha.1853 (develop, build 1853)
2
+ * alphaTab v1.9.0-alpha.1860 (develop, build 1860)
3
3
  *
4
4
  * Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -186,9 +186,9 @@ class AlphaTabError extends Error {
186
186
  * @internal
187
187
  */
188
188
  class VersionInfo {
189
- static version = "1.9.0-alpha.1853";
190
- static date = "2026-07-04T03:56:00.242Z";
191
- static commit = "770d9e5f9fa71e92e08bdeb8b27a7144b1ef1418";
189
+ static version = "1.9.0-alpha.1860";
190
+ static date = "2026-07-10T14:22:26.590Z";
191
+ static commit = "1efc2ecc10ca13f2bfbec400427822dc4bdfc160";
192
192
  static print(print) {
193
193
  print(`alphaTab ${VersionInfo.version}`);
194
194
  print(`commit: ${VersionInfo.commit}`);
@@ -18187,18 +18187,24 @@ class Gp3To5Importer extends ScoreImporter {
18187
18187
  _lyrics = [];
18188
18188
  _barCount = 0;
18189
18189
  _trackCount = 0;
18190
- _playbackInfos = [];
18190
+ /**
18191
+ * For 4 ports, 16 channels of information
18192
+ */
18193
+ _midiChannelInfo = [];
18191
18194
  _doubleBars = /* @__PURE__ */ new Set();
18192
18195
  _clefsPerTrack = /* @__PURE__ */ new Map();
18193
18196
  _keySignatures = /* @__PURE__ */ new Map();
18194
18197
  _beatTextChunksByTrack = /* @__PURE__ */ new Map();
18195
18198
  _directionLookup = /* @__PURE__ */ new Map();
18196
18199
  _initialTempo;
18200
+ _stringEncoding = "";
18197
18201
  get name() {
18198
18202
  return "Guitar Pro 3-5";
18199
18203
  }
18200
18204
  readScore() {
18201
18205
  this._directionLookup.clear();
18206
+ if (this.settings.importer.encoding !== "utf-8") this._stringEncoding = this.settings.importer.encoding;
18207
+ else this._stringEncoding = this.settings.importer.gp3To5encoding;
18202
18208
  this.readVersion();
18203
18209
  this._score = new Score();
18204
18210
  this.readScoreInformation();
@@ -18208,7 +18214,7 @@ class Gp3To5Importer extends ScoreImporter {
18208
18214
  this._initialTempo = Automation.buildTempoAutomation(false, 0, 0, 0);
18209
18215
  if (this._versionNumber >= 500) {
18210
18216
  this.readPageSetup();
18211
- this._initialTempo.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18217
+ this._initialTempo.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18212
18218
  }
18213
18219
  this._initialTempo.value = IOHelper.readInt32LE(this.data);
18214
18220
  if (this._versionNumber >= 510) GpBinaryHelpers.gpReadBool(this.data);
@@ -18267,7 +18273,7 @@ class Gp3To5Importer extends ScoreImporter {
18267
18273
  directionsList.push(direction);
18268
18274
  }
18269
18275
  readVersion() {
18270
- let version = GpBinaryHelpers.gpReadStringByteLength(this.data, 30, this.settings.importer.encoding);
18276
+ let version = GpBinaryHelpers.gpReadStringByteLength(this.data, 30, this._stringEncoding);
18271
18277
  if (!version.startsWith(Gp3To5Importer._versionString)) throw new UnsupportedFormatError("Unsupported format");
18272
18278
  version = version.substr(Gp3To5Importer._versionString.length + 1);
18273
18279
  const dot = version.indexOf(String.fromCharCode(46));
@@ -18275,21 +18281,21 @@ class Gp3To5Importer extends ScoreImporter {
18275
18281
  Logger.debug(this.name, `Guitar Pro version ${version} detected`);
18276
18282
  }
18277
18283
  readScoreInformation() {
18278
- this._score.title = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18279
- this._score.subTitle = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18280
- this._score.artist = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18281
- this._score.album = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18282
- this._score.words = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18283
- this._score.music = this._versionNumber >= 500 ? GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize) : this._score.words;
18284
- this._score.copyright = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18285
- this._score.tab = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18286
- this._score.instructions = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18284
+ this._score.title = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18285
+ this._score.subTitle = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18286
+ this._score.artist = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18287
+ this._score.album = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18288
+ this._score.words = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18289
+ this._score.music = this._versionNumber >= 500 ? GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize) : this._score.words;
18290
+ this._score.copyright = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18291
+ this._score.tab = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18292
+ this._score.instructions = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18287
18293
  const noticeLines = IOHelper.readInt32LE(this.data);
18288
18294
  this._ensureLoopBoundary(noticeLines, Gp3To5Importer._maxNoticeLines, "notice line count");
18289
18295
  let notice = "";
18290
18296
  for (let i = 0; i < noticeLines; i++) {
18291
18297
  if (i > 0) notice += "\r\n";
18292
- notice += GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize)?.toString();
18298
+ notice += GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize)?.toString();
18293
18299
  }
18294
18300
  this._score.notices = notice;
18295
18301
  }
@@ -18307,7 +18313,7 @@ class Gp3To5Importer extends ScoreImporter {
18307
18313
  for (let i = 0; i < 5; i++) {
18308
18314
  const lyrics = new Lyrics();
18309
18315
  lyrics.startBar = IOHelper.readInt32LE(this.data) - 1;
18310
- lyrics.text = GpBinaryHelpers.gpReadStringInt(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18316
+ lyrics.text = GpBinaryHelpers.gpReadStringInt(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18311
18317
  this._lyrics.push(lyrics);
18312
18318
  }
18313
18319
  }
@@ -18315,37 +18321,43 @@ class Gp3To5Importer extends ScoreImporter {
18315
18321
  this.data.skip(28);
18316
18322
  const flags = IOHelper.readInt16LE(this.data);
18317
18323
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).isVisible = (flags & 1) !== 0;
18318
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18324
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18319
18325
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).isVisible = (flags & 2) !== 0;
18320
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18326
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18321
18327
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).isVisible = (flags & 4) !== 0;
18322
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18328
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18323
18329
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).isVisible = (flags & 8) !== 0;
18324
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18330
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18325
18331
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).isVisible = (flags & 16) !== 0;
18326
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18332
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18327
18333
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).isVisible = (flags & 32) !== 0;
18328
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18334
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18329
18335
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).isVisible = (flags & 64) !== 0;
18330
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18336
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18331
18337
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).isVisible = (flags & 128) !== 0;
18332
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18338
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18333
18339
  ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).isVisible = (flags & 128) !== 0;
18334
- ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18335
- GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18340
+ ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18341
+ GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18336
18342
  }
18337
18343
  readPlaybackInfos() {
18338
- this._playbackInfos = [];
18339
- let channel = 0;
18340
- for (let i = 0; i < 64; i++) {
18341
- const info = new PlaybackInformation();
18342
- info.primaryChannel = channel++;
18343
- info.secondaryChannel = channel++;
18344
- info.program = IOHelper.readInt32LE(this.data);
18345
- info.volume = this.data.readByte();
18346
- info.balance = this.data.readByte();
18347
- this.data.skip(6);
18348
- this._playbackInfos.push(info);
18344
+ this._midiChannelInfo = [];
18345
+ for (let port = 0; port < 4; port++) {
18346
+ const portInfo = [];
18347
+ this._midiChannelInfo.push(portInfo);
18348
+ for (let channel = 0; channel < 16; channel++) {
18349
+ const info = {
18350
+ program: IOHelper.readInt32LE(this.data),
18351
+ volume: this.data.readByte(),
18352
+ balance: this.data.readByte(),
18353
+ chorus: this.data.readByte(),
18354
+ reverb: this.data.readByte(),
18355
+ phase: this.data.readByte(),
18356
+ tremolo: this.data.readByte()
18357
+ };
18358
+ this.data.skip(2);
18359
+ portInfo.push(info);
18360
+ }
18349
18361
  }
18350
18362
  }
18351
18363
  readMasterBars() {
@@ -18382,7 +18394,7 @@ class Gp3To5Importer extends ScoreImporter {
18382
18394
  }
18383
18395
  if ((flags & 32) !== 0) {
18384
18396
  const section = new Section();
18385
- section.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18397
+ section.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18386
18398
  section.marker = "";
18387
18399
  GpBinaryHelpers.gpReadColor(this.data, false);
18388
18400
  newMasterBar.section = section;
@@ -18421,7 +18433,7 @@ class Gp3To5Importer extends ScoreImporter {
18421
18433
  this._score.addTrack(newTrack);
18422
18434
  const mainStaff = newTrack.staves[0];
18423
18435
  const flags = this.data.readByte();
18424
- newTrack.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 40, this.settings.importer.encoding);
18436
+ newTrack.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 40, this._stringEncoding);
18425
18437
  if ((flags & 1) !== 0) mainStaff.isPercussion = true;
18426
18438
  if (this._versionNumber >= 500) newTrack.isVisibleOnMultiTrack = (flags & 8) !== 0;
18427
18439
  if (this._score.stylesheet.perTrackDisplayTuning === null) this._score.stylesheet.perTrackDisplayTuning = /* @__PURE__ */ new Map();
@@ -18433,19 +18445,22 @@ class Gp3To5Importer extends ScoreImporter {
18433
18445
  if (stringCount > i) tuning.push(stringTuning);
18434
18446
  }
18435
18447
  mainStaff.stringTuning.tunings = tuning;
18436
- const port = IOHelper.readInt32LE(this.data);
18437
- const index = IOHelper.readInt32LE(this.data) - 1;
18448
+ const port = IOHelper.readInt32LE(this.data) - 1;
18449
+ const channel = IOHelper.readInt32LE(this.data) - 1;
18438
18450
  const effectChannel = IOHelper.readInt32LE(this.data) - 1;
18439
18451
  this.data.skip(4);
18440
- if (index >= 0 && index < this._playbackInfos.length) {
18441
- const info = this._playbackInfos[index];
18442
- info.port = port;
18443
- info.isSolo = (flags & 16) !== 0;
18444
- info.isMute = (flags & 32) !== 0;
18445
- info.secondaryChannel = effectChannel;
18446
- if (GeneralMidi.isGuitar(info.program)) mainStaff.displayTranspositionPitch = -12;
18447
- newTrack.playbackInfo = info;
18448
- }
18452
+ const mainMidiChannelInfo = this._midiChannelInfo[port][channel];
18453
+ const trackPlaybackInfo = new PlaybackInformation();
18454
+ trackPlaybackInfo.volume = mainMidiChannelInfo.volume;
18455
+ trackPlaybackInfo.balance = mainMidiChannelInfo.balance;
18456
+ trackPlaybackInfo.port = port;
18457
+ trackPlaybackInfo.program = mainMidiChannelInfo.program;
18458
+ trackPlaybackInfo.primaryChannel = channel;
18459
+ trackPlaybackInfo.secondaryChannel = effectChannel;
18460
+ trackPlaybackInfo.isSolo = (flags & 16) !== 0;
18461
+ trackPlaybackInfo.isMute = (flags & 32) !== 0;
18462
+ if (GeneralMidi.isGuitar(trackPlaybackInfo.program)) mainStaff.displayTranspositionPitch = -12;
18463
+ newTrack.playbackInfo = trackPlaybackInfo;
18449
18464
  mainStaff.capo = IOHelper.readInt32LE(this.data);
18450
18465
  newTrack.color = GpBinaryHelpers.gpReadColor(this.data, false);
18451
18466
  if (this._versionNumber >= 500) {
@@ -18469,8 +18484,8 @@ class Gp3To5Importer extends ScoreImporter {
18469
18484
  this._readRseBank();
18470
18485
  if (this._versionNumber >= 510) {
18471
18486
  this.data.skip(4);
18472
- GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18473
- GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18487
+ GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18488
+ GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18474
18489
  }
18475
18490
  } else if (tuning[tuning.length - 1] < Gp3To5Importer._bassClefTuningThreshold) this._clefsPerTrack.set(newTrack.index, Clef.F4);
18476
18491
  else this._clefsPerTrack.set(newTrack.index, Clef.G2);
@@ -18573,7 +18588,7 @@ class Gp3To5Importer extends ScoreImporter {
18573
18588
  if ((flags & 2) !== 0) this.readChord(newBeat);
18574
18589
  const beatTextAsLyrics = this.settings.importer.beatTextAsLyrics && track.index !== this._lyricsTrack;
18575
18590
  if ((flags & 4) !== 0) {
18576
- const text = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18591
+ const text = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18577
18592
  if (beatTextAsLyrics) {
18578
18593
  const lyrics = new Lyrics();
18579
18594
  lyrics.text = text.trim();
@@ -18620,7 +18635,7 @@ class Gp3To5Importer extends ScoreImporter {
18620
18635
  const chordId = ModelUtils.newGuid();
18621
18636
  if (this._versionNumber >= 500) {
18622
18637
  this.data.skip(17);
18623
- chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this.settings.importer.encoding);
18638
+ chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this._stringEncoding);
18624
18639
  this.data.skip(4);
18625
18640
  chord.firstFret = IOHelper.readInt32LE(this.data);
18626
18641
  for (let i = 0; i < 7; i++) {
@@ -18634,7 +18649,7 @@ class Gp3To5Importer extends ScoreImporter {
18634
18649
  this.data.skip(26);
18635
18650
  } else if (this.data.readByte() !== 0) if (this._versionNumber >= 400) {
18636
18651
  this.data.skip(16);
18637
- chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this.settings.importer.encoding);
18652
+ chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this._stringEncoding);
18638
18653
  this.data.skip(4);
18639
18654
  chord.firstFret = IOHelper.readInt32LE(this.data);
18640
18655
  for (let i = 0; i < 7; i++) {
@@ -18648,7 +18663,7 @@ class Gp3To5Importer extends ScoreImporter {
18648
18663
  this.data.skip(26);
18649
18664
  } else {
18650
18665
  this.data.skip(25);
18651
- chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 34, this.settings.importer.encoding);
18666
+ chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 34, this._stringEncoding);
18652
18667
  chord.firstFret = IOHelper.readInt32LE(this.data);
18653
18668
  for (let i = 0; i < 6; i++) {
18654
18669
  const fret = IOHelper.readInt32LE(this.data);
@@ -18658,7 +18673,7 @@ class Gp3To5Importer extends ScoreImporter {
18658
18673
  }
18659
18674
  else {
18660
18675
  const strings = this._versionNumber >= 406 ? 7 : 6;
18661
- chord.name = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18676
+ chord.name = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18662
18677
  chord.firstFret = IOHelper.readInt32LE(this.data);
18663
18678
  if (chord.firstFret > 0) for (let i = 0; i < strings; i++) {
18664
18679
  const fret = IOHelper.readInt32LE(this.data);
@@ -18778,7 +18793,7 @@ class Gp3To5Importer extends ScoreImporter {
18778
18793
  const reverb = IOHelper.readSInt8(this.data);
18779
18794
  const phaser = IOHelper.readSInt8(this.data);
18780
18795
  const tremolo = IOHelper.readSInt8(this.data);
18781
- if (this._versionNumber >= 500) tableChange.tempoName = GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18796
+ if (this._versionNumber >= 500) tableChange.tempoName = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18782
18797
  tableChange.tempo = IOHelper.readInt32LE(this.data);
18783
18798
  if (tableChange.volume >= 0) this.data.readByte();
18784
18799
  if (tableChange.balance >= 0) this.data.readByte();
@@ -18797,8 +18812,8 @@ class Gp3To5Importer extends ScoreImporter {
18797
18812
  else if (wahType >= 0) beat.wahPedal = WahPedal.Open;
18798
18813
  }
18799
18814
  if (this._versionNumber >= 510) {
18800
- GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18801
- GpBinaryHelpers.gpReadStringIntByte(this.data, this.settings.importer.encoding, this.settings.importer.maxDecodingBufferSize);
18815
+ GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18816
+ GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
18802
18817
  }
18803
18818
  if (tableChange.volume >= 0) {
18804
18819
  const volumeAutomation = new Automation();
@@ -22548,6 +22563,10 @@ class InstrumentArticulationWithPlaybackInfo extends InstrumentArticulation {
22548
22563
  * The balance to use when playing the note (-1 if using the default track balance).
22549
22564
  */
22550
22565
  outputBalance = -1;
22566
+ /**
22567
+ * Whether this instrument was declared as an unpitched/percussion sound via `<midi-unpitched>`.
22568
+ */
22569
+ isUnpitched = false;
22551
22570
  }
22552
22571
  /**
22553
22572
  * @internal
@@ -22592,6 +22611,9 @@ class TrackInfo {
22592
22611
  this.track.percussionArticulations.push(newArticulation);
22593
22612
  return index;
22594
22613
  }
22614
+ isUnpitchedInstrument(instrumentId) {
22615
+ return this.instruments.has(instrumentId) && this.instruments.get(instrumentId).isUnpitched;
22616
+ }
22595
22617
  }
22596
22618
  /**
22597
22619
  * @internal
@@ -22906,6 +22928,7 @@ class MusicXmlImporter extends ScoreImporter {
22906
22928
  break;
22907
22929
  case "midi-unpitched":
22908
22930
  articulation.outputMidiNumber = Number.parseInt(c.innerText, 10) - 1;
22931
+ articulation.isUnpitched = true;
22909
22932
  break;
22910
22933
  case "volume":
22911
22934
  articulation.outputVolume = MusicXmlImporter._interpolatePercent(Number.parseFloat(c.innerText));
@@ -24324,11 +24347,15 @@ class MusicXmlImporter extends ScoreImporter {
24324
24347
  note.isVisible = noteIsVisible;
24325
24348
  if (note.percussionArticulation >= 0) return;
24326
24349
  const trackInfo = this._indexToTrackInfo.get(track.index);
24327
- if (instrumentId !== null) note.percussionArticulation = trackInfo.getOrCreateArticulation(instrumentId, note);
24328
- else if (note.beat.voice.bar.staff.isPercussion && isPitched) {
24350
+ if (!isPitched) {
24351
+ note.percussionArticulation = trackInfo.getOrCreateArticulation(instrumentId ?? "", note);
24352
+ return;
24353
+ }
24354
+ if (instrumentId !== null && trackInfo.isUnpitchedInstrument(instrumentId)) note.percussionArticulation = trackInfo.getOrCreateArticulation(instrumentId, note);
24355
+ else if (note.beat.voice.bar.staff.isPercussion) {
24329
24356
  const knownArticulation = PercussionMapper.getArticulationById(note.displayValue);
24330
24357
  if (knownArticulation) note.percussionArticulation = knownArticulation.id;
24331
- } else if (!isPitched) note.percussionArticulation = trackInfo.getOrCreateArticulation("", note);
24358
+ }
24332
24359
  }
24333
24360
  _parsePlay(element, note) {
24334
24361
  for (const c of element.childElements()) switch (c.localName) {
@@ -28832,11 +28859,21 @@ class ImporterSettings {
28832
28859
  *
28833
28860
  * * Guitar Pro 7
28834
28861
  * * Guitar Pro 6
28835
- * * Guitar Pro 3-5
28836
28862
  * * MusicXML
28837
28863
  */
28838
28864
  encoding = "utf-8";
28839
28865
  /**
28866
+ * The text encoding to use when decoding strings within GuitarPro3-5 files.
28867
+ * @since 1.9.0
28868
+ * @defaultValue `windows-1252`
28869
+ * @category Importer
28870
+ * @remarks
28871
+ * Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
28872
+ * This is different to the other typically used utf-8 encoding.
28873
+ * Via this setting the Guitar Pro 3-5 specific decoding can be used.
28874
+ */
28875
+ gp3To5encoding = "windows-1252";
28876
+ /**
28840
28877
  * If part-groups should be merged into a single track (MusicXML).
28841
28878
  * @since 0.9.6
28842
28879
  * @defaultValue `false`
@@ -30188,6 +30225,7 @@ class ImporterSettingsSerializer {
30188
30225
  if (!obj) return null;
30189
30226
  const o = /* @__PURE__ */ new Map();
30190
30227
  o.set("encoding", obj.encoding);
30228
+ o.set("gp3to5encoding", obj.gp3To5encoding);
30191
30229
  o.set("mergepartgroupsinmusicxml", obj.mergePartGroupsInMusicXml);
30192
30230
  o.set("beattextaslyrics", obj.beatTextAsLyrics);
30193
30231
  o.set("maxdecodingbuffersize", obj.maxDecodingBufferSize);
@@ -30198,6 +30236,9 @@ class ImporterSettingsSerializer {
30198
30236
  case "encoding":
30199
30237
  obj.encoding = v;
30200
30238
  return true;
30239
+ case "gp3to5encoding":
30240
+ obj.gp3To5encoding = v;
30241
+ return true;
30201
30242
  case "mergepartgroupsinmusicxml":
30202
30243
  obj.mergePartGroupsInMusicXml = v;
30203
30244
  return true;
@@ -42505,6 +42546,7 @@ class AlphaSynthAudioWorkletOutput extends AlphaSynthWebAudioOutputBase {
42505
42546
  play() {
42506
42547
  super.play();
42507
42548
  const ctx = this.context;
42549
+ if (this._pendingEvents) this._pendingEvents = void 0;
42508
42550
  BrowserUiFacade.createAlphaSynthAudioWorklet(ctx, this._settings).then(() => {
42509
42551
  this._worklet = new AudioWorkletNode(ctx, "alphatab", {
42510
42552
  numberOfOutputs: 1,
@@ -44268,8 +44310,8 @@ class MidiFileGenerator {
44268
44310
  }
44269
44311
  const interval = MidiUtils.toTicks(initialDuration);
44270
44312
  if (audioDuration !== interval) return null;
44271
- if (beatStart % interval !== 0) return null;
44272
- if (!beat.nextBeat || beat.nextBeat.voice !== beat.voice || beat.playbackDuration !== interval) return null;
44313
+ if (beatStart % (interval * 2) !== 0) return null;
44314
+ if (!beat.nextBeat || beat.nextBeat.voice !== beat.voice || beat.nextBeat.playbackDuration !== interval || beat.nextBeat.playbackStart !== beatStart + interval) return null;
44273
44315
  const durations = new TripletFeelDurations();
44274
44316
  switch (beat.voice.bar.masterBar.tripletFeel) {
44275
44317
  case TripletFeel.Triplet8th:
@@ -70034,8 +70076,8 @@ class GpifWriter {
70034
70076
  scoreNode.addElement("FirstPageFooter").setCData("");
70035
70077
  scoreNode.addElement("PageHeader").setCData("");
70036
70078
  scoreNode.addElement("PageFooter").setCData("");
70037
- scoreNode.addElement("ScoreSystemsDefaultLayout").setCData(score.defaultSystemsLayout.toString());
70038
- scoreNode.addElement("ScoreSystemsLayout").setCData(score.systemsLayout.join(" "));
70079
+ scoreNode.addElement("ScoreSystemsDefaultLayout").innerText = score.defaultSystemsLayout.toString();
70080
+ scoreNode.addElement("ScoreSystemsLayout").innerText = score.systemsLayout.join(" ");
70039
70081
  scoreNode.addElement("ScoreZoomPolicy").innerText = "Value";
70040
70082
  scoreNode.addElement("ScoreZoom").innerText = "1";
70041
70083
  scoreNode.addElement("MultiVoice").innerText = "1>";
@@ -9836,10 +9836,20 @@ export declare class ImporterSettings {
9836
9836
  *
9837
9837
  * * Guitar Pro 7
9838
9838
  * * Guitar Pro 6
9839
- * * Guitar Pro 3-5
9840
9839
  * * MusicXML
9841
9840
  */
9842
9841
  encoding: string;
9842
+ /**
9843
+ * The text encoding to use when decoding strings within GuitarPro3-5 files.
9844
+ * @since 1.9.0
9845
+ * @defaultValue `windows-1252`
9846
+ * @category Importer
9847
+ * @remarks
9848
+ * Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
9849
+ * This is different to the other typically used utf-8 encoding.
9850
+ * Via this setting the Guitar Pro 3-5 specific decoding can be used.
9851
+ */
9852
+ gp3To5encoding: string;
9843
9853
  /**
9844
9854
  * If part-groups should be merged into a single track (MusicXML).
9845
9855
  * @since 0.9.6
@@ -9913,10 +9923,20 @@ declare interface ImporterSettingsJson {
9913
9923
  *
9914
9924
  * * Guitar Pro 7
9915
9925
  * * Guitar Pro 6
9916
- * * Guitar Pro 3-5
9917
9926
  * * MusicXML
9918
9927
  */
9919
9928
  encoding?: string;
9929
+ /**
9930
+ * The text encoding to use when decoding strings within GuitarPro3-5 files.
9931
+ * @since 1.9.0
9932
+ * @defaultValue `windows-1252`
9933
+ * @category Importer
9934
+ * @remarks
9935
+ * Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
9936
+ * This is different to the other typically used utf-8 encoding.
9937
+ * Via this setting the Guitar Pro 3-5 specific decoding can be used.
9938
+ */
9939
+ gp3To5encoding?: string;
9920
9940
  /**
9921
9941
  * If part-groups should be merged into a single track (MusicXML).
9922
9942
  * @since 0.9.6