             (list (rand-nth `(1 ~scale-count))))))
 
 (defn intervals->notes [intervals scale]
+  "Convert intervals to notes in a scale."
   (map #(nth scale (dec %)) intervals))
 
 ;; --- Musical piece --- ;;

(defn down-octave [degree] (- 7 degree))

(defn make-move [scale degree]
  (let [movements '(up-step down-step up-leap down-leap up-octave down-octave)
        current-move (weighted-choose movements '(0.38 0.38 0.08 0.08 0.04 0.04))
        temp-degree ((resolve current-move) degree)]

                           :running-interval running-interval))))

(defn generate-intervals [scale note-count]
  "Start from the first note, construct intervals,
  end at the first or last note."
  (let [mid-intervals (construct-intervals scale (- note-count 2))
        scale-count (count scale)]
    (concat '(1)
