The counterpart of toSpelledInterval for keys: an entry point takes
whatever form the caller has — the name a key field holds, the scale the
theory module returns, or a Key instance — and gets one shape back. An
instance is accepted through its toJSON method rather than by its type, so
the layers below the model can read a class without importing it.
A name is read by the one reader resolveKey and Key.parse also use,
so every entry point that takes a key accepts exactly the same names: a mode
word in every notation system that reader knows, and a built-in scale's own
word — 'D dorian', 'D harmonic minor' — in English.
The spelling the name carries is dropped here along with the scale form,
which is what resolveKey is for.
Resolve any key-shaped value to a plain KeyScale.
The counterpart of toSpelledInterval for keys: an entry point takes whatever form the caller has — the name a key field holds, the scale the theory module returns, or a
Keyinstance — and gets one shape back. An instance is accepted through itstoJSONmethod rather than by its type, so the layers below the model can read a class without importing it.A name is read by the one reader resolveKey and
Key.parsealso use, so every entry point that takes a key accepts exactly the same names: a mode word in every notation system that reader knows, and a built-in scale's own word —'D dorian','D harmonic minor'— in English. The spelling the name carries is dropped here along with the scale form, which is what resolveKey is for.