summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-11-06 14:15:51 -0500
committerJake Zerrer <him@jakezerrer.com>2025-11-06 14:25:38 -0500
commit1941fed92200e60c0912115e4eb87d114c206383 (patch)
treedc0d62f1076fd93eca33faa6020b755a843d5d31
parenta1e2543142761bde35d9d3a2cfb46da952a8d064 (diff)
Abstract out triad
-rw-r--r--dev/scratch.clj20
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))