     (+ (core-time-from-tags tags)
        (:burst-time-offset state))))
 
+;; channels
+
+(defn get-camera-channel-names []
+  (vec (map #(core getCameraChannelName %)
+       (range (core getNumberOfCameraChannels)))))
+
+(defn super-channel-name [simple-channel-name camera-channel-name]
+  (if (>= 1 (core getNumberOfCameraChannels))
+    simple-channel-name
+    (if (or (empty? simple-channel-name)
+            (= "Default" simple-channel-name))
+      camera-channel-name
+      (str simple-channel-name "-" camera-channel-name))))
+    
 ;; image metadata
 
 (defn generate-metadata [event state]

        num-camera-channels (core getNumberOfCameraChannels)
        simple-channels (if-not (empty? channels) channels [{:name "Default" :color java.awt.Color/WHITE}])
        super-channels (all-super-channels simple-channels (get-camera-channel-names))
        ch-names (channel-names simple-channels super-channels)]
     (JSONObject. {
      "BitDepth" (core getImageBitDepth)
      "Channels" (count super-channels)
      "ChNames" ch-names
      "ChColors" (channel-colors simple-channels super-channels ch-names)       
      "ChContrastMax" (JSONArray. (repeat (count super-channels) Integer/MIN_VALUE))
      "ChContrastMin" (JSONArray. (repeat (count super-channels) Integer/MAX_VALUE))
      "Comment" (:comment :settings)

      (set-property default-cam)
      (get {1 1 , 4 3} n))))

      
(defn super-channels [simple-channel camera-channel-names]
  (if (< 1 (count camera-channel-names))
    (map #(update-in simple-channel [:name] super-channel-name %) camera-channel-names)
    simple-channel)) 

(defn all-super-channels [simple-channels camera-channel-names]
  (flatten (map #(super-channels % camera-channel-names) simple-channels)))

(defn channel-colors [simple-channels super-channels channel-names]
  (if (= (count simple-channels) (count super-channels))
    (map #(.getRGB (:color %)) super-channels) 
    (map #(. MMAcquisition getMultiCamDefaultChannelColor % (channel-names %))
         (range (count super-channels)))))    
  
(defn make-summary-metadata [settings]
  (let [depth (core getBytesPerPixel)
