src/Convert-pitch.cpp
char Convert::kernToDiatonicUC(const string& kerndata) {
	for (int i=0; i<(int)kerndata.size(); i++) {
		if (kerndata[i] == ' ') {
			break;
		}
		if (kerndata[i] == 'r') {
			return 'R';
		}
		if (('A' <= kerndata[i]) && (kerndata[i] <= 'G')) {
			return kerndata[i];
		}
		if (('a' <= kerndata[i]) && (kerndata[i] <= 'g')) {
			return toupper(kerndata[i]);
		}
	}
	return 'X';
}
//////////////////////////////
//
// Convert::kernToDiatonicUC -- Convert a kern token into a diatonic
//    note pitch-class.  "R" is returned if the note is rest, and
//    "X" is returned if there is no pitch name in the string.
//    Only the first subtoken in the string is considered.
//
:kernToDiatonicUC -- Convert a kern token into a diatonic
note pitch-class.  "R" is returned if the note is rest, and
"X" is returned if there is no pitch name in the string.
Only the first subtoken in the string is considered.
: kernToDiatonicUC -- Convert a kern token into a diatonic note pitch - class . " R " is returned if the note is rest and " X " is returned if there is no pitch name in the string . Only the first subtoken in the string is considered .
char Convert::kernToDiatonicUC(const string& kerndata) {
	for (int i=0; i<(int)kerndata.size(); i++) {
		if (kerndata[i] == ' ') {
			break;
		}
		if (kerndata[i] == 'r') {
			return 'R';
		}
		if (('A' <= kerndata[i]) && (kerndata[i] <= 'G')) {
			return kerndata[i];
		}
		if (('a' <= kerndata[i]) && (kerndata[i] <= 'g')) {
			return toupper(kerndata[i]);
		}
	}
	return 'X';
}
char Convert :: kernToDiatonicUC ( const string & kerndata ) { for ( int i = 0 ; i < ( int ) kerndata . size ( ) ; i ++ ) { if ( kerndata [ i ] == ' ' ) { break ; } if ( kerndata [ i ] == ' ' ) { return ' ' ; } if ( ( ' ' <= kerndata [ i ] ) && ( kerndata [ i ] <= ' ' ) ) { return kerndata [ i ] ; } if ( ( ' ' <= kerndata [ i ] ) && ( kerndata [ i ] <= ' ' ) ) { return toupper ( kerndata [ i ] ) ; } } return ' ' ; }
Convert::kernToDiatonicUC -- Convert a kern token into a diatonic
note pitch-class.
Convert :: kernToDiatonicUC -- Convert a kern token into a diatonic note pitch - class .