The inverse of staff_position: a staff step (a clicked staff height) back to the diatonic pitch (nominal, octave) written there under a clef. This is the vertical half of the click-to-insert inverse the GUI will use — turning where you click on a staff into the pitch to place. It mirrors the forward map's clef and octave-shift convention exactly, computes the diatonic index in i64 so an extreme step cannot overflow the intermediate, and returns None for a percussion clef (no diatonic mapping) or a position whose octave falls outside i8 (rather than wrapping to a wrong-looking octave). A round-trip test covers treble/bass/alto/tenor and octave-shifted (8va/8vb) trebles across octaves and nominals, plus the out-of-range refusals. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NAtEiJtt9yKVV1zjKYmZhS |
||
|---|---|---|
| .github/workflows | ||
| crates | ||
| spec | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||