hmt-0.15: Haskell Music Theory

Safe Haskell | Safe
Language | Haskell98

Music.Theory.Key

Description

Common music keys.

Synopsis

- data Mode_T
  - = Minor_Mode
  - | Major_Mode
- type Key = (Note_T, Alteration_T, Mode_T)
- key_fifths :: Key -> Int

# Documentation

data Mode_T Source #

Enumeration of common music notation modes.

Constructors

Minor_Mode |
Major_Mode |

Instances

Eq Mode_T Source # |
Methods (==) :: Mode_T -> Mode_T -> Bool # (/=) :: Mode_T -> Mode_T -> Bool #
Ord Mode_T Source # |
Methods compare :: Mode_T -> Mode_T -> Ordering # (<) :: Mode_T -> Mode_T -> Bool # (<=) :: Mode_T -> Mode_T -> Bool # (>) :: Mode_T -> Mode_T -> Bool # (>=) :: Mode_T -> Mode_T -> Bool # max :: Mode_T -> Mode_T -> Mode_T # min :: Mode_T -> Mode_T -> Mode_T #
Show Mode_T Source # |
Methods showsPrec :: Int -> Mode_T -> ShowS # show :: Mode_T -> String # showList :: [Mode_T] -> ShowS #

type Key = (Note_T, Alteration_T, Mode_T) Source #

A common music notation key is a `Note_T`, `Alteration_T`, `Mode_T` triple.

key_fifths :: Key -> Int Source #

Distance along circle of fifths path of indicated `Key`. A positive number indicates the number of sharps, a negative number the number of flats.

    key_fifths (A,Natural,Minor_Mode) == 0
    key_fifths (A,Natural,Major_Mode) == 3
    key_fifths (C,Natural,Minor_Mode) == -3