 (comment
 
   (def all-wavs (filter #(.endsWith (.getName %) ".wav") (file-seq (io/file "/Users/josephwilk/Workspace/music/samples"))))
-
   (doseq [w (take 1000 all-wavs)]
-
     (try
       (let [wav (.getPath w) ;; "test/fixtures/test.wav" ;;(.getPath wav)
             _ (println wav)

                                        (= (: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)) )
        ]

    (let [means
          (-> {}

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

          maxs {:spectral-centroid (max-for :spectral-centroid frame-stats)}]
      {:mean means
       :max maxs}
  )))
