From 576bfd688fc8a65de176d4f1fbf9bf71505953a9 Mon Sep 17 00:00:00 2001 From: Jake Zerrer Date: Thu, 6 Nov 2025 11:17:12 -0500 Subject: Create first clock-based composition --- src/unheard/theory.clj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/unheard/theory.clj b/src/unheard/theory.clj index 5d5805b..0fbc6d5 100644 --- a/src/unheard/theory.clj +++ b/src/unheard/theory.clj @@ -4,12 +4,13 @@ (defn note [clock start duration value] (m/cp - (if (m/?< (m/latest #(<= start % (dec (+ start duration))) clock)) - #{value} - #{}))) + (let [v (m/?< clock)] + (if (<= start v (dec (+ start duration))) + #{value} + #{})))) (defn poly [& notes] - (m/ap + (m/cp (apply union (m/?< (apply m/latest vector notes))))) ;; TODO: Group could actually wrap note, rather than using explicitly -- cgit v1.2.3