@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.
package/dist/alphaTab.mjs 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
  *
@@ -458,8 +458,8 @@ class MidiUtils {
458
458
  static removeTuplet(ticks, numerator, denominator) {
459
459
  return ((ticks * numerator) / denominator) | 0;
460
460
  }
461
- static dynamicToVelocity(dyn) {
462
- return MidiUtils.MinVelocity + dyn * MidiUtils.VelocityIncrement;
461
+ static dynamicToVelocity(dynamicsSteps) {
462
+ return MidiUtils.MinVelocity + dynamicsSteps * MidiUtils.VelocityIncrement;
463
463
  }
464
464
  }
465
465
  MidiUtils.QuarterTime = 960;
@@ -17719,7 +17719,7 @@ class AlphaSynth {
17719
17719
  checkForFinish() {
17720
17720
  let startTick = 0;
17721
17721
  let endTick = 0;
17722
- if (this.playbackRange) {
17722
+ if (this.playbackRange && this._sequencer.isPlayingMain) {
17723
17723
  startTick = this.playbackRange.startTick;
17724
17724
  endTick = this.playbackRange.endTick;
17725
17725
  }
@@ -22275,8 +22275,7 @@ class AlphaSynthMidiFileHandler {
22275
22275
  const message = new SystemExclusiveEvent(track, tick, SystemCommonType.SystemExclusive, SystemExclusiveEvent.AlphaTabManufacturerId, new Uint8Array([AlphaTabSystemExclusiveEvents.Rest]));
22276
22276
  this._midiFile.addEvent(message);
22277
22277
  }
22278
- addNote(track, start, length, key, dynamicValue, channel) {
22279
- const velocity = MidiUtils.dynamicToVelocity(dynamicValue);
22278
+ addNote(track, start, length, key, velocity, channel) {
22280
22279
  const noteOn = new MidiEvent(track, start, this.makeCommand(MidiEventType.NoteOn, channel), AlphaSynthMidiFileHandler.fixValue(key), AlphaSynthMidiFileHandler.fixValue(velocity));
22281
22280
  this._midiFile.addEvent(noteOn);
22282
22281
  const noteOff = new MidiEvent(track, start + length, this.makeCommand(MidiEventType.NoteOff, channel), AlphaSynthMidiFileHandler.fixValue(key), AlphaSynthMidiFileHandler.fixValue(velocity));
@@ -23244,7 +23243,7 @@ class MidiFileGenerator {
23244
23243
  noteDuration.untilTieOrSlideEnd -= brushOffset;
23245
23244
  noteDuration.noteOnly -= brushOffset;
23246
23245
  noteDuration.letRingEnd -= brushOffset;
23247
- const dynamicValue = MidiFileGenerator.getDynamicValue(note);
23246
+ const velocity = MidiFileGenerator.getNoteVelocity(note);
23248
23247
  const channel = note.hasBend || note.beat.hasWhammyBar || note.beat.vibrato !== VibratoType.None
23249
23248
  ? track.playbackInfo.secondaryChannel
23250
23249
  : track.playbackInfo.primaryChannel;
@@ -23273,14 +23272,14 @@ class MidiFileGenerator {
23273
23272
  //
23274
23273
  // Trill
23275
23274
  if (note.isTrill && !staff.isPercussion) {
23276
- this.generateTrill(note, noteStart, noteDuration, noteKey, dynamicValue, channel);
23275
+ this.generateTrill(note, noteStart, noteDuration, noteKey, velocity, channel);
23277
23276
  // no further generation needed
23278
23277
  return;
23279
23278
  }
23280
23279
  //
23281
23280
  // Tremolo Picking
23282
23281
  if (note.beat.isTremolo) {
23283
- this.generateTremoloPicking(note, noteStart, noteDuration, noteKey, dynamicValue, channel);
23282
+ this.generateTremoloPicking(note, noteStart, noteDuration, noteKey, velocity, channel);
23284
23283
  // no further generation needed
23285
23284
  return;
23286
23285
  }
@@ -23293,7 +23292,7 @@ class MidiFileGenerator {
23293
23292
  this.generateWhammy(note.beat, noteStart, noteDuration, channel);
23294
23293
  }
23295
23294
  else if (note.slideInType !== SlideInType.None || note.slideOutType !== SlideOutType.None) {
23296
- this.generateSlide(note, noteStart, noteDuration, noteKey, dynamicValue, channel);
23295
+ this.generateSlide(note, noteStart, noteDuration, noteKey, channel);
23297
23296
  }
23298
23297
  else if (note.vibrato !== VibratoType.None || (note.isTieDestination && note.tieOrigin.vibrato !== VibratoType.None)) {
23299
23298
  this.generateVibrato(note, noteStart, noteDuration, noteKey, channel);
@@ -23302,7 +23301,7 @@ class MidiFileGenerator {
23302
23301
  // the previous one is extended
23303
23302
  if (!note.isTieDestination && (!note.slideOrigin || note.slideOrigin.slideOutType !== SlideOutType.Legato)) {
23304
23303
  let noteSoundDuration = Math.max(noteDuration.untilTieOrSlideEnd, noteDuration.letRingEnd);
23305
- this._handler.addNote(track.index, noteStart, noteSoundDuration, noteKey, dynamicValue, channel);
23304
+ this._handler.addNote(track.index, noteStart, noteSoundDuration, noteKey, velocity, channel);
23306
23305
  }
23307
23306
  }
23308
23307
  getNoteDuration(note, duration) {
@@ -23396,7 +23395,7 @@ class MidiFileGenerator {
23396
23395
  const value = ((this._currentTempo * duration) / BendPoint.MaxPosition) | 0;
23397
23396
  return Math.min(value, maximum);
23398
23397
  }
23399
- static getDynamicValue(note) {
23398
+ static getNoteVelocity(note) {
23400
23399
  let dynamicValue = note.dynamics;
23401
23400
  // more silent on hammer destination
23402
23401
  if (!note.beat.voice.bar.staff.isPercussion && note.hammerPullOrigin) {
@@ -23415,10 +23414,7 @@ class MidiFileGenerator {
23415
23414
  dynamicValue += 2;
23416
23415
  break;
23417
23416
  }
23418
- if (dynamicValue < 0) {
23419
- dynamicValue = 0;
23420
- }
23421
- return dynamicValue;
23417
+ return MidiUtils.dynamicToVelocity(dynamicValue);
23422
23418
  }
23423
23419
  generateFadeIn(note, noteStart, noteDuration) {
23424
23420
  const track = note.beat.voice.bar.staff.track;
@@ -23485,7 +23481,7 @@ class MidiFileGenerator {
23485
23481
  // bend values are 1/4 notes therefore we only take half a semitone value per bend value
23486
23482
  return SynthConstants.DefaultPitchWheel + (bendValue / 2) * MidiFileGenerator.PitchValuePerSemitone;
23487
23483
  }
23488
- generateSlide(note, noteStart, noteDuration, noteKey, dynamicValue, channel) {
23484
+ generateSlide(note, noteStart, noteDuration, noteKey, channel) {
23489
23485
  let duration = note.slideOutType === SlideOutType.Legato ? noteDuration.noteOnly : noteDuration.untilTieOrSlideEnd;
23490
23486
  let playedBendPoints = [];
23491
23487
  let track = note.beat.voice.bar.staff.track;
@@ -27089,7 +27085,11 @@ class BrowserUiFacade {
27089
27085
  // missing result or result not matching layout -> request render
27090
27086
  if (placeholder.renderedResultId !== placeholder.layoutResultId) {
27091
27087
  if (this._resultIdToElementLookup.has(placeholder.layoutResultId)) {
27092
- this._api.renderer.renderResult(placeholder.layoutResultId);
27088
+ if (placeholder.resultState !== ResultState.RenderRequested) {
27089
+ Logger.warning('Rendering', 'Outside Request render of lazy partial ' + placeholder.layoutResultId);
27090
+ placeholder.resultState = ResultState.RenderRequested;
27091
+ this._api.renderer.renderResult(placeholder.layoutResultId);
27092
+ }
27093
27093
  }
27094
27094
  else {
27095
27095
  htmlElement.replaceChildren();
@@ -41390,8 +41390,8 @@ class CoreSettings {
41390
41390
  // </auto-generated>
41391
41391
  class VersionInfo {
41392
41392
  }
41393
- VersionInfo.version = '1.3.0-alpha.605';
41394
- VersionInfo.date = '2023-04-11T01:36:41.857Z';
41393
+ VersionInfo.version = '1.3.0-alpha.607';
41394
+ VersionInfo.date = '2023-04-12T09:02:19.552Z';
41395
41395
 
41396
41396
  var index$5 = /*#__PURE__*/Object.freeze({
41397
41397
  __proto__: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderline/alphatab",
3
- "version": "1.3.0-alpha.605",
3
+ "version": "1.3.0-alpha.607",
4
4
  "description": "alphaTab is a music notation and guitar tablature rendering library",
5
5
  "keywords": [
6
6
  "guitar",