           octave (quot (- note initial (- (count notemap) 1 )) (count notemap))]
         (* freq (nth notemap pos) (expt (ceil (reduce max notemap)) octave))))
 
+(defn collapse-to-ntave [number ntave]
+    (condp > number
+             1 (recur (* number ntave) ntave)
+             ntave number
+             (recur (/ number ntave) ntave)))
+
+(defn note-set-from-generator [generator initpower finpower ntave]
+    (let [tempset (for [exponent (range initpower finpower)] (expt generator exponent))]
+        (sort (map #(collapse-to-ntave % ntave) tempset))))
+
 
 ;; Public Face - the tuning multimethods.
 

(defmulti tunednotes
    "Multimethod that returns a function taking note keywords to note numbers.

    A note keyword is usually of the form :[notename][pitchmodifiers][ntave], for example, :A4, :cb6 or :Bbb0, however this is entirely dependent on the kind of scale."
    list-flatten-first)

(defmulti reversenotes

    (perfn (list :edo 12 69 440)))

(defmethod tunednotes :midi [_]
    "Returns a function that resolves notes to MIDI number format. Resolves upper and lower-case keywords and strings in MIDI note format. If given a string or keyword in a different format, throws an exception. Anything else is returned unmodified.

     Usage examples:
     (note :F#7)    ;=> 102
