@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.
- package/dist/alphaTab.core.min.mjs +2 -2
- package/dist/alphaTab.core.mjs +112 -70
- package/dist/alphaTab.d.ts +22 -2
- package/dist/alphaTab.js +112 -70
- package/dist/alphaTab.min.js +2 -2
- package/dist/alphaTab.min.mjs +1 -1
- package/dist/alphaTab.mjs +1 -1
- package/dist/alphaTab.worker.min.mjs +1 -1
- package/dist/alphaTab.worker.mjs +1 -1
- package/dist/alphaTab.worklet.min.mjs +1 -1
- package/dist/alphaTab.worklet.mjs +1 -1
- package/package.json +2 -2
package/dist/alphaTab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab v1.9.0-alpha.
|
|
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
|
*
|
|
@@ -190,9 +190,9 @@
|
|
|
190
190
|
* @internal
|
|
191
191
|
*/
|
|
192
192
|
var VersionInfo = class VersionInfo {
|
|
193
|
-
static version = "1.9.0-alpha.
|
|
194
|
-
static date = "2026-07-
|
|
195
|
-
static commit = "
|
|
193
|
+
static version = "1.9.0-alpha.1860";
|
|
194
|
+
static date = "2026-07-10T14:22:26.590Z";
|
|
195
|
+
static commit = "1efc2ecc10ca13f2bfbec400427822dc4bdfc160";
|
|
196
196
|
static print(print) {
|
|
197
197
|
print(`alphaTab ${VersionInfo.version}`);
|
|
198
198
|
print(`commit: ${VersionInfo.commit}`);
|
|
@@ -18191,18 +18191,24 @@
|
|
|
18191
18191
|
_lyrics = [];
|
|
18192
18192
|
_barCount = 0;
|
|
18193
18193
|
_trackCount = 0;
|
|
18194
|
-
|
|
18194
|
+
/**
|
|
18195
|
+
* For 4 ports, 16 channels of information
|
|
18196
|
+
*/
|
|
18197
|
+
_midiChannelInfo = [];
|
|
18195
18198
|
_doubleBars = /* @__PURE__ */ new Set();
|
|
18196
18199
|
_clefsPerTrack = /* @__PURE__ */ new Map();
|
|
18197
18200
|
_keySignatures = /* @__PURE__ */ new Map();
|
|
18198
18201
|
_beatTextChunksByTrack = /* @__PURE__ */ new Map();
|
|
18199
18202
|
_directionLookup = /* @__PURE__ */ new Map();
|
|
18200
18203
|
_initialTempo;
|
|
18204
|
+
_stringEncoding = "";
|
|
18201
18205
|
get name() {
|
|
18202
18206
|
return "Guitar Pro 3-5";
|
|
18203
18207
|
}
|
|
18204
18208
|
readScore() {
|
|
18205
18209
|
this._directionLookup.clear();
|
|
18210
|
+
if (this.settings.importer.encoding !== "utf-8") this._stringEncoding = this.settings.importer.encoding;
|
|
18211
|
+
else this._stringEncoding = this.settings.importer.gp3To5encoding;
|
|
18206
18212
|
this.readVersion();
|
|
18207
18213
|
this._score = new Score();
|
|
18208
18214
|
this.readScoreInformation();
|
|
@@ -18212,7 +18218,7 @@
|
|
|
18212
18218
|
this._initialTempo = Automation.buildTempoAutomation(false, 0, 0, 0);
|
|
18213
18219
|
if (this._versionNumber >= 500) {
|
|
18214
18220
|
this.readPageSetup();
|
|
18215
|
-
this._initialTempo.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18221
|
+
this._initialTempo.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18216
18222
|
}
|
|
18217
18223
|
this._initialTempo.value = IOHelper.readInt32LE(this.data);
|
|
18218
18224
|
if (this._versionNumber >= 510) GpBinaryHelpers.gpReadBool(this.data);
|
|
@@ -18271,7 +18277,7 @@
|
|
|
18271
18277
|
directionsList.push(direction);
|
|
18272
18278
|
}
|
|
18273
18279
|
readVersion() {
|
|
18274
|
-
let version = GpBinaryHelpers.gpReadStringByteLength(this.data, 30, this.
|
|
18280
|
+
let version = GpBinaryHelpers.gpReadStringByteLength(this.data, 30, this._stringEncoding);
|
|
18275
18281
|
if (!version.startsWith(Gp3To5Importer._versionString)) throw new UnsupportedFormatError("Unsupported format");
|
|
18276
18282
|
version = version.substr(Gp3To5Importer._versionString.length + 1);
|
|
18277
18283
|
const dot = version.indexOf(String.fromCharCode(46));
|
|
@@ -18279,21 +18285,21 @@
|
|
|
18279
18285
|
Logger.debug(this.name, `Guitar Pro version ${version} detected`);
|
|
18280
18286
|
}
|
|
18281
18287
|
readScoreInformation() {
|
|
18282
|
-
this._score.title = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18283
|
-
this._score.subTitle = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18284
|
-
this._score.artist = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18285
|
-
this._score.album = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18286
|
-
this._score.words = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18287
|
-
this._score.music = this._versionNumber >= 500 ? GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18288
|
-
this._score.copyright = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18289
|
-
this._score.tab = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18290
|
-
this._score.instructions = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18288
|
+
this._score.title = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18289
|
+
this._score.subTitle = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18290
|
+
this._score.artist = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18291
|
+
this._score.album = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18292
|
+
this._score.words = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18293
|
+
this._score.music = this._versionNumber >= 500 ? GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize) : this._score.words;
|
|
18294
|
+
this._score.copyright = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18295
|
+
this._score.tab = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18296
|
+
this._score.instructions = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18291
18297
|
const noticeLines = IOHelper.readInt32LE(this.data);
|
|
18292
18298
|
this._ensureLoopBoundary(noticeLines, Gp3To5Importer._maxNoticeLines, "notice line count");
|
|
18293
18299
|
let notice = "";
|
|
18294
18300
|
for (let i = 0; i < noticeLines; i++) {
|
|
18295
18301
|
if (i > 0) notice += "\r\n";
|
|
18296
|
-
notice += GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18302
|
+
notice += GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize)?.toString();
|
|
18297
18303
|
}
|
|
18298
18304
|
this._score.notices = notice;
|
|
18299
18305
|
}
|
|
@@ -18311,7 +18317,7 @@
|
|
|
18311
18317
|
for (let i = 0; i < 5; i++) {
|
|
18312
18318
|
const lyrics = new Lyrics();
|
|
18313
18319
|
lyrics.startBar = IOHelper.readInt32LE(this.data) - 1;
|
|
18314
|
-
lyrics.text = GpBinaryHelpers.gpReadStringInt(this.data, this.
|
|
18320
|
+
lyrics.text = GpBinaryHelpers.gpReadStringInt(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18315
18321
|
this._lyrics.push(lyrics);
|
|
18316
18322
|
}
|
|
18317
18323
|
}
|
|
@@ -18319,37 +18325,43 @@
|
|
|
18319
18325
|
this.data.skip(28);
|
|
18320
18326
|
const flags = IOHelper.readInt16LE(this.data);
|
|
18321
18327
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).isVisible = (flags & 1) !== 0;
|
|
18322
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18328
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Title).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18323
18329
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).isVisible = (flags & 2) !== 0;
|
|
18324
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18330
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.SubTitle).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18325
18331
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).isVisible = (flags & 4) !== 0;
|
|
18326
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18332
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Artist).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18327
18333
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).isVisible = (flags & 8) !== 0;
|
|
18328
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18334
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Album).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18329
18335
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).isVisible = (flags & 16) !== 0;
|
|
18330
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18336
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Words).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18331
18337
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).isVisible = (flags & 32) !== 0;
|
|
18332
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18338
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Music).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18333
18339
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).isVisible = (flags & 64) !== 0;
|
|
18334
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18340
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.WordsAndMusic).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18335
18341
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).isVisible = (flags & 128) !== 0;
|
|
18336
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18342
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.Copyright).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18337
18343
|
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).isVisible = (flags & 128) !== 0;
|
|
18338
|
-
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18339
|
-
GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18344
|
+
ModelUtils.getOrCreateHeaderFooterStyle(this._score, ScoreSubElement.CopyrightSecondLine).template = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18345
|
+
GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18340
18346
|
}
|
|
18341
18347
|
readPlaybackInfos() {
|
|
18342
|
-
this.
|
|
18343
|
-
let
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
|
|
18352
|
-
|
|
18348
|
+
this._midiChannelInfo = [];
|
|
18349
|
+
for (let port = 0; port < 4; port++) {
|
|
18350
|
+
const portInfo = [];
|
|
18351
|
+
this._midiChannelInfo.push(portInfo);
|
|
18352
|
+
for (let channel = 0; channel < 16; channel++) {
|
|
18353
|
+
const info = {
|
|
18354
|
+
program: IOHelper.readInt32LE(this.data),
|
|
18355
|
+
volume: this.data.readByte(),
|
|
18356
|
+
balance: this.data.readByte(),
|
|
18357
|
+
chorus: this.data.readByte(),
|
|
18358
|
+
reverb: this.data.readByte(),
|
|
18359
|
+
phase: this.data.readByte(),
|
|
18360
|
+
tremolo: this.data.readByte()
|
|
18361
|
+
};
|
|
18362
|
+
this.data.skip(2);
|
|
18363
|
+
portInfo.push(info);
|
|
18364
|
+
}
|
|
18353
18365
|
}
|
|
18354
18366
|
}
|
|
18355
18367
|
readMasterBars() {
|
|
@@ -18386,7 +18398,7 @@
|
|
|
18386
18398
|
}
|
|
18387
18399
|
if ((flags & 32) !== 0) {
|
|
18388
18400
|
const section = new Section();
|
|
18389
|
-
section.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18401
|
+
section.text = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18390
18402
|
section.marker = "";
|
|
18391
18403
|
GpBinaryHelpers.gpReadColor(this.data, false);
|
|
18392
18404
|
newMasterBar.section = section;
|
|
@@ -18425,7 +18437,7 @@
|
|
|
18425
18437
|
this._score.addTrack(newTrack);
|
|
18426
18438
|
const mainStaff = newTrack.staves[0];
|
|
18427
18439
|
const flags = this.data.readByte();
|
|
18428
|
-
newTrack.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 40, this.
|
|
18440
|
+
newTrack.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 40, this._stringEncoding);
|
|
18429
18441
|
if ((flags & 1) !== 0) mainStaff.isPercussion = true;
|
|
18430
18442
|
if (this._versionNumber >= 500) newTrack.isVisibleOnMultiTrack = (flags & 8) !== 0;
|
|
18431
18443
|
if (this._score.stylesheet.perTrackDisplayTuning === null) this._score.stylesheet.perTrackDisplayTuning = /* @__PURE__ */ new Map();
|
|
@@ -18437,19 +18449,22 @@
|
|
|
18437
18449
|
if (stringCount > i) tuning.push(stringTuning);
|
|
18438
18450
|
}
|
|
18439
18451
|
mainStaff.stringTuning.tunings = tuning;
|
|
18440
|
-
const port = IOHelper.readInt32LE(this.data);
|
|
18441
|
-
const
|
|
18452
|
+
const port = IOHelper.readInt32LE(this.data) - 1;
|
|
18453
|
+
const channel = IOHelper.readInt32LE(this.data) - 1;
|
|
18442
18454
|
const effectChannel = IOHelper.readInt32LE(this.data) - 1;
|
|
18443
18455
|
this.data.skip(4);
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
|
|
18451
|
-
|
|
18452
|
-
|
|
18456
|
+
const mainMidiChannelInfo = this._midiChannelInfo[port][channel];
|
|
18457
|
+
const trackPlaybackInfo = new PlaybackInformation();
|
|
18458
|
+
trackPlaybackInfo.volume = mainMidiChannelInfo.volume;
|
|
18459
|
+
trackPlaybackInfo.balance = mainMidiChannelInfo.balance;
|
|
18460
|
+
trackPlaybackInfo.port = port;
|
|
18461
|
+
trackPlaybackInfo.program = mainMidiChannelInfo.program;
|
|
18462
|
+
trackPlaybackInfo.primaryChannel = channel;
|
|
18463
|
+
trackPlaybackInfo.secondaryChannel = effectChannel;
|
|
18464
|
+
trackPlaybackInfo.isSolo = (flags & 16) !== 0;
|
|
18465
|
+
trackPlaybackInfo.isMute = (flags & 32) !== 0;
|
|
18466
|
+
if (GeneralMidi.isGuitar(trackPlaybackInfo.program)) mainStaff.displayTranspositionPitch = -12;
|
|
18467
|
+
newTrack.playbackInfo = trackPlaybackInfo;
|
|
18453
18468
|
mainStaff.capo = IOHelper.readInt32LE(this.data);
|
|
18454
18469
|
newTrack.color = GpBinaryHelpers.gpReadColor(this.data, false);
|
|
18455
18470
|
if (this._versionNumber >= 500) {
|
|
@@ -18473,8 +18488,8 @@
|
|
|
18473
18488
|
this._readRseBank();
|
|
18474
18489
|
if (this._versionNumber >= 510) {
|
|
18475
18490
|
this.data.skip(4);
|
|
18476
|
-
GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18477
|
-
GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18491
|
+
GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18492
|
+
GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18478
18493
|
}
|
|
18479
18494
|
} else if (tuning[tuning.length - 1] < Gp3To5Importer._bassClefTuningThreshold) this._clefsPerTrack.set(newTrack.index, Clef.F4);
|
|
18480
18495
|
else this._clefsPerTrack.set(newTrack.index, Clef.G2);
|
|
@@ -18577,7 +18592,7 @@
|
|
|
18577
18592
|
if ((flags & 2) !== 0) this.readChord(newBeat);
|
|
18578
18593
|
const beatTextAsLyrics = this.settings.importer.beatTextAsLyrics && track.index !== this._lyricsTrack;
|
|
18579
18594
|
if ((flags & 4) !== 0) {
|
|
18580
|
-
const text = GpBinaryHelpers.gpReadStringIntUnused(this.data, this.
|
|
18595
|
+
const text = GpBinaryHelpers.gpReadStringIntUnused(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18581
18596
|
if (beatTextAsLyrics) {
|
|
18582
18597
|
const lyrics = new Lyrics();
|
|
18583
18598
|
lyrics.text = text.trim();
|
|
@@ -18624,7 +18639,7 @@
|
|
|
18624
18639
|
const chordId = ModelUtils.newGuid();
|
|
18625
18640
|
if (this._versionNumber >= 500) {
|
|
18626
18641
|
this.data.skip(17);
|
|
18627
|
-
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this.
|
|
18642
|
+
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this._stringEncoding);
|
|
18628
18643
|
this.data.skip(4);
|
|
18629
18644
|
chord.firstFret = IOHelper.readInt32LE(this.data);
|
|
18630
18645
|
for (let i = 0; i < 7; i++) {
|
|
@@ -18638,7 +18653,7 @@
|
|
|
18638
18653
|
this.data.skip(26);
|
|
18639
18654
|
} else if (this.data.readByte() !== 0) if (this._versionNumber >= 400) {
|
|
18640
18655
|
this.data.skip(16);
|
|
18641
|
-
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this.
|
|
18656
|
+
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 21, this._stringEncoding);
|
|
18642
18657
|
this.data.skip(4);
|
|
18643
18658
|
chord.firstFret = IOHelper.readInt32LE(this.data);
|
|
18644
18659
|
for (let i = 0; i < 7; i++) {
|
|
@@ -18652,7 +18667,7 @@
|
|
|
18652
18667
|
this.data.skip(26);
|
|
18653
18668
|
} else {
|
|
18654
18669
|
this.data.skip(25);
|
|
18655
|
-
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 34, this.
|
|
18670
|
+
chord.name = GpBinaryHelpers.gpReadStringByteLength(this.data, 34, this._stringEncoding);
|
|
18656
18671
|
chord.firstFret = IOHelper.readInt32LE(this.data);
|
|
18657
18672
|
for (let i = 0; i < 6; i++) {
|
|
18658
18673
|
const fret = IOHelper.readInt32LE(this.data);
|
|
@@ -18662,7 +18677,7 @@
|
|
|
18662
18677
|
}
|
|
18663
18678
|
else {
|
|
18664
18679
|
const strings = this._versionNumber >= 406 ? 7 : 6;
|
|
18665
|
-
chord.name = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18680
|
+
chord.name = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18666
18681
|
chord.firstFret = IOHelper.readInt32LE(this.data);
|
|
18667
18682
|
if (chord.firstFret > 0) for (let i = 0; i < strings; i++) {
|
|
18668
18683
|
const fret = IOHelper.readInt32LE(this.data);
|
|
@@ -18782,7 +18797,7 @@
|
|
|
18782
18797
|
const reverb = IOHelper.readSInt8(this.data);
|
|
18783
18798
|
const phaser = IOHelper.readSInt8(this.data);
|
|
18784
18799
|
const tremolo = IOHelper.readSInt8(this.data);
|
|
18785
|
-
if (this._versionNumber >= 500) tableChange.tempoName = GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18800
|
+
if (this._versionNumber >= 500) tableChange.tempoName = GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18786
18801
|
tableChange.tempo = IOHelper.readInt32LE(this.data);
|
|
18787
18802
|
if (tableChange.volume >= 0) this.data.readByte();
|
|
18788
18803
|
if (tableChange.balance >= 0) this.data.readByte();
|
|
@@ -18801,8 +18816,8 @@
|
|
|
18801
18816
|
else if (wahType >= 0) beat.wahPedal = WahPedal.Open;
|
|
18802
18817
|
}
|
|
18803
18818
|
if (this._versionNumber >= 510) {
|
|
18804
|
-
GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18805
|
-
GpBinaryHelpers.gpReadStringIntByte(this.data, this.
|
|
18819
|
+
GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18820
|
+
GpBinaryHelpers.gpReadStringIntByte(this.data, this._stringEncoding, this.settings.importer.maxDecodingBufferSize);
|
|
18806
18821
|
}
|
|
18807
18822
|
if (tableChange.volume >= 0) {
|
|
18808
18823
|
const volumeAutomation = new Automation();
|
|
@@ -22552,6 +22567,10 @@
|
|
|
22552
22567
|
* The balance to use when playing the note (-1 if using the default track balance).
|
|
22553
22568
|
*/
|
|
22554
22569
|
outputBalance = -1;
|
|
22570
|
+
/**
|
|
22571
|
+
* Whether this instrument was declared as an unpitched/percussion sound via `<midi-unpitched>`.
|
|
22572
|
+
*/
|
|
22573
|
+
isUnpitched = false;
|
|
22555
22574
|
};
|
|
22556
22575
|
/**
|
|
22557
22576
|
* @internal
|
|
@@ -22596,6 +22615,9 @@
|
|
|
22596
22615
|
this.track.percussionArticulations.push(newArticulation);
|
|
22597
22616
|
return index;
|
|
22598
22617
|
}
|
|
22618
|
+
isUnpitchedInstrument(instrumentId) {
|
|
22619
|
+
return this.instruments.has(instrumentId) && this.instruments.get(instrumentId).isUnpitched;
|
|
22620
|
+
}
|
|
22599
22621
|
};
|
|
22600
22622
|
/**
|
|
22601
22623
|
* @internal
|
|
@@ -22910,6 +22932,7 @@
|
|
|
22910
22932
|
break;
|
|
22911
22933
|
case "midi-unpitched":
|
|
22912
22934
|
articulation.outputMidiNumber = Number.parseInt(c.innerText, 10) - 1;
|
|
22935
|
+
articulation.isUnpitched = true;
|
|
22913
22936
|
break;
|
|
22914
22937
|
case "volume":
|
|
22915
22938
|
articulation.outputVolume = MusicXmlImporter._interpolatePercent(Number.parseFloat(c.innerText));
|
|
@@ -24328,11 +24351,15 @@
|
|
|
24328
24351
|
note.isVisible = noteIsVisible;
|
|
24329
24352
|
if (note.percussionArticulation >= 0) return;
|
|
24330
24353
|
const trackInfo = this._indexToTrackInfo.get(track.index);
|
|
24331
|
-
if (
|
|
24332
|
-
|
|
24354
|
+
if (!isPitched) {
|
|
24355
|
+
note.percussionArticulation = trackInfo.getOrCreateArticulation(instrumentId ?? "", note);
|
|
24356
|
+
return;
|
|
24357
|
+
}
|
|
24358
|
+
if (instrumentId !== null && trackInfo.isUnpitchedInstrument(instrumentId)) note.percussionArticulation = trackInfo.getOrCreateArticulation(instrumentId, note);
|
|
24359
|
+
else if (note.beat.voice.bar.staff.isPercussion) {
|
|
24333
24360
|
const knownArticulation = PercussionMapper.getArticulationById(note.displayValue);
|
|
24334
24361
|
if (knownArticulation) note.percussionArticulation = knownArticulation.id;
|
|
24335
|
-
}
|
|
24362
|
+
}
|
|
24336
24363
|
}
|
|
24337
24364
|
_parsePlay(element, note) {
|
|
24338
24365
|
for (const c of element.childElements()) switch (c.localName) {
|
|
@@ -28836,11 +28863,21 @@
|
|
|
28836
28863
|
*
|
|
28837
28864
|
* * Guitar Pro 7
|
|
28838
28865
|
* * Guitar Pro 6
|
|
28839
|
-
* * Guitar Pro 3-5
|
|
28840
28866
|
* * MusicXML
|
|
28841
28867
|
*/
|
|
28842
28868
|
encoding = "utf-8";
|
|
28843
28869
|
/**
|
|
28870
|
+
* The text encoding to use when decoding strings within GuitarPro3-5 files.
|
|
28871
|
+
* @since 1.9.0
|
|
28872
|
+
* @defaultValue `windows-1252`
|
|
28873
|
+
* @category Importer
|
|
28874
|
+
* @remarks
|
|
28875
|
+
* Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
|
|
28876
|
+
* This is different to the other typically used utf-8 encoding.
|
|
28877
|
+
* Via this setting the Guitar Pro 3-5 specific decoding can be used.
|
|
28878
|
+
*/
|
|
28879
|
+
gp3To5encoding = "windows-1252";
|
|
28880
|
+
/**
|
|
28844
28881
|
* If part-groups should be merged into a single track (MusicXML).
|
|
28845
28882
|
* @since 0.9.6
|
|
28846
28883
|
* @defaultValue `false`
|
|
@@ -30192,6 +30229,7 @@
|
|
|
30192
30229
|
if (!obj) return null;
|
|
30193
30230
|
const o = /* @__PURE__ */ new Map();
|
|
30194
30231
|
o.set("encoding", obj.encoding);
|
|
30232
|
+
o.set("gp3to5encoding", obj.gp3To5encoding);
|
|
30195
30233
|
o.set("mergepartgroupsinmusicxml", obj.mergePartGroupsInMusicXml);
|
|
30196
30234
|
o.set("beattextaslyrics", obj.beatTextAsLyrics);
|
|
30197
30235
|
o.set("maxdecodingbuffersize", obj.maxDecodingBufferSize);
|
|
@@ -30202,6 +30240,9 @@
|
|
|
30202
30240
|
case "encoding":
|
|
30203
30241
|
obj.encoding = v;
|
|
30204
30242
|
return true;
|
|
30243
|
+
case "gp3to5encoding":
|
|
30244
|
+
obj.gp3To5encoding = v;
|
|
30245
|
+
return true;
|
|
30205
30246
|
case "mergepartgroupsinmusicxml":
|
|
30206
30247
|
obj.mergePartGroupsInMusicXml = v;
|
|
30207
30248
|
return true;
|
|
@@ -42509,6 +42550,7 @@
|
|
|
42509
42550
|
play() {
|
|
42510
42551
|
super.play();
|
|
42511
42552
|
const ctx = this.context;
|
|
42553
|
+
if (this._pendingEvents) this._pendingEvents = void 0;
|
|
42512
42554
|
BrowserUiFacade.createAlphaSynthAudioWorklet(ctx, this._settings).then(() => {
|
|
42513
42555
|
this._worklet = new AudioWorkletNode(ctx, "alphatab", {
|
|
42514
42556
|
numberOfOutputs: 1,
|
|
@@ -44272,8 +44314,8 @@
|
|
|
44272
44314
|
}
|
|
44273
44315
|
const interval = MidiUtils.toTicks(initialDuration);
|
|
44274
44316
|
if (audioDuration !== interval) return null;
|
|
44275
|
-
if (beatStart % interval !== 0) return null;
|
|
44276
|
-
if (!beat.nextBeat || beat.nextBeat.voice !== beat.voice || beat.playbackDuration !== interval) return null;
|
|
44317
|
+
if (beatStart % (interval * 2) !== 0) return null;
|
|
44318
|
+
if (!beat.nextBeat || beat.nextBeat.voice !== beat.voice || beat.nextBeat.playbackDuration !== interval || beat.nextBeat.playbackStart !== beatStart + interval) return null;
|
|
44277
44319
|
const durations = new TripletFeelDurations();
|
|
44278
44320
|
switch (beat.voice.bar.masterBar.tripletFeel) {
|
|
44279
44321
|
case TripletFeel.Triplet8th:
|
|
@@ -70038,8 +70080,8 @@
|
|
|
70038
70080
|
scoreNode.addElement("FirstPageFooter").setCData("");
|
|
70039
70081
|
scoreNode.addElement("PageHeader").setCData("");
|
|
70040
70082
|
scoreNode.addElement("PageFooter").setCData("");
|
|
70041
|
-
scoreNode.addElement("ScoreSystemsDefaultLayout").
|
|
70042
|
-
scoreNode.addElement("ScoreSystemsLayout").
|
|
70083
|
+
scoreNode.addElement("ScoreSystemsDefaultLayout").innerText = score.defaultSystemsLayout.toString();
|
|
70084
|
+
scoreNode.addElement("ScoreSystemsLayout").innerText = score.systemsLayout.join(" ");
|
|
70043
70085
|
scoreNode.addElement("ScoreZoomPolicy").innerText = "Value";
|
|
70044
70086
|
scoreNode.addElement("ScoreZoom").innerText = "1";
|
|
70045
70087
|
scoreNode.addElement("MultiVoice").innerText = "1>";
|