Skip to content

Commit 2c2a472

Browse files
committed
fix #14678
1 parent 458a640 commit 2c2a472

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/notation/internal/masternotation.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,37 +413,48 @@ void MasterNotation::applyOptions(mu::engraving::MasterScore* score, const Score
413413
QString text("<sym>metNoteQuarterUp</sym> = %1");
414414
double bpm = scoreOptions.tempo.valueBpm;
415415

416+
double quarterNotesPerDuration = 1;
417+
416418
bool withDot = scoreOptions.tempo.withDot;
417419
switch (scoreOptions.tempo.duration) {
418420
case DurationType::V_WHOLE:
419421
text = "<sym>metNoteWhole</sym> = %1";
422+
quarterNotesPerDuration = 4;
420423
break;
421424
case DurationType::V_HALF:
422425
if (withDot) {
423426
text = "<sym>metNoteHalfUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1";
427+
quarterNotesPerDuration = 3;
424428
} else {
425429
text = "<sym>metNoteHalfUp</sym> = %1";
430+
quarterNotesPerDuration = 2;
426431
}
427432
break;
428433
case DurationType::V_QUARTER:
429434
if (withDot) {
430435
text = "<sym>metNoteQuarterUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1";
436+
quarterNotesPerDuration = 1.5;
431437
} else {
432438
text = "<sym>metNoteQuarterUp</sym> = %1";
439+
quarterNotesPerDuration = 1;
433440
}
434441
break;
435442
case DurationType::V_EIGHTH:
436443
if (withDot) {
437444
text = "<sym>metNote8thUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1";
445+
quarterNotesPerDuration = 0.75;
438446
} else {
439447
text = "<sym>metNote8thUp</sym> = %1";
448+
quarterNotesPerDuration = 0.5;
440449
}
441450
break;
442451
case DurationType::V_16TH:
443452
if (withDot) {
444453
text = "<sym>metNote16thUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1";
454+
quarterNotesPerDuration = 0.375;
445455
} else {
446456
text = "<sym>metNote16thUp</sym> = %1";
457+
quarterNotesPerDuration = 0.25;
447458
}
448459
break;
449460
default:
@@ -455,6 +466,7 @@ void MasterNotation::applyOptions(mu::engraving::MasterScore* score, const Score
455466
tt->setXmlText(text.arg(bpm));
456467

457468
double tempo = scoreOptions.tempo.valueBpm;
469+
tempo *= quarterNotesPerDuration; // setTempo expects a value in Quarter Notes Per Second
458470
tempo /= 60; // bpm -> bps
459471

460472
tt->setTempo(tempo);

0 commit comments

Comments
 (0)