changeset 434:988f0fda6c93

paramaterized music-step
author Robert McIntyre <rlm@mit.edu>
date Wed, 25 Apr 2012 01:58:44 -0500
parents 985c90ffa1fe
children 3939ad680681
files clojure/com/aurellem/run/music.clj
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/music.clj	Wed Apr 25 01:56:39 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/music.clj	Wed Apr 25 01:58:44 2012 -0500
     1.3 @@ -226,7 +226,7 @@
     1.4  ;;    0x2A   ;; load duration
     1.5  ;;    ]) 
     1.6  
     1.7 -(defn music-step []
     1.8 +(defn music-step [sound-base-address]
     1.9    ;; C == current-ticks
    1.10    ;; A == desired-ticks
    1.11  
    1.12 @@ -249,13 +249,15 @@
    1.13      ;;   go to next note ; set current set ticks to 0.
    1.14  
    1.15      0x20
    1.16 -    (+ (count (do-message)) 2)
    1.17 +    (+ (count (do-message 0)) 2)
    1.18  
    1.19 -    (do-message)
    1.20 +    (do-message sound-base-address)
    1.21      
    1.22      0x0E
    1.23      0x00])) ;; 0->C (current-ticks)
    1.24  
    1.25 +(def music-2 0x16)
    1.26 +
    1.27  (defn music-kernel []
    1.28    (flatten
    1.29     [;; global initilization section
    1.30 @@ -284,9 +286,9 @@
    1.31  
    1.32      
    1.33  
    1.34 -    (music-step)
    1.35 +    (music-step music-2)
    1.36      0x18
    1.37 -    (->signed-8-bit (+ (- (count (music-step)))
    1.38 +    (->signed-8-bit (+ (- (count (music-step 0)))
    1.39                         -2))]))
    1.40  
    1.41  (defn frequency-code->frequency