Permalink
Browse files

Play a special chime if video_impression increases by > 10%

  • Loading branch information...
1 parent 25b693f commit 9f12b29c34fd8d0a419d89846ab71571079a1db0 @samn committed Jun 20, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/videochime.clj
View
@@ -56,6 +56,15 @@
of a counter"
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
[[event old new]]
(let [pitch (match (compare old new)

0 comments on commit 9f12b29

Please sign in to comment.