# `Mx.Notes`
[🔗](https://github.com/mx-music/mx/blob/main/lib/mx/notes.ex#L1)

Note names, chords and scales, worked out as plain MIDI note numbers.

A note name is a letter from a to g, upper or lower case, an optional `s` for sharp or `b` for flat, and an optional octave that defaults to 4, so `:c4` is 60, middle C.
Chords and scales are lists of note numbers, built from a root given as a name or a number, and a scale ends on the octave above its root.

# `below`

The note of a chord, in any octave, closest below a note.

# `chord`

The notes of a chord, from a root given as a name or a number.

# `fit`

A scale bent to a chord: each chord tone missing from the scale takes the place of the scale note a semitone below it, or a semitone above when there is none below.

# `from_text`

The note number for text giving a number or a note name, such as "60" or "c4", raising `ArgumentError` for neither.

# `intervals`

The step from each note to the next, from notes given as names or numbers.

# `melody`

The notes reached by taking each step in turn from a start note given as a name or a number.

# `nearest`

The note of a chord, in any octave, closest to a note, the lower on a tie; `except:` leaves out one note.

# `note`

A note number for a number or a note name such as `:c4`, raising `ArgumentError` for an unknown name.

# `parse`

The note number for a note name written as text, such as "A2", raising `ArgumentError` for an unknown name.

# `scale`

The notes of a scale from a root, ending on the octave above it, over `octaves:` octaves (1 by default).

# `voice`

Each note of a chord placed once from `from:` up to `to:`, leaving out the root of a chord of more notes than `limit:`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
