Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 5b33d3a

Browse files
Merge branch '1.10-dev-clock' into 1.9-dev-clock
2 parents 8d6bf14 + 4f71910 commit 5b33d3a

File tree

16 files changed

+1926
-633
lines changed

16 files changed

+1926
-633
lines changed

.github/workflows/listener-build-linux.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build-listener-linux
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths-ignore:
5+
- "**.md"
6+
pull_request:
7+
paths-ignore:
8+
- "**.md"
49

510
jobs:
611
build:

.github/workflows/listener-build-macosx.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build-listener-macosx
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths-ignore:
5+
- "**.md"
6+
pull_request:
7+
paths-ignore:
8+
- "**.md"
49

510
jobs:
611
build:

.github/workflows/listener-build-windows.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build-listener-windows
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths-ignore:
5+
- "**.md"
6+
pull_request:
7+
paths-ignore:
8+
- "**.md"
49

510
jobs:
611
build:

.github/workflows/nix.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# A set of CI jobs for checking the Nix flake.
22

33
name: "nix"
4-
54
on:
6-
pull_request:
75
push:
8-
branches:
9-
- master
6+
paths-ignore:
7+
- "**.md"
8+
pull_request:
9+
paths-ignore:
10+
- "**.md"
1011

1112
jobs:
1213
cancel-previous-runs:
@@ -31,7 +32,7 @@ jobs:
3132
needs: cancel-previous-runs
3233
strategy:
3334
matrix:
34-
package: [tidal, tidal-link, tidal-listener, tidal-parse]
35+
package: [tidal, tidal-link, tidal-parse]
3536
os: [ubuntu-latest, macos-latest]
3637
runs-on: ${{ matrix.os }}
3738
steps:

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ compiler/interpreter. Some resources for learning Haskell can be found here:
2020
The main repository is maintained on github:
2121
https://github.com/tidalcycles/tidal
2222

23-
**Please note that ongoing development work towards version 2.0 happens on the 'main'
24-
branch. At the time of writing, bugfixes for current releases should target
25-
the '1.9-dev' branch.**
23+
**At the time of writing, current work should target the '1.9-dev' branch. The 2.0-dev branch is for experiments towards version 2.0.**
2624

2725
The SuperDirt repository is here:
2826
https://github.com/musikinformatik/SuperDirt

src/Sound/Tidal/Chords.hs

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import Data.Maybe
2222

2323
import Sound.Tidal.Pattern
2424

25-
-- major chords
25+
-- * Chord definitions
26+
27+
-- ** Major chords
28+
2629
major :: Num a => [a]
2730
major = [0,4,7]
2831
aug :: Num a => [a]
@@ -45,7 +48,9 @@ major13 :: Num a => [a]
4548
major13 = [0,4,7,11,14,21]
4649
add13 :: Num a => [a]
4750
add13 = [0,4,7,21]
48-
-- dominant chords
51+
52+
-- ** Dominant chords
53+
4954
dom7 :: Num a => [a]
5055
dom7 = [0,4,7,10]
5156
dom9 :: Num a => [a]
@@ -66,7 +71,9 @@ eleven :: Num a => [a]
6671
eleven = [0,4,7,10,14,17]
6772
thirteen :: Num a => [a]
6873
thirteen = [0,4,7,10,14,17,21]
69-
-- minor chords
74+
75+
-- ** Minor chords
76+
7077
minor :: Num a => [a]
7178
minor = [0,3,7]
7279
diminished :: Num a => [a]
@@ -97,7 +104,9 @@ minor13 :: Num a => [a]
97104
minor13 = [0,3,7,10,14,17,21]
98105
minorMajor7 :: Num a => [a]
99106
minorMajor7 = [0,3,7,11]
100-
-- other chords
107+
108+
-- ** Other chords
109+
101110
one :: Num a => [a]
102111
one = [0]
103112
five :: Num a => [a]
@@ -112,7 +121,9 @@ sevenSus4 :: Num a => [a]
112121
sevenSus4 = [0,5,7,10]
113122
nineSus4 :: Num a => [a]
114123
nineSus4 = [0,5,7,10,14]
115-
-- questionable chords
124+
125+
-- ** Questionable chords
126+
116127
sevenFlat10 :: Num a => [a]
117128
sevenFlat10 = [0,4,7,10,15]
118129
nineSharp5 :: Num a => [a]
@@ -128,6 +139,8 @@ elevenSharp = [0,4,7,10,14,18]
128139
minor11sharp :: Num a => [a]
129140
minor11sharp = [0,3,7,10,14,18]
130141

