music-diatonic-0.1.2: Implementation of basic western musical theory objects.

Safe HaskellSafe
LanguageHaskell98

Music.Diatonic.Note

Description

The Note module implements the basic Music.Diatonic musical objects:

  • Note
  • Accidental

Synopsis

Documentation

data Note Source #

Use these constructors to create Notes. To alter them, use the raise and lower functions (or their sharp and flat aliases).

Constructors

C 
D 
E 
F 
G 
A 
B 

Instances

Eq Note Source # 

Methods

(==) :: Note -> Note -> Bool #

(/=) :: Note -> Note -> Bool #

Ord Note Source # 

Methods

compare :: Note -> Note -> Ordering #

(<) :: Note -> Note -> Bool #

(<=) :: Note -> Note -> Bool #

(>) :: Note -> Note -> Bool #

(>=) :: Note -> Note -> Bool #

max :: Note -> Note -> Note #

min :: Note -> Note -> Note #

Read Note Source # 
Show Note Source # 

Methods

showsPrec :: Int -> Note -> ShowS #

show :: Note -> String #

showList :: [Note] -> ShowS #

Equiv Note Source # 

Methods

equiv :: Note -> Note -> Bool Source #

Nte Note Source # 

Methods

noteMap :: (Note -> Note) -> Note -> Note Source #

($#) :: (Note -> Note) -> Note -> Note Source #

notePlus :: (Note -> Note -> b) -> Note -> Note -> b Source #

Deg Scale Note Source # 
Deg Chord Note Source # 

class Nte a where Source #

Many musical objects have a note at their core (scales, chords, ...). The Nte class allows these objects to make use of all the note-manipulating functions.

Minimal complete definition

noteMap, notePlus

Methods

noteMap :: (Note -> Note) -> a -> a Source #

Applies a Note manipulating function to an instance of the Nte class.

($#) :: (Note -> Note) -> a -> a Source #

Operator for noteMap.

notePlus :: (Note -> Note -> b) -> a -> a -> b Source #

Applies a Note combining function to an instance of the Nte class.

Instances

Nte Note Source # 

Methods

noteMap :: (Note -> Note) -> Note -> Note Source #

($#) :: (Note -> Note) -> Note -> Note Source #

notePlus :: (Note -> Note -> b) -> Note -> Note -> b Source #

Nte Degree Source # 

Methods

noteMap :: (Note -> Note) -> Degree -> Degree Source #

($#) :: (Note -> Note) -> Degree -> Degree Source #

notePlus :: (Note -> Note -> b) -> Degree -> Degree -> b Source #

Nte Scale Source # 

Methods

noteMap :: (Note -> Note) -> Scale -> Scale Source #

($#) :: (Note -> Note) -> Scale -> Scale Source #

notePlus :: (Note -> Note -> b) -> Scale -> Scale -> b Source #

Nte Chord Source # 

Methods

noteMap :: (Note -> Note) -> Chord -> Chord Source #

($#) :: (Note -> Note) -> Chord -> Chord Source #

notePlus :: (Note -> Note -> b) -> Chord -> Chord -> b Source #

Nte Key Source # 

Methods

noteMap :: (Note -> Note) -> Key -> Key Source #

($#) :: (Note -> Note) -> Key -> Key Source #

notePlus :: (Note -> Note -> b) -> Key -> Key -> b Source #

class Nts a where Source #

Used to extract a list of notes from something (scale, chord, ...).

Minimal complete definition

notes

Methods

notes :: a -> [Note] Source #

Returns a list of Notes from a Nts instance.

Instances

next :: Note -> Note Source #

Returns the next natural Note in the cycle:

  C -> D -> E -> F -> G -> A -> B 
  ^------------------------------

prev :: Note -> Note Source #

Returns the previous natural Note in the cycle:

  C -> B -> A -> G -> F -> E -> D 
  ^------------------------------

above :: Interval -> Note -> Note Source #

Applies the specified Interval upwards to a Note, returning the Note above.

below :: Interval -> Note -> Note Source #

Applies the specified Interval downwards to a Note, returning the Note below.

distance :: Note -> Note -> Interval Source #

Returns the Interval between the two Notes.

raise :: Note -> Note Source #

Raises a Note by a semitone by applying an accidental. The note name stays the same.

lower :: Note -> Note Source #

Lowers a Note by a semitone by applying an accidental. The note name stays the same.

sharp :: Note -> Note Source #

Alias for raise.

flat :: Note -> Note Source #

Alias for lower.

natural :: Note -> Note Source #

Strips all Accidentals from a Note.

accidental :: Note -> Accidental Source #

Return the Accidental applied to the Note.

canonize :: Note -> Note Source #

Brings a Note to it's most straight forward representation. For example:

canonize (sharp B) == C

circleOfFifths :: Note -> [Note] Source #

Returns a list of 15 Notes representing the circle of fifths centered around the specified Note (which is always the 7th element in the list). For example:

circleOfFifths C = [Gb,Db,Ab,Eb,Bb,F,C,G,D,A,E,B,F#] 

transpose :: Nte a => Interval -> (Interval -> Note -> Note) -> a -> a Source #

Transposes instances of the Nte class using the given Interval and tranposition function. A typical use would be:

transpose Min3rd above [D, sharp F, A] == [F,A,C]