       (out out-bus (* vol
                       (scaled-v-disk-in 2 buf rate loop?))))))
 
-(defonce loaded-samples* (ref {}))
+(defonce loaded-samples* (atom {}))
+(defonce cached-samples* (atom {}))
 
 (defrecord Sample [id size n-channels rate allocated-on-server path args name])
 
 (defn- load-sample*
-  [path & args]
+  [path arg-map]
   (let [path (canonical-path path)
         f    (file path)]
     (when-not (.exists f)
       (throw (Exception. (str "Unable to load sample - file does not exist: " path))))
-    (let [arg-map  (apply hash-map args)
-          f-name   (or (:name args) (.getName f))
+    (let [f-name   (or (:name arg-map) (.getName f))
           start    (get arg-map :start 0)
           n-frames (get arg-map :size 0)
-          buf      (buffer-alloc-read path start n-frames)]
-      (let [sample (map->Sample
+          buf      (buffer-alloc-read path start n-frames)
+          sample   (map->Sample
                     (assoc buf
                       :path path
-                      :args args
+                      :args arg-map
                       :name f-name))]
-        (dosync (alter loaded-samples* assoc [path args] sample))
-        sample))))
+      (swap! cached-samples* assoc [path arg-map] sample)
+      (swap! loaded-samples* assoc (:id buf) sample)
+      sample)))
 
 (defn load-sample
   "Synchronously load a .wav or .aiff file into a memory buffer. Returns

  (isa? (type s) ::sample))

(defn- free-loaded-sample
  [[[path args] buf]]
  (if (server-connected?)
    (do (buffer-free buf)
        (dosync (alter loaded-samples*
                       dissoc
                       [path args])))))

(defn free-all-loaded-samples
  "Free all buffers associated with a loaded sample and the memory they
  consume. Also remove each sample from @loaded-samples once freed"
  []
  (doseq [loaded-sample @loaded-samples*]
    (free-loaded-sample loaded-sample)))

(defn free-sample

  channels of file and number of samples requested (:size), or fewer if
  sound file is smaller than requested. Reads sound file data from the
  given starting frame in the file (:start). If the number of frames
  argument is less than or equal to zero, the entire file is read.

  If optional param :force is set to true, any previously create cache
  of the sample will be removed and the sample will be forcibly
  reloaded."
  [path & args]
  (ensure-connected!)
  (let [args   (apply hash-map args)
        force? (:force args)
        args   (select-keys args [:start :size])
        path   (canonical-path path)]
    (if-let [sample (and (not force?)
                         (get @cached-samples* [path args]))]
      sample
      (load-sample* path args))))

(defn load-samples
  "Takes a directoy path or glob path (see #'overtone.helpers.file/glob)
