                     (throw (IllegalArgumentException.
                             (str "Unable to resolve note: " n ". Value is out of range. Lowest value is 0"))))
    (keyword? n) (note (name n))
-   (string? n) (let [midi-note-re #"\A([a-gA-G][#b]?)([-0-9]+\Z)"
-                        separated (re-find midi-note-re n)
+   (string? n) (let [separated (re-find ONLY-MIDI-NOTE-RE n)
                         _ (when (nil? separated)
                             (throw (IllegalArgumentException.
                                     (str "Unable to resolve note: " n ". Does not appear to be in MIDI format i.e. C#4"))))

     :author "Jeff Rose, Sam Aaron & Marius Kempe"}
  overtone.music.pitch
  (:use [overtone.util old-contrib]
        [overtone.algo chance]))

;; Notes in a typical scale are related by small, prime number ratios. Of all
;; possible 7 note scales, the major scale has the highest number of consonant

                        _ (when (< octave -1)
                            (throw (IllegalArgumentException.
                                    (str "Unable to resolve note: " n ". Octave is out of range. Lowest octave value is -1"))))
                        interval (NOTES (keyword (string/lower-case pitch-class)))

                        _ (when (nil? interval)
                            (throw (IllegalArgumentException.
