summaryrefslogtreecommitdiff
path: root/src/unheard/theory.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/unheard/theory.clj')
-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