                                         (= (:f0 stats) 0.0)
                                        )) frame-stats)
         n-f0s (count f0-frames)
-        f0-totals (reduce (global-stats-reduce fields) {} f0-frames)
-
-
-        max-fn (fn [field] (apply max (map (fn [f] (get (first (vals f)) field ))  frame-stats)) )
-        ]
+        f0-totals (reduce (global-stats-reduce fields) {} f0-frames)]
 
     (let [means
           (-> {}

              (assoc :midi (/ (:midi f0-totals) n-f0s))
              (assoc :f0   (/ (:f0 f0-totals) n-f0s)))

          maxs {:spectral-centroid (max-fn :spectral-centroid)}
          ]
      {:mean means
       :max maxs}
  )))


      (catch Exception e true)
      ))

  (dotimes [i 1]
    (let [block-stats (block-stats "test/fixtures/test.wav")]
;;      (doseq [frame block-stats] (println frame))
