                             (when (and (= (:message-type state) ShortMessage/NOTE_ON) (not (= (:tie state) :begin)))
                               (.add track (MidiEvent. (ShortMessage.
                                                        ShortMessage/NOTE_OFF
-                                                       (:ch state)
+                                                       (get-channel state)
                                                        key
                                                        (:release state))
                                                       (max 

           {:notes (vec-rest notes)})
          state)))))

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


                              (.add track 
                                    (MidiEvent. (ShortMessage.
                                                 (:message-type state)
                                                 (get-channel state)
                                                 key
                                                 value)
                                                (+ (:position state)
