diff options
| author | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 11:17:12 -0500 |
|---|---|---|
| committer | Jake Zerrer <him@jakezerrer.com> | 2025-11-06 12:32:15 -0500 |
| commit | 576bfd688fc8a65de176d4f1fbf9bf71505953a9 (patch) | |
| tree | 437c1528646774253f12f640fb4203ff4dbd9548 /src | |
| parent | befc0162943944b88108cce208ef443822def7d2 (diff) | |
Create first clock-based composition
Diffstat (limited to 'src')
| -rw-r--r-- | src/unheard/theory.clj | 9 |
1 files changed, 5 insertions, 4 deletions
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 |
