HarmTrace-Base-1.5.3.1: Parsing and unambiguously representing musical chords.

Copyright(c) 2012--2016, Chordify BV
LicenseLGPL-3
Maintainerhaskelldevelopers@chordify.net
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

HarmTrace.Base.Chord.Intervals

Contents

Description

Summary: We can represent a chord as a set of intervals relative to the root of the chord.

Synopsis

Interval Conversion

icToInterval :: Int -> Interval Source #

Converts an Interval class to an Interval

toIntervalClss :: Interval -> Int Source #

Similar to toPitchClss, this function calculates an enharmonic interval class for each 'Note Interval' in the range of [0 .. 23] ( == ['Note Nat I1' .. 'Note SS I13']

Creating Interval Sets

toIntSet :: Chord a -> IntSet Source #

Transforms a Chord into a list of relative intervals stored as an IntSet without the root an bass note represented as the number of semitones above the root.

>>> toIntSet (Chord (Note Nat C) HDim7 [Add (Note Sh I11)] (Note Fl I3))
fromList [3,6,10,18]
>>> toIntSet (Chord (Note Nat C) Min13 [NoAdd (Note Nat I11)] (Note Nat I1))
fromList [3,7,10,14,21]
>>> toIntSet (parseData pChord "D:7(b9)")
fromList [4,7,10,13]

Utilities

addToIntSet :: [Addition] -> IntSet Source #

Converts a list of addition to an IntSet containing the relative structure of the (Addition list of the) Chord

shToIntSet :: Shorthand -> IntSet Source #

Expands a Shorthand to its list of degrees