                                                (second %)
                                                (/ 1.0 8.0)
                                                (~'/ 1.0 frq#)
-                                                ~'decay
-                                                ~'coef)]
-                              (leak-dc (~'* plk#
-                                            (env-gen (asr 0.0001 1 0.1)
-                                                     :gate (second %)))
+                                               ~'decay
+                                               ~'coef)]
+                              (leak-dc (~'* plk# (~env-gen-fn %))
                                        0.995))
                            ~note-gate-pairs)
              src# (~'* ~'pre-amp (mix strings#))

             vrb# (free-verb dis# ~'rvb-mix ~'rvb-room ~'rvb-damp)
             fil# (rlpf vrb# ~'lp-freq ~'lp-rq)]
         (out ~'out-bus (pan2 (~'* ~'amp fil#) ~'pan))))))

;; ======================================================================
;; common routines for stringed instruments

                                                     (repeat num-strings {:default 0}))))
        both-default-ins (into note-default-ins gate-default-ins)
        note-gate-pairs (apply vector (map vector note-ins gate-ins))
        env-gen-fn (if free-on-silence
                     '(fn [x] (env-gen (asr 0.0001 1 0.1) :gate (second x) :action FREE))
                     '(fn [x] (env-gen (asr 0.0001 1 0.1) :gate (second x))))
        ]
    `(defsynth ~name
       ~(str "a stringed instrument synth with " num-strings
