     [overtone.live :exclude [scale octave sharp flat sixth]]
     [overtone.inst.sampled-piano :only [sampled-piano]]))
 
-(def note! sampled-piano)
-(def chord! #(map note! %))
+; Basic intervals
+(def semitone 1)
+(def tone (* semitone 2))
+(def octave (* 12 semitone))
 
+; Plumbing
 (defmacro defall
   "Define multiple values at once."
   [names values]

  "Gets the keys from m, excluding any that are present in ks."
  [m ks] (difference (set (keys m)) ks))

; Basic intervals
(def semitone 1)
(def tone (* semitone 2))
(def octave (* 12 semitone))

; Operations on intervals
(def sharp #(+ % semitone))
(def flat #(- % semitone))
(def raise #(+ % octave))
(def lower #(- % octave))

(defn scale 
  "Define a scale as a cumulative sum of intervals."
  ([] '(0))

(def thirteenth #(assoc (eleventh %) :xi (raise (:vi major-scale))))
(def first-inversion #(update-values % (keys-except % [:i]) lower))
(def second-inversion #(update-values % (keys-except % [:i :iii]) lower))

; Let's play!
(def note! sampled-piano)
(def chord! #(map note! %))
