Arkham / elm-chords / Chords.Note

Represents the note that gives a name to a chord.


type Note
    = A
    | Bb
    | B
    | C
    | Db
    | D
    | Eb
    | E
    | F
    | Gb
    | G
    | Ab

This note is also known as pitch class, because it describes every occurrence of that note in any octave. Every accidental is described using the flat notation for consistency.


type Accidental
    = Flat
    | Sharp

This type describes accidentals. Sometimes accidentals can be enharmonic, which means that they describe the same pitch: one example of this is A Sharp B Flat.

Manipulating Notes

next : Note -> Note

Returns the next note.

transpose : Basics.Int -> Note -> Note

Returns the note transposed by a number of semitones.

distance : Note -> Note -> Basics.Int

Returns the distance in semitones between two notes.

Exporting

toString : Note -> String

Converts a note to String.

toStringWith : Accidental -> Note -> String

Converts a note to String. You can decide how to display accidentals.