Source: https://guthlabs.ai/docs/instruments/midi-note-number-note-name-converter/mechanism/

instrument mechanism / verified-clean

# MIDI Note Number ↔ Note Name Converter mechanism

The inspectable method record for MIDI Note Number ↔ Note Name Converter, kept separate from implementation and qualification.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Model scope

The arithmetic is correct under the standard MIDI convention, but the specification needs an explicit note-name mapping, reverse-conversion rule, valid input ranges, and enharmonic spelling policy. Because these behaviors are ambiguous, the instrument requires review before being considered fully specified.

- The forward formula is standard for integer MIDI note numbers: note_index = MIDI % 12 and octave = floor(MIDI / 12) - 1, with MIDI 60 = C4.

- The note-index-to-name mapping is not specified. A canonical spelling convention is required; the vectors below assume sharp spellings: C, C#, D, D#, E, F, F#, G, G#, A, A#, B.

- The reverse conversion algorithm is not stated. It should be MIDI = 12 × (octave + 1) + note_index.

- The supported MIDI-number domain is not stated. Standard MIDI note numbers are integers from 0 through 127; values outside that range should be rejected unless an extended domain is intentionally supported.

- The accepted note-name syntax and enharmonic aliases are not specified. For example, C#4 and Db4 represent the same pitch but require an explicit policy.

## Units and conventions

- MIDI note numbers are dimensionless integer values in the standard range 0–127.

- Note names use scientific pitch notation with an integer octave, such as C4 or G#5.

- The octave convention is MIDI/scientific pitch notation: MIDI 60 = C4 and MIDI 69 = A4.

- The canonical output uses sharps rather than flats: C#, D#, F#, G#, and A#.

## Inspectable vector

One of 4 source-bound review vectors:

````
{
  "inputs": {
    "midi_number": 0
  },
  "expected_outputs": {
    "note_name": "C-1",
    "note_index": 0,
    "octave": -1
  },
  "working": "note_index = 0 % 12 = 0. octave = floor(0 / 12) - 1 = 0 - 1 = -1. Index 0 maps to C, so the result is C-1."
}
````

## Failure boundary

- Reject non-integer MIDI inputs, MIDI values below 0, and MIDI values above 127 unless the product explicitly supports a nonstandard range.

- Avoid language-specific remainder behavior for negative values; validate the MIDI range before applying modulo.

- Define whether note names are case-sensitive and whether formats such as Bb4, DB4, C♭4, or B#3 are accepted.

- Define behavior for enharmonic spellings and normalize aliases to one canonical output spelling.

- Ensure octave -1 is formatted unambiguously as C-1 rather than being confused with a negative note number.

- Do not silently clamp invalid inputs or return a plausible-looking result for malformed note names.

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/midi-note-number-note-name-converter/>)[03**Implementation**](<https://guthlabs.ai/docs/instruments/midi-note-number-note-name-converter/implementation/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/midi-note-number-note-name-converter/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche6/tranche6-results.json`
