diff options
| author | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 13:26:52 -0500 |
|---|---|---|
| committer | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 13:39:18 -0500 |
| commit | a1e2543142761bde35d9d3a2cfb46da952a8d064 (patch) | |
| tree | 7e2d47ef955e2723caa511f1f54be24c6ef07c36 /src | |
| parent | 576bfd688fc8a65de176d4f1fbf9bf71505953a9 (diff) | |
Create second instrument (keyboard) with separate input
Diffstat (limited to 'src')
| -rw-r--r-- | src/unheard/theory.clj | 13 |
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 |
