diff --git a/min/humlib.cpp b/min/humlib.cpp index 805ad0e8..d203be89 100644 --- a/min/humlib.cpp +++ b/min/humlib.cpp @@ -1,7 +1,7 @@ // // Programmer: Craig Stuart Sapp // Creation Date: Sat Aug 8 12:24:49 PDT 2015 -// Last Modified: Fri Nov 22 09:29:17 AM PST 2024 +// Last Modified: Fr 13 Dez 2024 22:27:49 CET // Filename: min/humlib.cpp // URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.cpp // Syntax: C++11 @@ -102498,7 +102498,7 @@ void Tool_meter::processFile(HumdrumFile& infile) { void Tool_meter::analyzePickupMeasures(HumdrumFile& infile) { vector sstarts; - infile.getKernSpineStartList(sstarts); + infile.getKernLikeSpineStartList(sstarts); for (int i=0; i<(int)sstarts.size(); i++) { analyzePickupMeasures(sstarts[i]); } @@ -102571,6 +102571,14 @@ void Tool_meter::analyzePickupMeasures(HTp sstart) { continue; } } + if (bardur.at(i) < tsigdur.at(i)) { + HumRegex hre; + HTp barlineToken = barandtime.at(i).at(0); + if (barlineToken->isBarline() && hre.search(barlineToken, "\\|\\||:?\\|?!\\|?:?")) { + pickup.at(i) = true; + continue; + } + } } // check for first-measure pickup @@ -102717,7 +102725,7 @@ void Tool_meter::printLabelLine(HumdrumLine& line) { bool printLabels = true; for (int i=0; iisKern()) { + if (token->isKernLike()) { i = printKernAndAnalysisSpine(line, i, printLabels, forceInterpretation); } else { m_humdrum_text << "*"; @@ -102740,7 +102748,7 @@ void Tool_meter::printHumdrumLine(HumdrumLine& line, bool printLabels) { for (int i=0; iisKern()) { + if (token->isKernLike()) { i = printKernAndAnalysisSpine(line, i, printLabels); } else { m_humdrum_text << token; @@ -102914,6 +102922,9 @@ int Tool_meter::printKernAndAnalysisSpine(HumdrumLine& line, int index, bool pri meter = "*-"; } else if (token->isTimeSignature()) { analysis = *token; + numerator = *token; + denominator = *token; + meter = *token; } else { analysis = "*"; numerator = "*"; @@ -103046,7 +103057,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, if (line.isBarline()) { for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (hre.search(token, "-")) { @@ -103064,7 +103075,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, // check for time signatures for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (hre.search(token, "^\\*M(\\d+)/(\\d+)")) { @@ -103087,7 +103098,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, // check for time signatures for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (token->isNull()) { diff --git a/min/humlib.h b/min/humlib.h index c5cc0cc5..cfb4a883 100644 --- a/min/humlib.h +++ b/min/humlib.h @@ -1,7 +1,7 @@ // // Programmer: Craig Stuart Sapp // Creation Date: Sat Aug 8 12:24:49 PDT 2015 -// Last Modified: Fri Nov 22 09:29:17 AM PST 2024 +// Last Modified: Fr 13 Dez 2024 22:27:49 CET // Filename: min/humlib.h // URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.h // Syntax: C++11 diff --git a/src/tool-meter.cpp b/src/tool-meter.cpp index 1d677b94..918ac875 100644 --- a/src/tool-meter.cpp +++ b/src/tool-meter.cpp @@ -195,7 +195,7 @@ void Tool_meter::processFile(HumdrumFile& infile) { void Tool_meter::analyzePickupMeasures(HumdrumFile& infile) { vector sstarts; - infile.getKernSpineStartList(sstarts); + infile.getKernLikeSpineStartList(sstarts); for (int i=0; i<(int)sstarts.size(); i++) { analyzePickupMeasures(sstarts[i]); } @@ -268,6 +268,14 @@ void Tool_meter::analyzePickupMeasures(HTp sstart) { continue; } } + if (bardur.at(i) < tsigdur.at(i)) { + HumRegex hre; + HTp barlineToken = barandtime.at(i).at(0); + if (barlineToken->isBarline() && hre.search(barlineToken, "\\|\\||:?\\|?!\\|?:?")) { + pickup.at(i) = true; + continue; + } + } } // check for first-measure pickup @@ -414,7 +422,7 @@ void Tool_meter::printLabelLine(HumdrumLine& line) { bool printLabels = true; for (int i=0; iisKern()) { + if (token->isKernLike()) { i = printKernAndAnalysisSpine(line, i, printLabels, forceInterpretation); } else { m_humdrum_text << "*"; @@ -437,7 +445,7 @@ void Tool_meter::printHumdrumLine(HumdrumLine& line, bool printLabels) { for (int i=0; iisKern()) { + if (token->isKernLike()) { i = printKernAndAnalysisSpine(line, i, printLabels); } else { m_humdrum_text << token; @@ -611,6 +619,9 @@ int Tool_meter::printKernAndAnalysisSpine(HumdrumLine& line, int index, bool pri meter = "*-"; } else if (token->isTimeSignature()) { analysis = *token; + numerator = *token; + denominator = *token; + meter = *token; } else { analysis = "*"; numerator = "*"; @@ -743,7 +754,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, if (line.isBarline()) { for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (hre.search(token, "-")) { @@ -761,7 +772,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, // check for time signatures for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (hre.search(token, "^\\*M(\\d+)/(\\d+)")) { @@ -784,7 +795,7 @@ void Tool_meter::processLine(HumdrumLine& line, vector& curNum, // check for time signatures for (int i=0; iisKern()) { + if (!token->isKernLike()) { continue; } if (token->isNull()) {