                             :param nil
                             :notes (rest notes)})
               ;; channel pressure, pitch bend, note on/off / key pressure by key number
-              (if-let [m (re-matches #"(&&|\^|&k|k|-k)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*|)(?:[eE]-?[0-9]+)?)?(-|)" note)]
+              (if-let [m (re-matches #"(&&|\^|&k|k|-k)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(?:[eE]-?[0-9]+)?|)(-|)" note)]
                 (let [max-value (if (= "^" (get m 1)) 16384 128)
                       value (if (re-find #"[.eE]" (get m 3))
                               (max 0 (min max-value (int (* (Double. (get m 3)) max-value))))
-                              (mod (Integer. (get m 3)) max-value))
+                              (mod (if (= "" (get m 3))
+                                     (if (= "" (get m 2)) 0 1)
+                                     (Integer. (get m 3))) max-value))
                       param ({"&&" :channel-pressure "^" :pitch-bend "&k" :key-pressure "k" :key} (get m 1))
                       old-value (get state param)
                       value (cond

        state))))

(defn play [sequencer notes & [state]]
  (compose sequencer notes state)
  ;; wait for sequencer to finish playing
  (.start sequencer)
  (while (.isRunning sequencer) (Thread/sleep 250)))

(defn -main [& args]
  (println "Try to play sequence")

  ;; initialize the sequencer
  (def sequencer (MidiSystem/getSequencer))
  (.addMetaEventListener sequencer
                        (reify MetaEventListener
                          (meta [meta]
                            (.setTempoInMPQ sequencer (float (.getInt (.put (ByteBuffer/allocate 3) (.getData meta))))))))
  (.setSequence sequencer (Sequence. Sequence/PPQ 256))
  (.createTrack (.getSequence sequencer))
  (.open sequencer)

                      :notes notes
                      :displacement 0
                      :attack 64
                      :release 0
                      :channel-pressure 0
                      :pitch-bend 8192
                      :key-pressure 0
                      :position (.getTickPosition sequencer)
                      :tie nil
                      :key 60
                      :key-type ShortMessage/NOTE_ON
                      :channel 0
                      :track 0
                      :key-signature {}
                      :time-signature [4 4]
                      :transpose 0
                      :octave 4
                      :param :octave
                      :cc-value 0
