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

Safe HaskellSafe-Inferred

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 

class Nte a whereSource

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.

Methods

noteMap :: (Note -> Note) -> a -> aSource

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

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

Operator for noteMap.

notePlus :: (Note -> Note -> b) -> a -> a -> bSource

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

class Nts a whereSource

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

Methods

notes :: a -> [Note]Source

Returns a list of Notes from a Nts instance.

next :: Note -> NoteSource

Returns the next natural Note in the cycle:

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

prev :: Note -> NoteSource

Returns the previous natural Note in the cycle:

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

above :: Interval -> Note -> NoteSource

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

below :: Interval -> Note -> NoteSource

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

distance :: Note -> Note -> IntervalSource

Returns the Interval between the two Notes.

raise :: Note -> NoteSource

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

lower :: Note -> NoteSource

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

sharp :: Note -> NoteSource

Alias for raise.

flat :: Note -> NoteSource

Alias for lower.

natural :: Note -> NoteSource

Strips all Accidentals from a Note.

accidental :: Note -> AccidentalSource

Return the Accidental applied to the Note.

canonize :: Note -> NoteSource

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 -> aSource

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]

data Accidental Source

Accidentals are rarely used directly. To alter Notes, use the raise and lower functions (or their sharp and flat aliases).

Constructors

Sharp 
Flat 
Natural