OCTAVE_NOTES
int pitch, oldfill, lastpitch = OCTAVE_NOTES * DFLT_OCTAVE;
pitch = notetab[c - 'A'] + octave * OCTAVE_NOTES;
if (abs(pitch-lastpitch) > abs(pitch+OCTAVE_NOTES -
pitch += OCTAVE_NOTES;
if (abs(pitch-lastpitch) > abs((pitch-OCTAVE_NOTES) -
pitch -= OCTAVE_NOTES;
if (octave >= nitems(pitchtab) / OCTAVE_NOTES)
if (octave < nitems(pitchtab) / OCTAVE_NOTES - 1)