Browse files

Simple/interval canons can be expressed succinctly with partial.

  • Loading branch information...
1 parent dca559d commit ddf951a1aeec2248f0b32e242e5c5ccb9576e147 @ctford committed Oct 29, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/goldberg/variations/canone_alla_quarta.clj
8 src/goldberg/variations/canone_alla_quarta.clj
@@ -242,12 +242,8 @@
(defn canon [f notes] (concat notes (f notes)))
; flavours of canon
-(defn simple [lag]
- (fn [notes] (->> notes (where :time (from lag)))))
-(defn interval [interval]
- (fn [notes] (->> notes (where :pitch (from interval)))))
+(defn simple [lag] (partial where :time (from lag)))
+(defn interval [interval] (partial where :pitch (from interval)))
(def mirror (fn [notes] (->> notes (where :pitch -))))
(def crab (fn [notes] (->> notes (where :time -))))
(def table (comp mirror crab))

0 comments on commit ddf951a

Please sign in to comment.