@coderline/alphatab 1.3.0-alpha.605 → 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.
@@ -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 dynamicValue The dynamic which should be applied to the note.
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, dynamicValue: DynamicValue, channel: number): void;
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 getDynamicValue;
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, dynamicValue: DynamicValue, channel: number): void;
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.605 (develop, build 605)
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(dyn) {
468
- return MidiUtils.MinVelocity + dyn * MidiUtils.VelocityIncrement;
467
+ static dynamicToVelocity(dynamicsSteps) {
468
+ return MidiUtils.MinVelocity + dynamicsSteps * MidiUtils.VelocityIncrement;
469
469
  }
470
470
  }
471
471
  MidiUtils.QuarterTime = 960;
@@ -17725,7 +17725,7 @@
17725
17725
  checkForFinish() {
17726
17726
  let startTick = 0;
17727
17727
  let endTick = 0;
17728
- if (this.playbackRange) {
17728
+ if (this.playbackRange && this._sequencer.isPlayingMain) {
17729
17729
  startTick = this.playbackRange.startTick;
17730
17730
  endTick = this.playbackRange.endTick;
17731
17731
  }
@@ -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, dynamicValue, channel) {
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 dynamicValue = MidiFileGenerator.getDynamicValue(note);
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, dynamicValue, channel);
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, dynamicValue, channel);
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, dynamicValue, channel);
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, dynamicValue, channel);
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 getDynamicValue(note) {
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
- if (dynamicValue < 0) {
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, dynamicValue, channel) {
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;
@@ -27095,7 +27091,11 @@
27095
27091
  // missing result or result not matching layout -> request render
27096
27092
  if (placeholder.renderedResultId !== placeholder.layoutResultId) {
27097
27093
  if (this._resultIdToElementLookup.has(placeholder.layoutResultId)) {
27098
- this._api.renderer.renderResult(placeholder.layoutResultId);
27094
+ if (placeholder.resultState !== ResultState.RenderRequested) {
27095
+ Logger.warning('Rendering', 'Outside Request render of lazy partial ' + placeholder.layoutResultId);
27096
+ placeholder.resultState = ResultState.RenderRequested;
27097
+ this._api.renderer.renderResult(placeholder.layoutResultId);
27098
+ }
27099
27099
  }
27100
27100
  else {
27101
27101
  htmlElement.replaceChildren();
@@ -41396,8 +41396,8 @@
41396
41396
  // </auto-generated>
41397
41397
  class VersionInfo {
41398
41398
  }
41399
- VersionInfo.version = '1.3.0-alpha.605';
41400
- VersionInfo.date = '2023-04-11T01:36:41.857Z';
41399
+ VersionInfo.version = '1.3.0-alpha.607';
41400
+ VersionInfo.date = '2023-04-12T09:02:19.552Z';
41401
41401
 
41402
41402
  var index$5 = /*#__PURE__*/Object.freeze({
41403
41403
  __proto__: null,