-(ns
-    ^{:doc "Functions to help generate and manipulate frequencies and sets of
-           related frequencies. This is the place for functions representing
-           general musical knowledge, like scales, chords, intervals, etc."
+(ns ^{:doc "Functions to help generate and manipulate frequencies and
+    sets of related frequencies. This is the place for functions
+    representing general musical knowledge, like scales, chords,
+    intervals, etc."
       :author "Jeff Rose, Sam Aaron & Marius Kempe"}
   overtone.music.pitch
   (:use [overtone.util old-contrib]

   :messiaen7         [1 1 1 2 1 1 1 1 2 1]}))

(defn resolve-scale
  "Either looks the scale up in the map of SCALEs if it's a keyword or simply
  returns it unnmodified. Allows users to specify a scale either as a seq
  such as [2 2 1 2 2 2 1] or by keyword such as :aeolian"
  [scale]
  (if (keyword? scale)
    (SCALE scale)
    scale))

(defn scale-field [skey & [sname]]
  "Create the note field for a given scale.  Scales are specified with a keyword
  representing the key and an optional scale name (defaulting to :major):
  (scale-field :g)
  (scale-field :g :minor)"
  (let [base (NOTES skey)
        sname (or sname :major)
        intervals (SCALE sname)]

    res))

(defn note
  "Resolves note to MIDI number format. Resolves upper and lower-case
  keywords and strings in MIDI note format. If given an integer or
  nil, returns them unmodified. All other inputs will raise an
  exception.

  Usage examples:

