Mercurial > vba-clojure
comparison clojure/com/aurellem/run/music.clj @ 481:221b3fea9221
slight cleanup.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 04 May 2012 09:03:34 -0500 |
parents | 91db9d1ce213 |
children | 346b91ae503a |
comparison
equal
deleted
inserted
replaced
480:91db9d1ce213 | 481:221b3fea9221 |
---|---|
7 (:require clojure.string) | 7 (:require clojure.string) |
8 (:import [com.aurellem.gb.gb_driver SaveState]) | 8 (:import [com.aurellem.gb.gb_driver SaveState]) |
9 (:import java.io.File)) | 9 (:import java.io.File)) |
10 | 10 |
11 (def pony | 11 (def pony |
12 (File. "/home/r/proj/vba-clojure/music/pony-title.mid")) | 12 (File. user-home "/proj/vba-clojure/music/pony-title.mid")) |
13 | 13 |
14 (def pony-csv | 14 (def pony-csv |
15 (File. "/home/r/proj/vba-clojure/music/pony-title.csv")) | 15 (File. user-home "proj/vba-clojure/music/pony-title.csv")) |
16 | 16 |
17 (def sync-test | 17 (def sync-test |
18 (File. "/home/r/proj/vba-clojure/music/sync-test.mid")) | 18 (File. user-home "proj/vba-clojure/music/sync-test.mid")) |
19 | 19 |
20 (def drum-test | 20 (def drum-test |
21 (File. "/home/r/proj/vba-clojure/music/drum-test.mid")) | 21 (File. user-home "proj/vba-clojure/music/drum-test.mid")) |
22 | 22 |
23 (def regret | 23 (def regret |
24 (File. "/home/r/proj/vba-clojure/music/ship-of-regret-and-sleep.mid")) | 24 (File. user-home "proj/vba-clojure/music/ship-of-regret-and-sleep.mid")) |
25 | 25 |
26 (def regret-csv | 26 (def regret-csv |
27 (File. "/home/r/proj/vba-clojure/music/ship-of-regret-and-sleep.csv")) | 27 (File. user-home "proj/vba-clojure/music/ship-of-regret-and-sleep.csv")) |
28 | 28 |
29 (def mother | 29 (def mother |
30 (File. "/home/r/proj/vba-clojure/music/mother.mid")) | 30 (File. user-home "proj/vba-clojure/music/mother.mid")) |
31 | 31 |
32 (def mother-csv | 32 (def mother-csv |
33 (File. "/home/r/proj/vba-clojure/music/mother.csv")) | 33 (File. user-home "proj/vba-clojure/music/mother.csv")) |
34 | 34 |
35 | 35 |
36 (defn raw-midi-text [#^File midi-file] | 36 (defn raw-midi-text [#^File midi-file] |
37 (let [extention (apply str (take-last 3 (.getCanonicalPath | 37 (let [extention (apply str (take-last 3 (.getCanonicalPath |
38 midi-file)))] | 38 midi-file)))] |
686 500 | 686 500 |
687 [0xF0 | 687 [0xF0 |
688 0x05])])) | 688 0x05])])) |
689 | 689 |
690 (defn play-pony [] | 690 (defn play-pony [] |
691 (println "playing" (.getName pony-csv)) | |
691 (run-moves (play-midi pony-csv) (repeat 1800 []))) | 692 (run-moves (play-midi pony-csv) (repeat 1800 []))) |
692 | 693 |
693 (defn play-regret [] | 694 (defn play-regret [] |
695 (println "playing" (.getName regret-csv)) | |
694 (run-moves (play-midi regret-csv) (repeat 3380 []))) | 696 (run-moves (play-midi regret-csv) (repeat 3380 []))) |
695 | 697 |
696 (defn play-mother [] | 698 (defn play-mother [] |
699 (println "playing" (.getName mother-csv)) | |
697 (run-moves (play-midi mother-csv) (repeat 2200 []))) | 700 (run-moves (play-midi mother-csv) (repeat 2200 []))) |
698 | 701 |
699 (defn demo [] (play-mother) (play-regret) (play-pony)) | 702 (defn demo [] (play-mother) (play-regret) (play-pony)) |
700 | 703 |
701 | 704 |