diff clojure/com/aurellem/run/music.clj @ 456:9c192737034d

fixed silence at end, and increased tempo.
author Robert McIntyre <rlm@mit.edu>
date Thu, 03 May 2012 11:24:46 -0500
parents 1c10fa8366a7
children a2ae4213deb7
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/music.clj	Thu May 03 10:28:05 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/music.clj	Thu May 03 11:24:46 2012 -0500
     1.3 @@ -446,14 +446,18 @@
     1.4               notes)
     1.5          
     1.6          notes-with-silence
     1.7 -        (filter (comp not zero? :duration)
     1.8 -                (interleave silences notes))]
     1.9 -    (map
    1.10 -     (fn [note-event]
    1.11 -       (note-codes (:frequency note-event)
    1.12 -                   (:volume note-event)
    1.13 -                   (int (* (:duration note-event) 0x100))))
    1.14 -     notes-with-silence)))
    1.15 +        (concat
    1.16 +         (filter (comp not zero? :duration)
    1.17 +                 (interleave silences notes))
    1.18 +         [(silence 3)])]
    1.19 +
    1.20 +     (map
    1.21 +      (fn [note-event]
    1.22 +        (note-codes (:frequency note-event)
    1.23 +                    (:volume note-event)
    1.24 +                    (int (* (:duration note-event) 0x100))))
    1.25 +      notes-with-silence)))
    1.26 +     
    1.27  
    1.28  (defn midi->mini-midi [#^File midi-file]
    1.29    {:track-1 (flatten (midi-track->mini-midi midi-file 0))