MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / updateDurations

Method updateDurations

packages/alphatab/src/model/Beat.ts:863–895  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

861 }
862
863 public updateDurations(): void {
864 const ticks: number = this._calculateDuration();
865 this.playbackDuration = ticks;
866
867 switch (this.graceType) {
868 case GraceType.BeforeBeat:
869 case GraceType.OnBeat:
870 switch (this.duration) {
871 case Duration.Sixteenth:
872 this.playbackDuration = MidiUtils.toTicks(Duration.SixtyFourth);
873 break;
874 case Duration.ThirtySecond:
875 this.playbackDuration = MidiUtils.toTicks(Duration.OneHundredTwentyEighth);
876 break;
877 default:
878 this.playbackDuration = MidiUtils.toTicks(Duration.ThirtySecond);
879 break;
880 }
881 this.displayDuration = 0;
882 break;
883 case GraceType.BendGrace:
884 this.playbackDuration /= 2;
885 this.displayDuration = 0;
886 break;
887 default:
888 this.displayDuration = ticks;
889 const previous: Beat | null = this.previousBeat;
890 if (previous && previous.graceType === GraceType.BendGrace) {
891 this.playbackDuration = previous.playbackDuration;
892 }
893 break;
894 }
895 }
896
897 public finishTuplet(): void {
898 const previousBeat: Beat | null = this.previousBeat;

Callers 6

_parseVoiceMethod · 0.95
ensureBeatMethod · 0.95
_createRestForGapMethod · 0.95
finishMethod · 0.95
_applyBrushMethod · 0.80

Calls 2

_calculateDurationMethod · 0.95
toTicksMethod · 0.80

Tested by

no test coverage detected