Browse Source

fix(Metronome): Fix first beat sound in mid-measure (#81) when new measure's time signature not read correctly

E.g. when the time signature changed from 4/4 to 6/4, sometimes, you'd get a "first beat click sound" on beat 5 in the 6/4 measure.
sschmidTU 2 years ago
parent
commit
7686f224a8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Playback/PlaybackManager.ts

+ 2 - 2
src/Playback/PlaybackManager.ts

@@ -619,8 +619,8 @@ export class PlaybackManager implements IPlaybackParametersListener {
                         // set current measure to the new measure
                         this.currentMeasure = this.cursorIterator.CurrentMeasure;
 
-                        this.startRhythmBeats = this.cursorIterator.currentPlaybackSettings().Rhythm.Numerator;
-                        this.startRhythmDenominator = this.cursorIterator.currentPlaybackSettings().Rhythm.Denominator;
+                        this.startRhythmBeats = this.currentMeasure.ActiveTimeSignature.Numerator;
+                        this.startRhythmDenominator = this.currentMeasure.ActiveTimeSignature.Denominator;
 
                         // get the enrolled timestamp of this measure start:
                         const relativeToMeasureTimestamp: Fraction = this.cursorIterator.CurrentRelativeInMeasureTimestamp;