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

  (let [args (if (empty? args) '(:cubic) args)
        interp (apply interpolate-parametric values args)
        fix-type (cond
                   (every? ratio? values) rationalize
                   (every? integer? values) int
                   :else double)]
    (map #(fix-type (interp %)) (range 0 1 (/ 1.0 num-points)))))

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

(defn get-channel [state]
  (:ch state))

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

