Before I roll up my sleeves and build something that might already exist --
Is there already an abstraction somewhere for diatonic scale degree mapping? cf. http://doc.sccode.org/Classes/SimpleNumber.html#-degreeToKey
degreeToKey
is relatively easy (basically wrapped indexing into an array, with octave displacement).
The inverse operation keyToDegree
is a little trickier -- if somebody has already done it, I would rather not reinvent the wheel.
Thanks,
hjh