     '()))
 
 (def melody (atom [(cons "Default" (note-to-midi major))]))
+(def midi-file (atom false))
 
 (defn melody-chooser [e]
   (let [val (value (.getSource e))]

        saver (button :text "Save"
                      :listen [:action save-polychord])
        loader (button :text "Load"
                      :listen [:action load-polychord])
        fields (make-ratio-circle id 2)
        pan (xyz-panel :id :ratios
                       :size polychord-panel-size
                       :items fields)
        vertpan (vertical-panel :id :polychord
                                :items [pan mode-button play-button tonic-bar
                                        sizer-bar saver loader])
        f (frame :title (s/join ["Polychord " (str id)])
                 :id (s/join ["poly-" (str id)])
                 :content vertpan)]

      "Major Scale"   (reset! melody [(cons "Default" (note-to-midi major))])
      "Minor Scale"   (reset! melody [(cons "Default" (note-to-midi minor))])
      "Patterns"      (reset! melody false)
      "Midi File"     (reset! melody (let [loadfile (choose-file :type :open)]
                                       (if loadfile
                                         (let [path (.getPath loadfile)]
                                           (mf/song-from-file path))
                                         @melody)))
      )))

;Playing a Melody
