@libraz/libcantus - v1.1.0
    Preparing search index...

    Function spellScale

    • Spell every pitch class of a scale, in ascending scale-degree order.

      Correct for heptatonic scales (each degree gets the next letter). A gapped scale gives each of its tones a letter of its own wherever its pitch set allows one — C miyako-bushi spells C Db F G Ab — and is spelled tone by tone, on the accidental side the scale leans towards, where it does not: the blues scale has to name one letter twice however it is read.

      Parameters

      • tonic: NoteLike

        The spelled tonic, as a note name, a MIDI number, note data, or a Note.

      • key: KeyLike

        The key/scale, as a key name, a key/scale, or a Key — the same forms its sibling spellers take.

      Returns NoteData[]

      Spelled notes, one per scale degree.

      If key names no key, or if tonic does not sound the key's root pitch class.

      import { spellScale, noteNames, parseNote, majorKey } from '@libraz/libcantus';
      noteNames(spellScale(parseNote('C'), majorKey(0)));
      // ['C', 'D', 'E', 'F', 'G', 'A', 'B']