@@ -413,37 +413,48 @@ void MasterNotation::applyOptions(mu::engraving::MasterScore* score, const Score
413
413
QString text (" <sym>metNoteQuarterUp</sym> = %1" );
414
414
double bpm = scoreOptions.tempo .valueBpm ;
415
415
416
+ double quarterNotesPerDuration = 1 ;
417
+
416
418
bool withDot = scoreOptions.tempo .withDot ;
417
419
switch (scoreOptions.tempo .duration ) {
418
420
case DurationType::V_WHOLE:
419
421
text = " <sym>metNoteWhole</sym> = %1" ;
422
+ quarterNotesPerDuration = 4 ;
420
423
break ;
421
424
case DurationType::V_HALF:
422
425
if (withDot) {
423
426
text = " <sym>metNoteHalfUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1" ;
427
+ quarterNotesPerDuration = 3 ;
424
428
} else {
425
429
text = " <sym>metNoteHalfUp</sym> = %1" ;
430
+ quarterNotesPerDuration = 2 ;
426
431
}
427
432
break ;
428
433
case DurationType::V_QUARTER:
429
434
if (withDot) {
430
435
text = " <sym>metNoteQuarterUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1" ;
436
+ quarterNotesPerDuration = 1.5 ;
431
437
} else {
432
438
text = " <sym>metNoteQuarterUp</sym> = %1" ;
439
+ quarterNotesPerDuration = 1 ;
433
440
}
434
441
break ;
435
442
case DurationType::V_EIGHTH:
436
443
if (withDot) {
437
444
text = " <sym>metNote8thUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1" ;
445
+ quarterNotesPerDuration = 0.75 ;
438
446
} else {
439
447
text = " <sym>metNote8thUp</sym> = %1" ;
448
+ quarterNotesPerDuration = 0.5 ;
440
449
}
441
450
break ;
442
451
case DurationType::V_16TH:
443
452
if (withDot) {
444
453
text = " <sym>metNote16thUp</sym><sym>space</sym><sym>metAugmentationDot</sym> = %1" ;
454
+ quarterNotesPerDuration = 0.375 ;
445
455
} else {
446
456
text = " <sym>metNote16thUp</sym> = %1" ;
457
+ quarterNotesPerDuration = 0.25 ;
447
458
}
448
459
break ;
449
460
default :
@@ -455,6 +466,7 @@ void MasterNotation::applyOptions(mu::engraving::MasterScore* score, const Score
455
466
tt->setXmlText (text.arg (bpm));
456
467
457
468
double tempo = scoreOptions.tempo .valueBpm ;
469
+ tempo *= quarterNotesPerDuration; // setTempo expects a value in Quarter Notes Per Second
458
470
tempo /= 60 ; // bpm -> bps
459
471
460
472
tt->setTempo (tempo);
0 commit comments