                    (cond
                     (= n-channels 1) (apply mono-player id pargs)
                     (= n-channels 2) (apply stereo-player id pargs))))]
-    (callable-map (merge {:player player} s)
-                  player)))
+    (with-meta
+      (callable-map s player)
+      {:type ::playable-sample})))
 
 (defmethod buffer-id ::sample [sample] (:id sample))
 

        sample))))

(defn load-sample
  "Synchronously load a wav file into a memory buffer. Returns the buffer.

    ; load a sample a
    (load-sample \"/home/rosejn/studio/samples/kit/boom.wav\")

  Takes optional params :start and :size. Allocates buffer to number of channels
  of file and number of samples requested (:size), or fewer if sound file is

;; Samples are just audio files loaded into a buffer, so buffer
;; functions work on samples too.
(derive ::sample :overtone.sc.buffer/buffer)
(derive ::playable-sample ::sample)

(defn sample
  "Loads a .wav or .aiff file into a memory buffer. Returns a function capable
   of playing that sample.

   ; e.g.
   (sample \"~/music/samples/flibble.wav\")

  "
  [path & args]
