| Copyright | (c) 2012--2016, Chordify BV |
|---|---|
| License | LGPL-3 |
| Maintainer | haskelldevelopers@chordify.net |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
HarmTrace.Base.Chord.Intervals
Description
Summary: We can represent a chord as a set of intervals relative to the root of the chord.
- icToInterval :: Int -> Interval
- toIntervalClss :: Interval -> Int
- toIntSet :: Chord a -> IntSet
- addToIntSet :: [Addition] -> IntSet
- shToIntSet :: Shorthand -> IntSet
Interval Conversion
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 #