                                      :midi-message nil})))
         state))))
 
-(defn play [& [notes sequencer state]]
+(defn play [& [notes sequencer state _]]
   (let [sequencer (or sequencer *sequencer*)
         state (compose (or notes '()) sequencer state)]
     (when (nil? notes)

    (.start sequencer)
    (while (.isRunning sequencer) (Thread/sleep 100))))

(defn clear [& [sequencer]]
  (let [sequencer (or sequencer *sequencer*)
        sequence (.getSequence sequencer)]
    (doseq [track (.getTracks sequence)]

(def ^:dynamic *seq* (Sequence. Sequence/PPQ 256))
(def ^:dynamic *synth* (MidiSystem/getSynthesizer))

(defn load-soundfont [soundfont & [synth _]]
  (let [synth (or synth *synth*)
        soundbank (SF2Soundbank. (java.io.FileInputStream. soundfont))]
    (.loadAllInstruments synth soundbank)))

(defn make-sequencer [& [sequence synth _]]
  (let [sequence (or sequence *seq*)
        synth (or synth *synth*)
        sequencer (MidiSystem/getSequencer false)]
