Skip to content

Commit

Permalink
Implementation for issue humdrum-tools/verovio-humdrum-viewer#864
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Oct 27, 2023
1 parent 03c2d2f commit e671927
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/iohumdrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6834,6 +6834,7 @@ void HumdrumInput::setTimeSig(StaffDef *part, const std::string &timesig, const
mensuration = true;
}

hum::HumRegex hre;
int top = -1000;
int bot = -1000;
int bot2 = -1000;
Expand Down Expand Up @@ -6872,6 +6873,20 @@ void HumdrumInput::setTimeSig(StaffDef *part, const std::string &timesig, const
vrvmeter->SetUnit(bot);
vrvmeter->SetForm(METERFORM_num);
}
else if (hre.search(metersig, "^(\\d+)$")) {
int value = hre.getMatchInt(1);
vrvmeter->SetCount({ { value }, MeterCountSign::None });
if (bot > 0) {
vrvmeter->SetUnit(bot);
}
else {
// Borrow bottom of time signature if available, otherwise
// assume a quarter note unit for now:
vrvmeter->SetUnit(4);
}
vrvmeter->SetForm(METERFORM_num);
}

else {
vrvmeter->SetCount({ { top }, MeterCountSign::None });
vrvmeter->SetUnit(bot);
Expand Down

0 comments on commit e671927

Please sign in to comment.