summaryrefslogtreecommitdiff
path: root/src/unheard
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-11-06 13:26:52 -0500
committerJake Zerrer <him@jakezerrer.com>2025-11-06 13:39:18 -0500
commita1e2543142761bde35d9d3a2cfb46da952a8d064 (patch)
tree7e2d47ef955e2723caa511f1f54be24c6ef07c36 /src/unheard
parent576bfd688fc8a65de176d4f1fbf9bf71505953a9 (diff)
Create second instrument (keyboard) with separate input
Diffstat (limited to 'src/unheard')
-rw-r--r--src/unheard/theory.clj13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/unheard/theory.clj b/src/unheard/theory.clj
index 0fbc6d5..d63532f 100644
--- a/src/unheard/theory.clj
+++ b/src/unheard/theory.clj
@@ -2,16 +2,17 @@
(:require [missionary.core :as m]
[clojure.set :refer [union]]))
-(defn note [clock start duration value]
+(defn note [>clock start duration >value]
(m/cp
- (let [v (m/?< clock)]
- (if (<= start v (dec (+ start duration)))
- #{value}
+ (let [[c v] (m/?< (m/latest vector >clock >value))]
+ (if (<= start c (dec (+ start duration)))
+ #{v}
#{}))))
(defn poly [& notes]
- (m/cp
- (apply union (m/?< (apply m/latest vector notes)))))
+ (m/signal
+ (m/cp
+ (apply union (m/?< (apply m/latest vector notes))))))
;; TODO: Group could actually wrap note, rather than using explicitly
;; WIll introduce a lot of GC churn, though