The counterpart of toSpelledInterval for notes: an entry point takes
whatever form the caller has — the name a text field holds, the MIDI number a
device sends, the data the pitch module returns, or a Note instance — and
gets one shape back. An instance is accepted through its toJSON method
rather than by its type, because the core layer cannot import the model layer
that defines the class.
A number is read as MIDI and spelled with sharps, the same reading
midiToNote takes by default. Where a key is known the caller spells
it there instead — spellPitch reads the key — because no single default
suits both a G# in E major and an Ab in Eb major.
Resolve any note-shaped value to plain Note data.
The counterpart of toSpelledInterval for notes: an entry point takes whatever form the caller has — the name a text field holds, the MIDI number a device sends, the data the pitch module returns, or a
Noteinstance — and gets one shape back. An instance is accepted through itstoJSONmethod rather than by its type, because the core layer cannot import the model layer that defines the class.A number is read as MIDI and spelled with sharps, the same reading midiToNote takes by default. Where a key is known the caller spells it there instead —
spellPitchreads the key — because no single default suits both a G# in E major and an Ab in Eb major.