   sound energy."
   [energy-variance])
 
-(defn detect-beat
-  "Returns the result of beat detection, which is held by examining
-  the factor between the energy of local peak and that of local average."
+(defn determine-beat
+  "Returns whether the instance is determined as a beat, which is held
+  by examining the factor between the energy of local peak and that of
+  local average."
   [instant-energy average-local-energy threshold-factor])
 
-(defn core
-  "Program starting point"
-  [])
+(defn start-detection
+  [raw history-num instance-num])
+
+(defn tester
+  []
+  (let [data-buffer (first (fill-data-buffer ['() '()] *raw-data* *instance-num*))]
+    (second (initial-energy-buffer data-buffer *instance-num* *sound-history-num*))))

      (recur (map into buffer (nth *raw-data* pos)) (inc pos) n)
      [buffer pos])))

(defn fill-energy-buffer
  "Returns a sound energy histroy buffer." ; TODO
  [data-buffer raw instance-num history-num]
  )

(defn average-local-energy
  "Returns average energy from the given energy-buffer
  (default 43-length)."
  [energy-buffer])

(defn energy-variance
  "Returns the variance of the energies from the given energy-buffer


(def *sound* (dynne/read-sound "sample.wav"))
(def *raw-data* (dynne/chunks *sound* 44100)) 
;(def *chunk-count* (count *raw-data*))
(def *sound-history-num* 44032)
(def *instance-num* 1024)
(def *energy-history-num* 43)

(defn fill-data-buffer
