| 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.Analysis
Description
Summary: Analyses and transforms musical chords
- analyseTriad :: IntSet -> Triad
 - analyseTetra :: IntSet -> Shorthand
 - toTriad :: Chord a -> Triad
 - toMajMinChord :: ChordLabel -> ChordLabel
 - data Third
 - data Fifth
 - data Sevth
 - analyseThird :: IntSet -> Third
 - analyseFifth :: IntSet -> Fifth
 - analyseSevth :: IntSet -> Sevth
 - toMode :: Triad -> Mode
 - toMajMin :: Triad -> ClassType
 - toClassType :: Chord a -> ClassType
 - isSus2 :: ChordLabel -> Bool
 - isSus4 :: ChordLabel -> Bool
 - transposeRoot :: Root -> Int -> Root
 - transposeCL :: ChordLabel -> Int -> ChordLabel
 - transposeSD :: ScaleDegree -> Int -> ScaleDegree
 - toChordDegree :: Key -> ChordLabel -> ChordDegree
 - toScaleDegree :: Key -> Root -> ScaleDegree
 - intervalToPitch :: Root -> Interval -> Root
 - pitchToInterval :: Root -> Root -> Interval
 - toChord :: Root -> IntSet -> Interval -> Chord Root
 
Analysis
Triads and Sevenths
analyseTriad :: IntSet -> Triad Source #
analyseTetra :: IntSet -> Shorthand Source #
Analyses the structure of an IntSet and returns an appropriate
 ShortHand, if possible
toTriad :: Chord a -> Triad Source #
Takes a Chord and determines the Triad
>>>toTriad (Chord (Note Nat C) Min [NoAdd (Note Fl I3),Add (Note Nat I3)] 0 0)maj
>>>toTriad (Chord (Note Nat C) HDim7 [Add (Note Sh I11)] 0 0)dim
>>>toTriad (Chord (Note Nat C) Min [NoAdd (Note Fl I3)] 0 0)NoTriad
N.B. toTriad throws an error when applied to a NoChord or UndefChord.
toMajMinChord :: ChordLabel -> ChordLabel Source #
applies toMajMin to a Chord, in case there is no triad, e.g.
 :sus4 or :sus2, an UndefChord is returned. Also, chord
 additions are removed. NoChords and UndefChords are returned untouched.
Chord components
A Third can by major, minor or absent
A Fifth can be perfect, diminished, augmented or absent
A seventh can be major, minor, diminished, or absent
analyseThird :: IntSet -> Third Source #
analyses the third in a degree list
analyseFifth :: IntSet -> Fifth Source #
analyses the fifth in a degree list
analyseSevth :: IntSet -> Sevth Source #
analyses the fifth in a degree list
Misc
toClassType :: Chord a -> ClassType Source #
isSus2 :: ChordLabel -> Bool Source #
Returns True if the ChordLabel has a major second, no third,
 and no fourth.
isSus4 :: ChordLabel -> Bool Source #
Returns True if the ChordLabel has a no major second, no third,
 but has a fourth.
Scale degree transposition
transposeCL :: ChordLabel -> Int -> ChordLabel Source #
Transposes a ChordLabel with a Int semitones up
transposeSD :: ScaleDegree -> Int -> ScaleDegree Source #
Transposes a scale degree with Int semitones up
toChordDegree :: Key -> ChordLabel -> ChordDegree Source #
Given a Key, calculates the the ChordDegree (i.e. relative,
 ScaleDegree based Chord) for an absolute ChordLabel using
 toScaleDegree.
toScaleDegree :: Key -> Root -> ScaleDegree Source #
Transformes a absolute Root Note into a relative ScaleDegree, given
 a Key.
intervalToPitch :: Root -> Interval -> Root Source #
Similar to toScaleDegree, an interval is transformed into an absolute
 Root pitch, given another Root that serves as a basis.
>>>intervalToPitch (Note Sh G) (Note Fl I13)>>>E
>>>intervalToPitch (Note Nat C) (Note Sh I11)>>>F#
pitchToInterval :: Root -> Root -> Interval Source #
The inverse of intervalToPitch