FA-80883 / Music interval and transposition theory / Member archive
Key-aware MIDI note spelling: B sharp keeps the sounding octave number · case 03
In C# major, middle C is spelled B#4, an octave above the sounding pitch, instead of B#3.
Case contract
Input [midi, fifths] with midi 0..127 and fifths -7..7. Use flat names when fifths < 0, sharp names otherwise; in keys with at least six sharps pitch class 5 is E#, with seven sharps pitch class 0 is B# of the previous octave, and with at least six flats pitch class 11 is Cb of the next octave. Octave -1 starts at key 0. Invalid input returns None.
Why this case matters
Pitch spelling and interval arithmetic decide the notes that notation, transposition and analysis tools display or play.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 4 | "B#4" | "B#3" | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