-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue where some note durations were not clipped
- Loading branch information
1 parent
0a07e11
commit 3002315
Showing
3 changed files
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Aug 8 12:24:49 PDT 2015 | ||
// Last Modified: Di 14 Mär 2023 21:42:31 CET | ||
// Last Modified: Di 14 Mär 2023 22:41:15 CET | ||
// Filename: humlib.h | ||
// URL: https://github.com/craigsapp/humlib/blob/master/include/humlib.h | ||
// Syntax: C++11 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Aug 8 12:24:49 PDT 2015 | ||
// Last Modified: Di 14 Mär 2023 21:42:31 CET | ||
// Last Modified: Di 14 Mär 2023 22:41:15 CET | ||
// Filename: /include/humlib.cpp | ||
// URL: https://github.com/craigsapp/humlib/blob/master/src/humlib.cpp | ||
// Syntax: C++11 | ||
|
@@ -103564,25 +103564,25 @@ void Tool_myank::printDataLine(HLp line, | |
continue; | ||
} | ||
HumNum dur = lastLineDurationsFromNoteStart[i]; | ||
if (resolvedToken->getDuration() > dur) { | ||
HumRegex hre; | ||
string recip = Convert::durationToRecip(dur); | ||
vector<string> subtokens = resolvedToken->getSubtokens(); | ||
for (int i=0; i<(int)subtokens.size(); i++) { | ||
if (hre.search(subtokens[i], recipRegex)) { | ||
string before = hre.getPrefix(); | ||
string after = hre.getSuffix(); | ||
hre.replaceDestructive(after, "", recipRegex, "g"); | ||
string subtokenText; | ||
HumRegex hre; | ||
string recip = Convert::durationToRecip(dur); | ||
vector<string> subtokens = resolvedToken->getSubtokens(); | ||
for (int i=0; i<(int)subtokens.size(); i++) { | ||
if (hre.search(subtokens[i], recipRegex)) { | ||
string before = hre.getPrefix(); | ||
string after = hre.getSuffix(); | ||
hre.replaceDestructive(after, "", recipRegex, "g"); | ||
string subtokenText; | ||
if (resolvedToken->getDuration() > dur) { | ||
// Add a tie start if not already in a tie group | ||
if (!hre.search(subtokens[i], "[_\\[]")) { | ||
subtokenText += "["; | ||
} | ||
// Replace the old duration with the clipped one | ||
subtokenText += before + recip + after; | ||
token->replaceSubtoken(i, subtokenText); | ||
lineChange = true; | ||
} | ||
// Replace the old duration with the clipped one | ||
subtokenText += before + recip + after; | ||
token->replaceSubtoken(i, subtokenText); | ||
lineChange = true; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters