@coderline/alphatab 1.3.0-alpha.606 → 1.3.0-alpha.607
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.d.ts +4 -4
- package/dist/alphaTab.js +14 -18
- package/dist/alphaTab.min.js +2 -2
- package/dist/alphaTab.min.mjs +2 -2
- package/dist/alphaTab.mjs +14 -18
- package/package.json +1 -1
package/dist/alphaTab.d.ts
CHANGED
|
@@ -5424,10 +5424,10 @@ interface IMidiFileHandler {
|
|
|
5424
5424
|
* @param start The midi ticks when the note should start playing.
|
|
5425
5425
|
* @param length The duration the note in midi ticks.
|
|
5426
5426
|
* @param key The key of the note to play
|
|
5427
|
-
* @param
|
|
5427
|
+
* @param velocity The velocity which should be applied to the note (derived from the note dynamics).
|
|
5428
5428
|
* @param channel The midi channel on which the note should be played.
|
|
5429
5429
|
*/
|
|
5430
|
-
addNote(track: number, start: number, length: number, key: number,
|
|
5430
|
+
addNote(track: number, start: number, length: number, key: number, velocity: number, channel: number): void;
|
|
5431
5431
|
/**
|
|
5432
5432
|
* Adds a control change to the generated midi file.
|
|
5433
5433
|
* @param track The midi track on which the controller should change.
|
|
@@ -5520,7 +5520,7 @@ declare class MidiFileGenerator {
|
|
|
5520
5520
|
private generateNote;
|
|
5521
5521
|
private getNoteDuration;
|
|
5522
5522
|
private applyStaticDuration;
|
|
5523
|
-
private static
|
|
5523
|
+
private static getNoteVelocity;
|
|
5524
5524
|
private generateFadeIn;
|
|
5525
5525
|
private generateVibrato;
|
|
5526
5526
|
vibratoResolution: number;
|
|
@@ -5574,7 +5574,7 @@ declare class AlphaSynthMidiFileHandler implements IMidiFileHandler {
|
|
|
5574
5574
|
constructor(midiFile: MidiFile);
|
|
5575
5575
|
addTimeSignature(tick: number, timeSignatureNumerator: number, timeSignatureDenominator: number): void;
|
|
5576
5576
|
addRest(track: number, tick: number, channel: number): void;
|
|
5577
|
-
addNote(track: number, start: number, length: number, key: number,
|
|
5577
|
+
addNote(track: number, start: number, length: number, key: number, velocity: number, channel: number): void;
|
|
5578
5578
|
private makeCommand;
|
|
5579
5579
|
private static fixValue;
|
|
5580
5580
|
addControlChange(track: number, tick: number, channel: number, controller: number, value: number): void;
|
package/dist/alphaTab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* alphaTab v1.3.0-alpha.
|
|
2
|
+
* alphaTab v1.3.0-alpha.607 (develop, build 607)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2023, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -464,8 +464,8 @@
|
|
|
464
464
|
static removeTuplet(ticks, numerator, denominator) {
|
|
465
465
|
return ((ticks * numerator) / denominator) | 0;
|
|
466
466
|
}
|
|
467
|
-
static dynamicToVelocity(
|
|
468
|
-
return MidiUtils.MinVelocity +
|
|
467
|
+
static dynamicToVelocity(dynamicsSteps) {
|
|
468
|
+
return MidiUtils.MinVelocity + dynamicsSteps * MidiUtils.VelocityIncrement;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
MidiUtils.QuarterTime = 960;
|
|
@@ -22281,8 +22281,7 @@
|
|
|
22281
22281
|
const message = new SystemExclusiveEvent(track, tick, SystemCommonType.SystemExclusive, SystemExclusiveEvent.AlphaTabManufacturerId, new Uint8Array([AlphaTabSystemExclusiveEvents.Rest]));
|
|
22282
22282
|
this._midiFile.addEvent(message);
|
|
22283
22283
|
}
|
|
22284
|
-
addNote(track, start, length, key,
|
|
22285
|
-
const velocity = MidiUtils.dynamicToVelocity(dynamicValue);
|
|
22284
|
+
addNote(track, start, length, key, velocity, channel) {
|
|
22286
22285
|
const noteOn = new MidiEvent(track, start, this.makeCommand(MidiEventType.NoteOn, channel), AlphaSynthMidiFileHandler.fixValue(key), AlphaSynthMidiFileHandler.fixValue(velocity));
|
|
22287
22286
|
this._midiFile.addEvent(noteOn);
|
|
22288
22287
|
const noteOff = new MidiEvent(track, start + length, this.makeCommand(MidiEventType.NoteOff, channel), AlphaSynthMidiFileHandler.fixValue(key), AlphaSynthMidiFileHandler.fixValue(velocity));
|
|
@@ -23250,7 +23249,7 @@
|
|
|
23250
23249
|
noteDuration.untilTieOrSlideEnd -= brushOffset;
|
|
23251
23250
|
noteDuration.noteOnly -= brushOffset;
|
|
23252
23251
|
noteDuration.letRingEnd -= brushOffset;
|
|
23253
|
-
const
|
|
23252
|
+
const velocity = MidiFileGenerator.getNoteVelocity(note);
|
|
23254
23253
|
const channel = note.hasBend || note.beat.hasWhammyBar || note.beat.vibrato !== VibratoType.None
|
|
23255
23254
|
? track.playbackInfo.secondaryChannel
|
|
23256
23255
|
: track.playbackInfo.primaryChannel;
|
|
@@ -23279,14 +23278,14 @@
|
|
|
23279
23278
|
//
|
|
23280
23279
|
// Trill
|
|
23281
23280
|
if (note.isTrill && !staff.isPercussion) {
|
|
23282
|
-
this.generateTrill(note, noteStart, noteDuration, noteKey,
|
|
23281
|
+
this.generateTrill(note, noteStart, noteDuration, noteKey, velocity, channel);
|
|
23283
23282
|
// no further generation needed
|
|
23284
23283
|
return;
|
|
23285
23284
|
}
|
|
23286
23285
|
//
|
|
23287
23286
|
// Tremolo Picking
|
|
23288
23287
|
if (note.beat.isTremolo) {
|
|
23289
|
-
this.generateTremoloPicking(note, noteStart, noteDuration, noteKey,
|
|
23288
|
+
this.generateTremoloPicking(note, noteStart, noteDuration, noteKey, velocity, channel);
|
|
23290
23289
|
// no further generation needed
|
|
23291
23290
|
return;
|
|
23292
23291
|
}
|
|
@@ -23299,7 +23298,7 @@
|
|
|
23299
23298
|
this.generateWhammy(note.beat, noteStart, noteDuration, channel);
|
|
23300
23299
|
}
|
|
23301
23300
|
else if (note.slideInType !== SlideInType.None || note.slideOutType !== SlideOutType.None) {
|
|
23302
|
-
this.generateSlide(note, noteStart, noteDuration, noteKey,
|
|
23301
|
+
this.generateSlide(note, noteStart, noteDuration, noteKey, channel);
|
|
23303
23302
|
}
|
|
23304
23303
|
else if (note.vibrato !== VibratoType.None || (note.isTieDestination && note.tieOrigin.vibrato !== VibratoType.None)) {
|
|
23305
23304
|
this.generateVibrato(note, noteStart, noteDuration, noteKey, channel);
|
|
@@ -23308,7 +23307,7 @@
|
|
|
23308
23307
|
// the previous one is extended
|
|
23309
23308
|
if (!note.isTieDestination && (!note.slideOrigin || note.slideOrigin.slideOutType !== SlideOutType.Legato)) {
|
|
23310
23309
|
let noteSoundDuration = Math.max(noteDuration.untilTieOrSlideEnd, noteDuration.letRingEnd);
|
|
23311
|
-
this._handler.addNote(track.index, noteStart, noteSoundDuration, noteKey,
|
|
23310
|
+
this._handler.addNote(track.index, noteStart, noteSoundDuration, noteKey, velocity, channel);
|
|
23312
23311
|
}
|
|
23313
23312
|
}
|
|
23314
23313
|
getNoteDuration(note, duration) {
|
|
@@ -23402,7 +23401,7 @@
|
|
|
23402
23401
|
const value = ((this._currentTempo * duration) / BendPoint.MaxPosition) | 0;
|
|
23403
23402
|
return Math.min(value, maximum);
|
|
23404
23403
|
}
|
|
23405
|
-
static
|
|
23404
|
+
static getNoteVelocity(note) {
|
|
23406
23405
|
let dynamicValue = note.dynamics;
|
|
23407
23406
|
// more silent on hammer destination
|
|
23408
23407
|
if (!note.beat.voice.bar.staff.isPercussion && note.hammerPullOrigin) {
|
|
@@ -23421,10 +23420,7 @@
|
|
|
23421
23420
|
dynamicValue += 2;
|
|
23422
23421
|
break;
|
|
23423
23422
|
}
|
|
23424
|
-
|
|
23425
|
-
dynamicValue = 0;
|
|
23426
|
-
}
|
|
23427
|
-
return dynamicValue;
|
|
23423
|
+
return MidiUtils.dynamicToVelocity(dynamicValue);
|
|
23428
23424
|
}
|
|
23429
23425
|
generateFadeIn(note, noteStart, noteDuration) {
|
|
23430
23426
|
const track = note.beat.voice.bar.staff.track;
|
|
@@ -23491,7 +23487,7 @@
|
|
|
23491
23487
|
// bend values are 1/4 notes therefore we only take half a semitone value per bend value
|
|
23492
23488
|
return SynthConstants.DefaultPitchWheel + (bendValue / 2) * MidiFileGenerator.PitchValuePerSemitone;
|
|
23493
23489
|
}
|
|
23494
|
-
generateSlide(note, noteStart, noteDuration, noteKey,
|
|
23490
|
+
generateSlide(note, noteStart, noteDuration, noteKey, channel) {
|
|
23495
23491
|
let duration = note.slideOutType === SlideOutType.Legato ? noteDuration.noteOnly : noteDuration.untilTieOrSlideEnd;
|
|
23496
23492
|
let playedBendPoints = [];
|
|
23497
23493
|
let track = note.beat.voice.bar.staff.track;
|
|
@@ -41400,8 +41396,8 @@
|
|
|
41400
41396
|
// </auto-generated>
|
|
41401
41397
|
class VersionInfo {
|
|
41402
41398
|
}
|
|
41403
|
-
VersionInfo.version = '1.3.0-alpha.
|
|
41404
|
-
VersionInfo.date = '2023-04-
|
|
41399
|
+
VersionInfo.version = '1.3.0-alpha.607';
|
|
41400
|
+
VersionInfo.date = '2023-04-12T09:02:19.552Z';
|
|
41405
41401
|
|
|
41406
41402
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
41407
41403
|
__proto__: null,
|