src/Convert-pitch.cpp
int Convert::kernToAccidentalCount(const string& kerndata) {
	int output = 0;
	for (int i=0; i<(int)kerndata.size(); i++) {
		if (kerndata[i] == ' ') {
			break;
		}
		if (kerndata[i] == '-') {
			output--;
		}
		if (kerndata[i] == '#') {
			output++;
		}
	}
	return output;
}
//////////////////////////////
//
// Convert::kernToAccidentalCount -- Convert a kern token into a count
//    of accidentals in the first subtoken.  Sharps are assigned to the
//    value +1 and flats to -1.  So a double sharp is +2 and a double
//    flat is -2.  Only the first subtoken in the string is considered.
//    Cases such as "#-" should not exist, but in this case the return
//    value will be 0.
//
:kernToAccidentalCount -- Convert a kern token into a count
of accidentals in the first subtoken.  Sharps are assigned to the
value +1 and flats to -1.  So a double sharp is +2 and a double
flat is -2.  Only the first subtoken in the string is considered.
Cases such as "#-" should not exist, but in this case the return
value will be 0.
: kernToAccidentalCount -- Convert a kern token into a count of accidentals in the first subtoken . Sharps are assigned to the value + 1 and flats to - 1 . So a double sharp is + 2 and a double flat is - 2 . Only the first subtoken in the string is considered . Cases such as " # - " should not exist but in this case the return value will be 0 .
int Convert::kernToAccidentalCount(const string& kerndata) {
	int output = 0;
	for (int i=0; i<(int)kerndata.size(); i++) {
		if (kerndata[i] == ' ') {
			break;
		}
		if (kerndata[i] == '-') {
			output--;
		}
		if (kerndata[i] == '#') {
			output++;
		}
	}
	return output;
}
int Convert :: kernToAccidentalCount ( const string & kerndata ) { int output = 0 ; for ( int i = 0 ; i < ( int ) kerndata . size ( ) ; i ++ ) { if ( kerndata [ i ] == ' ' ) { break ; } if ( kerndata [ i ] == ' ' ) { output -- ; } if ( kerndata [ i ] == ' ' ) { output ++ ; } } return output ; }
Convert::kernToAccidentalCount -- Convert a kern token into a count
of accidentals in the first subtoken.
Convert :: kernToAccidentalCount -- Convert a kern token into a count of accidentals in the first subtoken .