      :interval    interval
      :midi-note   (octave-note octave interval)}))
 
+
+(defn mk-midi-string
+  "Takes a string or keyword representing a pitch and a number
+  representing an integer and returns a new keyword which is a
+  concatanation of the two. Throws an error if the resulting midi
+  string is invalid.
+
+  (midi-string :F 7)  ;=> :F7
+  (midi-string :Eb 3) ;=> :Eb3"
+  [pitch-key octave]
+  (let [res (str (name pitch-key) octave)]
+    (validate-midi-string! res)
+    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

  (note :db5)    ;=> 73
  (note 60)      ;=> 60
  (note nil)     ;=> nil"

  [n]
  (cond
   (nil? n) nil
   (integer? n) (if (>= n 0)
                    n
                    (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 [match (re-find ONLY-MIDI-NOTE-RE n)
                     _ (when (nil? match)
                         (throw (IllegalArgumentException.
                                 (str "Unable to resolve note: "
                                      n
                                      ". Does not appear to be in MIDI format i.e. C#4"))))
                     note-match (parse-note-match match)
                     _ (when (< (:octave note-match) -1)
                         (throw (IllegalArgumentException.
                                 (str "Unable to resolve note: "
                                      n
                                      ". Octave is out of range. Lowest octave value is -1"))))]
                 (:midi-note note-match))
   :else (throw (IllegalArgumentException. (str "Unable to resolve note: " n ". Wasn't a recognised format (either an integer, keyword, string or nil)")))))

(defn match-note
  "Returns the first midi-note formatted substring in s. If passed optional prev

           look-ahead (if post-str (str "(?=" post-str ")") "")
           match (re-find (re-pattern (str look-behind MIDI-NOTE-RE-STR look-ahead)) s)]
       (when match
         (note-map match)))))



