瀏覽代碼

fix(Tempo): handle bpm given like "half note =" properly (#74)

previously, this would have half the bpm starting in measure 2 for half note = 64 (64 instead of 128)
sschmidTU 3 年之前
父節點
當前提交
95a291a10e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/MusicalScore/ScoreIO/MusicSymbolModules/ExpressionReader.ts

+ 8 - 0
src/MusicalScore/ScoreIO/MusicSymbolModules/ExpressionReader.ts

@@ -201,7 +201,15 @@ export class ExpressionReader {
                                                      this.currentMultiTempoExpression,
                                                      true);
                 instantaneousTempoExpression.parentMeasure = currentMeasure;
+
                 this.soundTempo = bpmNumber;
+                if (beatUnit.value === "half") {
+                    this.soundTempo *= 2;
+                    // TODO better handling: keep as is instead of converting to quarter bpm,
+                    //   respect PlaybackSettings.beatRealValue
+                }
+                // TODO handle other beatUnit values
+
                 // make sure to take dotted beats into account
                 currentMeasure.TempoInBPM = this.soundTempo * (dotted?1.5:1);
                 if (this.musicSheet.DefaultStartTempoInBpm === 0) {