     :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
-   and pos strings will use them to generate positive look ahead and behind
-   matchers. "
+  "Returns the first midi-note formatted substring in s. If passed
+   optional prev and pos strings will use them to generate positive
+   look ahead and behind matchers. "
   ([s] (match-note s "" ""))
   ([s prev-str post-str]
      (let [look-behind (if prev-str (str "(?<=" prev-str ")") "")

  (REVERSE-NOTES (mod note 12)))

(defn- fold-note
  "Folds note intervals into a 2 octave range so that chords using notes
  spread across multiple octaves can be correctly recognised."
  [note]
  (if (or (< 21 note) (contains? #{20 19 16 12} note))
    (fold-note (- note 12))
     note ))

(defn- simplify-chord
  "expects notes to contain 0 (the root note) Reduces all notes into 2 octaves. This will allow
  identification of fancy jazz chords, but will miss some simple chords if they are spread over
  more than 1 octave."
  [notes]
  (set (map (fn [x] (fold-note x)) notes)))

(defn- compress-chord
  "expects notes to contain 0 (the root note) Reduces all notes into 1 octave. This will lose
  all the fancy jazz chords but recognise sparse multiple octave smple chords"
  [notes]
  (set (map (fn [x] (mod x 12)) notes)))


    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 unmodified. All other inputs will raise an
  exception.

  Usage examples:

