tidal-1.9.5: Pattern language for improvised music
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Tidal.Chords

Synopsis

Chord definitions

Major chords

major :: Num a => [a] Source #

aug :: Num a => [a] Source #

six :: Num a => [a] Source #

sixNine :: Num a => [a] Source #

major7 :: Num a => [a] Source #

major9 :: Num a => [a] Source #

add9 :: Num a => [a] Source #

major11 :: Num a => [a] Source #

add11 :: Num a => [a] Source #

major13 :: Num a => [a] Source #

add13 :: Num a => [a] Source #

Dominant chords

dom7 :: Num a => [a] Source #

dom9 :: Num a => [a] Source #

dom11 :: Num a => [a] Source #

dom13 :: Num a => [a] Source #

sevenFlat5 :: Num a => [a] Source #

sevenSharp5 :: Num a => [a] Source #

sevenFlat9 :: Num a => [a] Source #

nine :: Num a => [a] Source #

eleven :: Num a => [a] Source #

thirteen :: Num a => [a] Source #

Minor chords

minor :: Num a => [a] Source #

diminished :: Num a => [a] Source #

minorSharp5 :: Num a => [a] Source #

minor6 :: Num a => [a] Source #

minorSixNine :: Num a => [a] Source #

minor7flat5 :: Num a => [a] Source #

minor7 :: Num a => [a] Source #

minor7sharp5 :: Num a => [a] Source #

minor7flat9 :: Num a => [a] Source #

minor7sharp9 :: Num a => [a] Source #

diminished7 :: Num a => [a] Source #

minor9 :: Num a => [a] Source #

minor11 :: Num a => [a] Source #

minor13 :: Num a => [a] Source #

minorMajor7 :: Num a => [a] Source #

Other chords

one :: Num a => [a] Source #

five :: Num a => [a] Source #

sus2 :: Num a => [a] Source #

sus4 :: Num a => [a] Source #

sevenSus2 :: Num a => [a] Source #

sevenSus4 :: Num a => [a] Source #

nineSus4 :: Num a => [a] Source #

Questionable chords

sevenFlat10 :: Num a => [a] Source #

nineSharp5 :: Num a => [a] Source #

minor9sharp5 :: Num a => [a] Source #

elevenSharp :: Num a => [a] Source #

minor11sharp :: Num a => [a] Source #

Chord functions

chordTable :: Num a => [(String, [a])] Source #

chordate cs m n selects the nth "chord" (a chord is a list of Ints) from a list of chords cs and transposes it by m chordate :: Num b => [[b]] -> b -> Int -> [b] chordate cs m n = map (+m) $ cs!!n

enchord chords pn pc turns every note in the note pattern pn into a chord, selecting from the chord lists chords using the index pattern pc. For example, Chords.enchord [Chords.major Chords.minor] "c g" "0 1" will create a pattern of a C-major chord followed by a G-minor chord. enchord :: Num a => [[a]] -> Pattern a -> Pattern Int -> Pattern a enchord chords pn pc = flatpat $ (chordate chords) $ pn * pc

The chordTable function outputs a list of all available chords and their corresponding notes. For example, its first entry is ("major",[0,4,7]) which means that a major triad is formed by the root (0), the major third (4 semitones above the root), and the perfect fifth (7 semitones above the root).

As the list is big, you can use the function chordL.

If you know the notes from a chord, but can’t find the name of it, you can use this Haskell code to do a reverse look up into the table:

filter (\(_,x)->x==[0,4,7,10]) chordTable

This will output [("dom7",[0,4,7,10])]

(You’ll need to run import Sound.Tidal.Chords before using this function.)

chordL :: Num a => Pattern String -> Pattern [a] Source #

Look up a specific chord: chordL "minor7" returns (0>1)|[0,3,7,10].

chordList :: String Source #

Outputs all the available chords:

major maj M aug plus sharp5 six 6 sixNine six9 sixby9 6by9 major7 maj7
major9 maj9 add9 major11 maj11 add11 major13 maj13 add13 dom7 dom9 dom11
dom13 sevenFlat5 7f5 sevenSharp5 7s5 sevenFlat9 7f9 nine eleven 11 thirteen 13
minor min m diminished dim minorSharp5 msharp5 mS5 minor6 min6 m6 minorSixNine
minor69 min69 minSixNine m69 mSixNine m6by9 minor7flat5 minor7f5 min7flat5
min7f5 m7flat5 m7f5 minor7 min7 m7 minor7sharp5 minor7s5 min7sharp5 min7s5
m7sharp5 m7s5 minor7flat9 minor7f9 min7flat9 min7f9 m7flat9 m7f9 minor7sharp9
minor7s9 min7sharp9 min7s9 m7sharp9 m7s9 diminished7 dim7 minor9 min9 m9
minor11 min11 m11 minor13 min13 m13 minorMajor7 minMaj7 mmaj7 one 1 five 5
sus2 sus4 sevenSus2 7sus2 sevenSus4 7sus4 nineSus4 ninesus4 9sus4 sevenFlat10
7f10 nineSharp5 9sharp5 9s5 minor9sharp5 minor9s5 min9sharp5 min9s5 m9sharp5
m9s5 sevenSharp5flat9 7s5f9 minor7sharp5flat9 m7sharp5flat9 elevenSharp 11s
minor11sharp m11sharp m11s

(You’ll need to run import Sound.Tidal.Chords before using this function.)

data Modifier Source #

Constructors

Range Int 
Drop Int 
Invert 
Open 

Instances

Instances details
Show Modifier Source # 
Instance details

Defined in Sound.Tidal.Chords

Eq Modifier Source # 
Instance details

Defined in Sound.Tidal.Chords

Enumerable [Modifier] Source # 
Instance details

Defined in Sound.Tidal.ParseBP

Parseable [Modifier] Source # 
Instance details

Defined in Sound.Tidal.ParseBP

applyModifier :: (Enum a, Num a) => Modifier -> [a] -> [a] Source #

applyModifierPatSeq :: (Num a, Enum a) => (a -> b) -> Pattern [a] -> [Pattern [Modifier]] -> Pattern [b] Source #

chordToPatSeq :: (Num a, Enum a) => (a -> b) -> Pattern a -> Pattern String -> [Pattern [Modifier]] -> Pattern b Source #

chord :: (Num a, Enum a) => Pattern a -> Pattern String -> [Pattern [Modifier]] -> Pattern a Source #

Turns a given pattern of some Num type, a pattern of chord names, and a list of patterns of modifiers into a chord pattern