                                                        (:channel state)
                                                        (:key state)
                                                        (:release state))
-                                                      (+ (:position state) (:length state) (:displacement state))))))
+                                                      (+ (:position state)
+                                                         (or (:repeat-length state) (:length state))
+                                                         (:displacement state))))))
                           :else nil)
                         state))]
                 (merge state {:position (if (vector? notes)
                                           (:position state)
-                                          (+ (:position state) (:length state)))}))
+                                          (+ (:position state)
+                                             (or (:repeat-length state) (:length state))))}))
               notes (:notes state)]
           (recur notes state))
         state))))

                      :param :octave
                      :cc-value 0
                      :tempo 120
                      :length (.getResolution (.getSequence sequencer))}
                     (or state {}))]
    (loop [notes notes state state]
      (if (not (empty? notes))

                                                   (- 2.0 (/ 1.0 (reduce * (repeat (count (get % 2)) 2))))
                                                   ppq)
                                               (re-seq #"\G([xwhqistjlmno])(\.*)" (get m 2))))
                          :repeat-length 0
                          :notes (rest notes)}))
          (if-let [m (re-matches #"([-=])[-=]*" (name length))]
            (merge state {:repeat-length (* (:length state) (count (name length)))
                          :key (if (= "=" (get m 1)) (:key state) nil)
                          :notes (rest notes)})
            state))
