FA-81227 / Music interval and transposition theory / Member archive
Melody transposition fitted into an instrument range: lowest fitting octave chosen instead of nearest · case 02
A melody that already fits a wide range is dropped several octaves to the lowest register that still fits.
Case contract
Input [notes, semitones, lo, hi]. Transpose every note by the semitone amount, then shift the whole melody by the octave offset k (|k| <= 10) of smallest magnitude that places every note within [lo, hi] inclusive. Return the notes, or None if the melody is empty, lo > hi, or no octave fits.
Why this case matters
Arranging tools transpose parts into playable instrument ranges.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 1 | [36, 40, 43] | [48, 52, 55] | 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 ↗