Get the scale degree of a pitch, counted from 1: the tonic is degree 1.
A pitch outside the scale answers -1 rather than 0, so a caller testing the result for a degree cannot mistake the "not in the scale" answer for the tonic.
MIDI pitch or bare pitch class.
The key/scale to measure against, as a key name, a key/scale, or a Key.
Key
The 1-based degree, or -1 if the pitch is not in the scale.
Get the scale degree of a pitch, counted from 1: the tonic is degree 1.
A pitch outside the scale answers -1 rather than 0, so a caller testing the result for a degree cannot mistake the "not in the scale" answer for the tonic.