diff options
| author | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 14:15:51 -0500 |
|---|---|---|
| committer | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 14:25:38 -0500 |
| commit | 1941fed92200e60c0912115e4eb87d114c206383 (patch) | |
| tree | dc0d62f1076fd93eca33faa6020b755a843d5d31 /dev/scratch.clj | |
| parent | a1e2543142761bde35d9d3a2cfb46da952a8d064 (diff) | |
Abstract out triad
Diffstat (limited to 'dev/scratch.clj')
| -rw-r--r-- | dev/scratch.clj | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/dev/scratch.clj b/dev/scratch.clj index cb9a249..9bfac2c 100644 --- a/dev/scratch.clj +++ b/dev/scratch.clj @@ -9,19 +9,23 @@ (def midi-keyboard "CoreMIDI4J - Minilab3 MIDI") +(defn triad [>c >tonic] + (poly + ;; This is a major cord, + ;; held 32 32nd notes. + ;; The tonic can vary. + (note >c 0 32 >tonic) + (note >c 0 32 (m/latest #(+ % 4) >tonic)) + (note >c 0 32 (m/latest #(+ % 7) >tonic)))) + (defn song [>c >tonic] (poly - (poly - ;; This is a major cord, - ;; held 32 32nd notes. - ;; The tonic can vary. - (note >c 0 32 >tonic) - (note >c 0 32 (m/latest #(+ % 4) >tonic)) - (note >c 0 32 (m/latest #(+ % 7) >tonic))) + (triad >c >tonic) + (triad >c (m/latest #(+ % 12) >tonic)) ;; The rest of the "song" is a drum pattern. - (note >c 1 1 (m/ap kick)) + (note >c 1 1 (m/ap kick)) (note >c 9 1 (m/ap kick)) (note >c 17 1 (m/ap kick)) (note >c 25 1 (m/ap kick)) |
