Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
solsarratea committed Dec 12, 2019
1 parent 81c349a commit fc57453
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/overtone_midi/piano_midi.clj
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@
"Plays event on piano at specified time. "

[{:keys [note velocity duration] :as event} time]
(println event)
(println "Plays " note " whith velocity " velocity " for " (/ duration 1000 ) )
(live/at time
(piano
:note note
:velocity velocity
:sustain (.floatValue (/ duration 1000) ))))

(defn play-on-piano
"Plays sequence of events on piano."
"Plays sequence of events on piano.
Make it faster/slower by using tempo."

([events] (play-on-piano events 1))
([events tempo]
Expand All @@ -89,12 +88,11 @@
next-time (+ time in-between-time)]
(when (not (nil? actuals))
(do
(println "In between time " in-between-time)
(doall
(map #(live-piano % time) actuals))
(recur next-time next (rest ev-rest))))))))


(comment
(def midif (midi "love-dream"))
(play-on-piano (take 300 (parse-midi midif))))
(play-on-piano (parse-midi midif))))
4 changes: 1 addition & 3 deletions test/overtone_midi/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
(:require [clojure.test :refer :all]
[overtone-midi.core :refer :all]))

(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
(deftest a-test)

0 comments on commit fc57453

Please sign in to comment.