src/tool-gasparize.cpp
void Tool_gasparize::deleteDummyTranspositions(HumdrumFile& infile) {
	vector<int> ldel;
	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].hasSpines()) {
			continue;
		}
		if (!infile[i].isInterpretation()) {
			continue;
		}
		bool empty = true;
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			HTp token = infile.token(i, j);
			if (*token == "*") {
				continue;
			}
			if (!token->isKern()) {
				empty = false;
				continue;
			}
			if (*token == "*Trd0c0") {
				token->setText("*");
			} else {
				empty = false;
			}
		}
		if (empty) {
			ldel.push_back(i);
		}
	}

	if (ldel.size() == 1) {
		infile.deleteLine(ldel[0]);
	} else if (ldel.size() > 1) {
		cerr << "Warning: multiple transposition lines, not deleting them" << endl;
	}

}
//////////////////////////////
//
// Tool_gasparize::deleteDummyTranspositions -- Somehow empty
//    transpositions that go to the same pitch can appear in the
//    MusicXML data, so remove them here.  Example:
// 		*Trd0c0
//
:deleteDummyTranspositions -- Somehow empty
transpositions that go to the same pitch can appear in the
MusicXML data, so remove them here.  Example:
Trd0c0
: deleteDummyTranspositions -- Somehow empty transpositions that go to the same pitch can appear in the MusicXML data so remove them here . Example : Trd0c0
void Tool_gasparize::deleteDummyTranspositions(HumdrumFile& infile) {
	vector<int> ldel;
	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].hasSpines()) {
			continue;
		}
		if (!infile[i].isInterpretation()) {
			continue;
		}
		bool empty = true;
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			HTp token = infile.token(i, j);
			if (*token == "*") {
				continue;
			}
			if (!token->isKern()) {
				empty = false;
				continue;
			}
			if (*token == "*Trd0c0") {
				token->setText("*");
			} else {
				empty = false;
			}
		}
		if (empty) {
			ldel.push_back(i);
		}
	}
	if (ldel.size() == 1) {
		infile.deleteLine(ldel[0]);
	} else if (ldel.size() > 1) {
		cerr << "Warning: multiple transposition lines, not deleting them" << endl;
	}
}
void Tool_gasparize :: deleteDummyTranspositions ( HumdrumFile & infile ) { vector < int > ldel ; for ( int i = 0 ; i < infile . getLineCount ( ) ; i ++ ) { if ( ! infile [ i ] . hasSpines ( ) ) { continue ; } if ( ! infile [ i ] . isInterpretation ( ) ) { continue ; } bool empty = true ; for ( int j = 0 ; j < infile [ i ] . getFieldCount ( ) ; j ++ ) { HTp token = infile . token ( i , j ) ; if ( * token == " " ) { continue ; } if ( ! token -> isKern ( ) ) { empty = false ; continue ; } if ( * token == " " ) { token -> setText ( " " ) ; } else { empty = false ; } } if ( empty ) { ldel . push_back ( i ) ; } } if ( ldel . size ( ) == 1 ) { infile . deleteLine ( ldel [ 0 ] ) ; } else if ( ldel . size ( ) > 1 ) { cerr << " " << endl ; } }
Tool_gasparize::deleteDummyTranspositions -- Somehow empty
transpositions that go to the same pitch can appear in the
MusicXML data, so remove them here.
Tool_gasparize :: deleteDummyTranspositions -- Somehow empty transpositions that go to the same pitch can appear in the MusicXML data so remove them here .