 
 ;; --- Time Signature --- ;;
 
-(defn time-signature [note-count & [sig]]
-  "Decompose a measure into randomly spaced out beats,
+(defn generate-meter [beat-count & [sig]]
+  "Decompose a measure into a random meter of beats,
   within the time signature's note count."
   (cond
-    (> note-count 3)
+    (> beat-count 3)
     (let [beat (rand-nth [2 3 4])
           sig (conj (or sig '()) beat)]
-      (time-signature (- note-count beat) sig))
-    (and (<= note-count 3) (> note-count 0))
-    (let [sig (conj (or sig '()) note-count)]
-      (time-signature 0 sig))
+      (generate-meter (- beat-count beat) sig))
+    (and (<= beat-count 3) (> beat-count 0))
+    (let [sig (conj (or sig '()) beat-count)]
+      (generate-meter 0 sig))
     :else sig))
 
 ;; --- Beats --- ;;;
 
-(defn segment-beat [note-count note-value
+(defn segment-beat [beat-count note-value
                     & {:keys [sparseness]
                        :or {sparseness 1}}]
   "Break a beat down into sixteenth-note positions and
   assign notes and rests to each position by iteration."
-  (let [sixteenth-count (* (/ 16 note-value) note-count)
+  (let [sixteenth-count (* (/ 16 note-value) beat-count)
         notes (range 1 (inc sixteenth-count))
         distribution (cons true (repeat sparseness false))]
     (filter

                       :note-value note-value
                       :sparseness sparseness))))

(defn string-measures [measures note-count
                       & {:keys [running-string running-count]
                          :or {running-string '() running-count 0}}]
  "String multiple measures together into a single piece."

    (let [running-string (concat
                           running-string
                           (map #(+ running-count %) (first measures)))
          running-count (+ running-count beat-count)]
      (string-measures (rest measures)
                       beat-count
                       :running-string running-string
                       :running-count running-count))))

