 (def REVERSE-NOTES
   (into {} (map (fn [[k v]] [v k]) NOTES)))
 
+(def MIDI-NOTE-RE-STR "([a-gA-G][#bB]?)([-0-9]+)" )
+(def MIDI-NOTE-RE (re-pattern MIDI-NOTE-RE-STR))
+(def ONLY-MIDI-NOTE-RE (re-pattern (str "\\A" MIDI-NOTE-RE-STR "\\Z")))
+
 
 (defn note
   "Resolves note to MIDI number format. Resolves upper and lower-case keywords

     :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.
