summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))