ソースを参照

fix(BPM): Fix measure bpm changes not affecting playback speed/bpm (#57, 58)

PR #58, fixes #57

* fix: respect the bpm change on the score

* refactor

Co-authored-by: sschmidTU <s.schmid@phonicscore.com>
inital fix/PR by Elitebigboss90
Elitebigboss90 3 年 前
コミット
cc99e76248
1 ファイル変更5 行追加0 行削除
  1. 5 0
      src/Playback/PlaybackManager.ts

+ 5 - 0
src/Playback/PlaybackManager.ts

@@ -607,6 +607,11 @@ export class PlaybackManager implements IPlaybackParametersListener {
                         // calculate the new beat duration
                         this.currentBeatDuration = new Fraction(1, this.currentMeasure.Duration.Denominator);
 
+                        const currentMeasureBPM: number = this.currentMeasure.TempoInBPM;
+                        if(currentMeasureBPM !== this.currentBPM){
+                            this.bpmChanged(currentMeasureBPM); // update playback speed/bpm
+                        }
+
                         // calculate which beat is next:
                         const relativeNextMetronomeBeatTimestamp: Fraction = new Fraction();
                         this.beatCounter = 0;