Skip to content

Commit

Permalink
Play a special chime if video_impression increases by > 10%
Browse files Browse the repository at this point in the history
  • Loading branch information
samn committed Jun 20, 2012
1 parent 25b693f commit 9f12b29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/videochime.clj
Expand Up @@ -56,6 +56,15 @@
of a counter" of a counter"
first) first)


(defmethod chime :video_impression
[[event old new]]
(if (< (- new old) (* 0.1 old))
(noise/schedule-chime (noise/random-time) noise/chime 65)
(let [note 85
base (- noise/*chime-length* 1000)]
(doseq [x (range 3)]
(noise/schedule-chime (+ base (* x 200)) noise/chime note)))))

(defmethod chime :default (defmethod chime :default
[[event old new]] [[event old new]]
(let [pitch (match (compare old new) (let [pitch (match (compare old new)
Expand Down

0 comments on commit 9f12b29

Please sign in to comment.