duncanmalashock/elm-music-theory/1.0.0

Music.ScaleType

A scale type describes the intervals contained in a scale, with no specific root pitch class. E.g. the "major scale."

type alias ScaleType =
ScaleType

Helpers

mode : Int -> ScaleType -> ScaleType

Get a mode of a scale type by shifting the order of its intervals. For example, the Phrygian mode is the third mode of the major scale:

mode 3 major == phrygian

Note: like many numbers in music theory, modes are 1-based; 2 means the second mode of the scale type. 0 and negative integers are ignored.

Conversion

toList : ScaleType -> List Interval

Get the intervals contained in the scale type:

toList major
    == [ Interval.perfectUnison
       , Interval.majorSecond
       , Interval.majorThird
       , Interval.perfectFourth
       , Interval.perfectFifth
       , Interval.majorSixth
       , Interval.majorSeventh
       ]

Constructors

major : ScaleType

Same as ionian

minor : ScaleType

Also known as the "natural minor" scale. Same as aeolian

Modes of the major scale

ionian : ScaleType
dorian : ScaleType
phrygian : ScaleType
lydian : ScaleType
mixolydian : ScaleType
aeolian : ScaleType
locrian : ScaleType

Modes of the melodic minor scale

melodicMinor : ScaleType
dorianFlat2 : ScaleType
lydianAugmented : ScaleType
acoustic : ScaleType
majorMinor : ScaleType
minorLocrian : ScaleType
superlocrian : ScaleType

Modes of the harmonic minor scale

harmonicMinor : ScaleType
locrianNatural6 : ScaleType
majorAugmented : ScaleType
lydianDiminished : ScaleType
phrygianDominant : ScaleType
aeolianHarmonic : ScaleType
ultralocrian : ScaleType

Symmetrical scales

wholeTone : ScaleType

Pentatonic scales

majorPentatonic : ScaleType
minorPentatonic : ScaleType

Custom scale types

{ rootToSecond : Interval
, rootToThird : Interval
, rootToFourth : Interval
, rootToFifth : Interval
}
-> ScaleType

Define a custom scale type with 5 degrees:

customPentatonic
    { rootToSecond = Interval.minorThird
    , rootToThird = Interval.perfectFourth
    , rootToFourth = Interval.perfectFifth
    , rootToFifth = Interval.minorSeventh
    }
    == minorPentatonic
{ rootToSecond : Interval
, rootToThird : Interval
, rootToFourth : Interval
, rootToFifth : Interval
, rootToSixth : Interval
}
-> ScaleType

Define a custom scale type with 6 degrees:

customHexatonic
    { rootToSecond = Interval.majorSecond
    , rootToThird = Interval.majorThird
    , rootToFourth = Interval.augmentedFourth
    , rootToFifth = Interval.minorSixth
    , rootToSixth = Interval.minorSeventh
    }
    == wholeTone
{ rootToSecond : Interval
, rootToThird : Interval
, rootToFourth : Interval
, rootToFifth : Interval
, rootToSixth : Interval
, rootToSeventh : Interval
}
-> ScaleType

Define a custom scale type with 7 degrees:

customHeptatonic
    { rootToSecond = Interval.majorSecond
    , rootToThird = Interval.minorThird
    , rootToFourth = Interval.perfectFourth
    , rootToFifth = Interval.perfectFifth
    , rootToSixth = Interval.majorSixth
    , rootToSeventh = Interval.minorSeventh
    }
    == dorian
{ rootToSecond : Interval
, rootToThird : Interval
, rootToFourth : Interval
, rootToFifth : Interval
, rootToSixth : Interval
, rootToSeventh : Interval
, rootToEighth : Interval
}
-> ScaleType

Define a custom scale type with 8 degrees:

customOctatonic
    { rootToSecond = Interval.majorSecond
    , rootToThird = Interval.minorThird
    , rootToFourth = Interval.perfectFourth
    , rootToFifth = Interval.diminishedFifth
    , rootToSixth = Interval.minorSixth
    , rootToSeventh = Interval.majorSixth
    , rootToEighth = Interval.majorSeventh
    }
    == diminishedWholeToneHalfTone