   (* freq (java.lang.Math/pow 2 (/ n-cents 1200))))
 
 ;; MIDI
-(def midi-range (range 128))
-(def middle-C 60)
+(def MIDI-RANGE (range 128))
+(def MIDDLE-C 60)
 
 ;; Manipulating pitch using midi note numbers
 

            (list base)
            (take (* 8 12) (cycle intervals)))))))

(defn from-scale [lower upper ] nil)

(defn octaves [scale])

(defn chosen-from [notes]
  (let [num-notes (count notes)]

;;  generator functions would have to choose the scales, chords, notes and rhythm based on
;;  a mix of looking up aspects of the mood, and informed randomness.

;; Use a note (:C scale) or (:Eb scale)

;;  You may be interested to know that each of the seven degrees of the diatonic scale has its own name:
;;
;; 1 (do)  tonic
;; 2 (re)  supertonic
;; 3 (mi)  mediant
;; 4 (fa)  subdominant
;; 5 (sol) dominant
;; 6 (la)  submediant/superdominant
;; 7 (ti)  subtonic"


;; Various scale intervals in terms of steps on a piano, or midi note numbers
;; All sequences should add up to 12 - the number of semitones in an octave

(def SCALE   (let [ionian-sequence [2 2 1 2 2 2 1]
                   ionian-len (count ionian-sequence)
                   rotate-ionian (fn [offset] (drop offset (take (+ ionian-len offset) (cycle ionian-sequence))))]

               {:diatonic          ionian-sequence
                :ionian            (rotate-ionian 0)
                :dorian            (rotate-ionian 1)
                :phrygian          (rotate-ionian 2)
                :lydian            (rotate-ionian 3)
                :mixolydian        (rotate-ionian 4)
                :aeolian           (rotate-ionian 5)
                :lochrian          (rotate-ionian 6)

                ;;comment these out for the time being as
                ;;they can be confused with major and minor
                ;;chords:
                ;;:minor             (rotate-ionian 5)
                ;;:major             (rotate-ionian 0)

                :pentatonic        [2 3 2 2 3]
                :major-pentatonic  [2 2 3 2 3]
                :minor-pentatonic  [3 2 2 3 2]
                :whole-tone        [2 2 2 2 2 2]
                :chromatic         [1 1 1 1 1 1 1 1 1 1 1 1]
                :harmonic-minor    [2 1 2 2 1 3 1]
                :melodic-minor-asc [2 1 2 2 2 2 1]
                :hungarian-minor   [2 1 3 1 1 3 1]
                :octatonic         [2 1 2 1 2 1 2 1]
                :messiaen1         [2 2 2 2 2 2]
                :messiaen2         [1 2 1 2 1 2 1 2]
                :messiaen3         [2 1 1 2 1 1 2 1 1]
                :messiaen4         [1 1 3 1 1 1 3 1]
                :messiaen5         [1 4 1 1 4 1]
                :messiaen6         [2 2 1 1 2 2 1 1]
                :messiaen7         [1 1 1 2 1 1 1 1 2 1]}))

(defn scale-field [skey & [sname]]
  "Create the note field for a given scale.  Scales are specified with a keyword:
  :g :major,
  :d :minor"
