src/Convert-pitch.cpp
int Convert::kernToBase40PC(const string& kerndata) {
	int diatonic = Convert::kernToDiatonicPC(kerndata);
	if (diatonic < 0) {
		return diatonic;
	}
	int accid  = Convert::kernToAccidentalCount(kerndata);
	int output = -1000;
	switch (diatonic) {
		case 0: output =  0; break;
		case 1: output =  6; break;
		case 2: output = 12; break;
		case 3: output = 17; break;
		case 4: output = 23; break;
		case 5: output = 29; break;
		case 6: output = 35; break;
	}
	output += accid;
	return output + 2;     // +2 to make c-flat-flat bottom of octave.
}
//////////////////////////////
//
// Convert::kernToBase40PC -- Convert **kern pitch to a base-40 pitch class.
//    Will ignore subsequent pitches in a chord.
//
:kernToBase40PC -- Convert **kern pitch to a base-40 pitch class.
Will ignore subsequent pitches in a chord.
: kernToBase40PC -- Convert ** kern pitch to a base - 40 pitch class . Will ignore subsequent pitches in a chord .
int Convert::kernToBase40PC(const string& kerndata) {
	int diatonic = Convert::kernToDiatonicPC(kerndata);
	if (diatonic < 0) {
		return diatonic;
	}
	int accid  = Convert::kernToAccidentalCount(kerndata);
	int output = -1000;
	switch (diatonic) {
		case 0: output =  0; break;
		case 1: output =  6; break;
		case 2: output = 12; break;
		case 3: output = 17; break;
		case 4: output = 23; break;
		case 5: output = 29; break;
		case 6: output = 35; break;
	}
	output += accid;
	return output + 2;     
}
int Convert :: kernToBase40PC ( const string & kerndata ) { int diatonic = Convert :: kernToDiatonicPC ( kerndata ) ; if ( diatonic < 0 ) { return diatonic ; } int accid = Convert :: kernToAccidentalCount ( kerndata ) ; int output = -1000 ; switch ( diatonic ) { case 0 : output = 0 ; break ; case 1 : output = 6 ; break ; case 2 : output = 12 ; break ; case 3 : output = 17 ; break ; case 4 : output = 23 ; break ; case 5 : output = 29 ; break ; case 6 : output = 35 ; break ; } output += accid ; return output + 2 ; }
Convert::kernToBase40PC -- Convert **kern pitch to a base-40 pitch class.
Convert :: kernToBase40PC -- Convert ** kern pitch to a base - 40 pitch class .
// +2 to make c-flat-flat bottom of octave.