                             (repeat (/ 21050 2) (db->amplitude -11)))))})
 
 (defcard
-  "A look-ahead gate, fed with a stream of 11025 samples of -20dB
+  "A look-ahead gate, fed with a stream of 11025 samples of a -20dB
    sine wave, 1000 samples of a sine wave at -10dB and 21050 samples
    of a sine wave at -11dB. The gate parameters are: threshold -16dB,
    look-ahead 0ms (disabled), hold 0ms (disabled), RMS window 0ms

                   (repeat (/ 21050 2) (db->amplitude -11)))))})

(defcard
  "A look-ahead gate, fed with a stream of 11025 samples of -20dB
   sine wave, 1000 samples of a -10dB sine wave and 21050 samples
   of a -11dB sine wave. The gate parameters are: threshold -16dB,
   look-ahead 100ms, hold 0ms (disabled), RMS window 100ms.

                   (repeat (/ 22050 2) (db->amplitude -20)))))})

(defcard
  "A look-ahead gate, fed with a stream of 11025 samples of a -20dB
   sine wave, 1000 samples of a -10dB sine wave and 21050 samples
   of a -11dB sine wave. The gate parameters are: threshold -16dB,
   look-ahead 0ms (disabled), hold 100ms, RMS window 100ms.

   Compared to the previous examples with the hold time disabled,
   this configuration demonstrates how the gate remains open for
   100ms (4410 samples) after the RMS level of the sine wave has
   dropped below the threshold."
  (fn [state owner]
    (gate-test state))
  {:worker  "gate-7.js"
   :data-fn
   (fn [sample-rate]
     (let [sines (sine-wave 20 sample-rate 33075)]
       (into []
             (concat (amplify (take 11025 sines) -10)
                     (amplify (drop 22025 sines) -20)))))})
