       (if-assoc (not= (:frame-index e1) (:frame-index e2))
         e2 :wait-time-ms interval-ms))))
         
+(defn event-triggerable [e1 e2]
+  (channels-sequenceable
+    (make-property-sequences
+      [(:properties e1) (:properties e2)])
+      [(:channel e1) (:channel e2)]))
+
 (defn burst-valid [e1 e2]
   (and
     (let [wait-time (:wait-time-ms e2)]
       (or (nil? wait-time) (>= (:exposure e2) wait-time)))
-    (select-values-match? e1 e2 [:exposure :position :slice :channel])
+    (select-values-match? e1 e2 [:exposure :position :slice])
+    (event-triggerable e1 e2)
     (not (:autofocus e2))))
         
+(defn make-triggers [events]
+  (let [props (map #(-> % :channel :properties) events)]
+    (-> props make-property-sequences select-triggerable-sequences)))
+
 (defn make-bursts [events]
   (let [e1 (first events)
         ne (next events)
         [run later] (split-with #(burst-valid e1 %) ne)]
     (when e1
       (if (not (empty? run))
-        (lazy-cat (list (assoc e1 :task :init-burst
-                                  :burst-length (inc (count run))))
-                (map #(assoc % :task :collect-burst) run)
-                (make-bursts later))
+        (lazy-cat
+          (list (assoc e1 :task :init-burst
+                          :burst-length (inc (count run))
+                          :trigger-sequence (make-triggers (cons e1 run))))
+          (map #(assoc % :task :collect-burst) (drop-last run))
+          (list (assoc (last run) :task :finish-burst))
+          (make-bursts later))
         (lazy-cat (list e1) (make-bursts later))))))
       
 (defn add-next-task-tags [events]

               (> 2 num-positions))
           (> 2 (count slices))
           (or (> 2 (count channels))
               (channels-sequenceable property-sequences channels))
           (or (not use-autofocus)
               (>= autofocus-skip (dec numFrames)))
           (zero? (count runnables))

                       :position (nth positions pos-index))
             simple)))))

(defn generate-acq-sequence [settings runnables]
  (let [{:keys [numFrames time-first positions slices channels
                use-autofocus default-exposure interval-ms
