@tspro/web-music-score
    Preparing search index...

    Class Scale

    Scale class.

    Hierarchy (View Summary)

    Index

    Constructors

    • Create nev scale object instance.

      Parameters

      • tonic: string

        Tonic (e.g. "C" in "C Major").

      • scaleType: ScaleType

        Scale typo ("e.g. "Major" in "C Major").

      Returns Scale

    Properties

    mode: Mode

    Mode: Ionian/Major = 1, Dorian = 2, ..., Locrian = 7

    scaleType: ScaleType

    Scale typo ("e.g. "Major" in "C Major").

    tonic: string

    Tonic (e.g. "C" in "C Major").

    Methods

    • Get interval value between scale root note and given note.

      Parameters

      Returns Interval

      • Interval.
    • Get natural scale notes of this key signature, natural scale has 7 steps (e.g. Major scale: W, W, H, W, W, W, H).

      Returns readonly Note[]

      • Array of notes.
    • Get note of key signature by degree value.

      Parameters

      • degree: string | number

        Degree number in range [1, 7] or string e.g "b5" or "#4".

      Returns Note

      • Note.
    • Get number of accidentals this key signature has.

      Returns number

      • Number of accidentals.
    • Get preferred chromatic note from given chromatic id.

      Parameters

      • chromaticId: number

        Chromatic id.

      Returns Note

      • Note.
    • Get scale name.

      Parameters

      • OptionalsymbolSet: SymbolSet

        Symbol set to format scale name in ascii or unicode.

      Returns string

      • Scale name string.
    • Get scale notes.

      Parameters

      • bottomNote: string

        Computed scale notes begin no lower than this note.

      • numOctaves: number

        How many octaves?

      Returns readonly Note[]

      • Array of scale notes.
    • Get scale overview (e.g. "C - D - E - F - G - A - B" for "C Major" scale).

      Returns string

      • Scale overview string.
    • Get scale steps, array of 1 (half step) and 2 (whole step), (e.g. [2, 2, 1, 2, 2, 2, 1] for Major scale).

      Returns number[]

      • Array of scale steps.
    • Get scale steps string presentation, array of "H" (half step) and "W" (whole step), (e.g. ["W", "W", "H", "W", "W", "W", "H"] for Major scale).

      Returns string[]

      • Array of scale steps string presentation.
    • Test if given note is scale note.

      Parameters

      • note: Note

        Note to test.

      Returns boolean

      • True/false.
    • Test if given note is scale root note.

      Parameters

      • note: Note

        Note to test.

      Returns boolean

      • True/false.
    • Compare if two scales equals.

      Parameters

      • a: undefined | null | Scale

        Scale a.

      • b: undefined | null | Scale

        Scale b.

      Returns boolean

      • Boolean equality of given scales.