Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[myank] Keep *part and *staff interpretations #90

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 53 additions & 3 deletions min/humlib.cpp
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: Tue Dec 12 11:01:04 PST 2023
// Last Modified: Di 19 Dez 2023 10:33:13 CET
// Filename: min/humlib.cpp
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.cpp
// Syntax: C++11
Expand Down Expand Up @@ -105903,12 +105903,62 @@ void Tool_myank::printStarting(HumdrumFile& infile) {
if (!m_hideStarting) {
m_humdrum_text << infile[i] << "\n";
} else {
if (infile[i].rfind("!!!RDF", 0) == 0) {
if (infile[i].rfind("!!!RDF", 0) == 0 || infile[i].rfind("!!!system-decoration", 0) == 0) {
m_humdrum_text << infile[i] << "\n";
}
}
}

// keep *part interpretations
bool hasPart = false;
for (i=exi+1; i<infile.getLineCount(); i++) {
hasPart = false;
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 5, "*part") == 0) {
hasPart = true;
break;
}
}
if (hasPart) {
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 5, "*part") == 0) {
m_humdrum_text << infile.token(i, j);
} else {
m_humdrum_text << "*";
}
if (j < infile[i].getFieldCount() - 1) {
m_humdrum_text << "\t";
}
}
m_humdrum_text << "\n";
}
}

// keep *staff interpretations
bool hasStaff = false;
for (i=exi+1; i<infile.getLineCount(); i++) {
hasStaff = false;
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 6, "*staff") == 0) {
hasStaff = true;
break;
}
}
if (hasStaff) {
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 6, "*staff") == 0) {
m_humdrum_text << infile.token(i, j);
} else {
m_humdrum_text << "*";
}
if (j < infile[i].getFieldCount() - 1) {
m_humdrum_text << "\t";
}
}
m_humdrum_text << "\n";
}
}

int hasI = 0;

if (m_instrumentQ) {
Expand Down Expand Up @@ -105999,7 +106049,7 @@ void Tool_myank::printEnding(HumdrumFile& infile, int lastline, int adjlin) {
if (startline >= 0) {
for (i=startline; i<infile.getLineCount(); i++) {
if (m_hideEnding && (i > ending)) {
if (infile[i].rfind("!!!RDF", 0) == 0) {
if (infile[i].rfind("!!!RDF", 0) == 0 || infile[i].rfind("!!!system-decoration", 0) == 0) {
m_humdrum_text << infile[i] << "\n";
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion min/humlib.h
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: Tue Dec 12 11:01:04 PST 2023
// Last Modified: Di 19 Dez 2023 10:33:13 CET
// Filename: min/humlib.h
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.h
// Syntax: C++11
Expand Down
54 changes: 52 additions & 2 deletions src/tool-myank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1712,12 +1712,62 @@ void Tool_myank::printStarting(HumdrumFile& infile) {
if (!m_hideStarting) {
m_humdrum_text << infile[i] << "\n";
} else {
if (infile[i].rfind("!!!RDF", 0) == 0) {
if (infile[i].rfind("!!!RDF", 0) == 0 || infile[i].rfind("!!!system-decoration", 0) == 0) {
m_humdrum_text << infile[i] << "\n";
}
}
}

// keep *part interpretations
bool hasPart = false;
for (i=exi+1; i<infile.getLineCount(); i++) {
hasPart = false;
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 5, "*part") == 0) {
hasPart = true;
break;
}
}
if (hasPart) {
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 5, "*part") == 0) {
m_humdrum_text << infile.token(i, j);
} else {
m_humdrum_text << "*";
}
if (j < infile[i].getFieldCount() - 1) {
m_humdrum_text << "\t";
}
}
m_humdrum_text << "\n";
}
}

// keep *staff interpretations
bool hasStaff = false;
for (i=exi+1; i<infile.getLineCount(); i++) {
hasStaff = false;
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 6, "*staff") == 0) {
hasStaff = true;
break;
}
}
if (hasStaff) {
for (j=0; j<infile[i].getFieldCount(); j++) {
if (infile.token(i, j)->compare(0, 6, "*staff") == 0) {
m_humdrum_text << infile.token(i, j);
} else {
m_humdrum_text << "*";
}
if (j < infile[i].getFieldCount() - 1) {
m_humdrum_text << "\t";
}
}
m_humdrum_text << "\n";
}
}

int hasI = 0;

if (m_instrumentQ) {
Expand Down Expand Up @@ -1808,7 +1858,7 @@ void Tool_myank::printEnding(HumdrumFile& infile, int lastline, int adjlin) {
if (startline >= 0) {
for (i=startline; i<infile.getLineCount(); i++) {
if (m_hideEnding && (i > ending)) {
if (infile[i].rfind("!!!RDF", 0) == 0) {
if (infile[i].rfind("!!!RDF", 0) == 0 || infile[i].rfind("!!!system-decoration", 0) == 0) {
m_humdrum_text << infile[i] << "\n";
}
} else {
Expand Down