142+
-- * Chord functions
143+
131144
-- | @chordate cs m n@ selects the @n@th "chord" (a chord is a list of Ints)
132145
-- from a list of chords @cs@ and transposes it by @m@
133146
-- chordate :: Num b => [[b]] -> b -> Int -> [b]
@@ -140,6 +153,22 @@ minor11sharp = [0,3,7,10,14,18]
140153
-- enchord :: Num a => [[a]] -> Pattern a -> Pattern Int -> Pattern a
141154
-- enchord chords pn pc = flatpat $ (chordate chords) <$> pn <*> pc
142155

156+
{-|
157+
The @chordTable@ function outputs a list of all available chords and their
158+
corresponding notes. For example, its first entry is @("major",[0,4,7])@ which
159+
means that a major triad is formed by the root (0), the major third (4 semitones
160+
above the root), and the perfect fifth (7 semitones above the root).
161+
162+
As the list is big, you can use the function 'chordL'.
163+
164+
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:
165+
166+
> filter (\(_,x)->x==[0,4,7,10]) chordTable
167+
168+
This will output @[("dom7",[0,4,7,10])]@
169+
170+
(You’ll need to run @import Sound.Tidal.Chords@ before using this function.)
171+
-}
143172
chordTable :: Num a => [(String, [a])]
144173
chordTable = [("major", major),
145174
("maj", major),
@@ -273,9 +302,31 @@ chordTable = [("major", major),
273302
("m11s", minor11sharp)
274303
]
275304

305+
-- | Look up a specific chord: @chordL "minor7"@ returns @(0>1)|[0,3,7,10]@.
276306
chordL :: Num a => Pattern String -> Pattern [a]
277307
chordL p = (\name -> fromMaybe [] $ lookup name chordTable) <$> p
278308

309+
{-|
310+
Outputs all the available chords:
311+
312+
@
313+
major maj M aug plus sharp5 six 6 sixNine six9 sixby9 6by9 major7 maj7
314+
major9 maj9 add9 major11 maj11 add11 major13 maj13 add13 dom7 dom9 dom11
315+
dom13 sevenFlat5 7f5 sevenSharp5 7s5 sevenFlat9 7f9 nine eleven 11 thirteen 13
316+
minor min m diminished dim minorSharp5 msharp5 mS5 minor6 min6 m6 minorSixNine
317+
minor69 min69 minSixNine m69 mSixNine m6by9 minor7flat5 minor7f5 min7flat5
318+
min7f5 m7flat5 m7f5 minor7 min7 m7 minor7sharp5 minor7s5 min7sharp5 min7s5
319+
m7sharp5 m7s5 minor7flat9 minor7f9 min7flat9 min7f9 m7flat9 m7f9 minor7sharp9
320+
minor7s9 min7sharp9 min7s9 m7sharp9 m7s9 diminished7 dim7 minor9 min9 m9
321+
minor11 min11 m11 minor13 min13 m13 minorMajor7 minMaj7 mmaj7 one 1 five 5
322+
sus2 sus4 sevenSus2 7sus2 sevenSus4 7sus4 nineSus4 ninesus4 9sus4 sevenFlat10
323+
7f10 nineSharp5 9sharp5 9s5 minor9sharp5 minor9s5 min9sharp5 min9s5 m9sharp5
324+
m9s5 sevenSharp5flat9 7s5f9 minor7sharp5flat9 m7sharp5flat9 elevenSharp 11s
325+
minor11sharp m11sharp m11s
326+
@
327+
328+
(You’ll need to run @import Sound.Tidal.Chords@ before using this function.)
329+
-}
279330
chordList :: String
280331
chordList = unwords $ map fst (chordTable :: [(String, [Int])])
281332

@@ -317,6 +368,7 @@ chordToPatSeq f noteP nameP modsP = uncollect $ do
317368
let ch = map (+ n) (fromMaybe [0] $ lookup name chordTable)
318369
applyModifierPatSeq f (return ch) modsP
319370

320-
-- | turns a given pattern of some Num type, a pattern of chord names and a list of patterns of modifiers into a chord pattern
371+
-- | Turns a given pattern of some 'Num' type, a pattern of chord names, and a
372+
-- list of patterns of modifiers into a chord pattern
321373
chord :: (Num a, Enum a) => Pattern a -> Pattern String -> [Pattern [Modifier]] -> Pattern a
322374
chord = chordToPatSeq id

0 commit comments

Comments
 (0)