     (>= age 1000) 0.4
     :else 1))
 
-;;;;;;;;;;;;;;;;;;;;;
-;; Control         ;;
-;;;;;;;;;;;;;;;;;;;;;
-
 (defn end-sound! [pid]
   (if (contains? @person-sound pid)
     (do

    3 (add-person-sound! pid "drone-oo-sus")
    "atom full: four people are tracked")))


(defn control-sound
  "Here's a fn which will take a val between 0 and 1, map it linearly to a value between 50 and 1000 and send the mapped value as the new frequency of foo:"
  [pid val]
  (let [verb-val  (scale-range val 0 1000 1 0.3)
        kr-val    (scale-range val 0 1000 25 0)

        synth-unit-lpf (rlpf (* 0.5 synth-unit)
                                       (mouse-x 10 10000)
                                       (mouse-y 0.0001 0.9999))]
    synth-unit-lpf))

(defn synth-filter-chain
  "I shape a sound with high pass filters, resonante low pass filters, amplifiers, and reverb."
  [synth-unit amp verb gate hpf-rlpf]
  (let [attack (synth-defaults ::attack)
        sustain (synth-defaults ::sustain)
        release (synth-defaults ::release)
        [hpf-freq rlpf-freq rlpf-q] hpf-rlpf]

    (-> synth-unit
        (overtone.sc.ugen-collide/* (env-gen (asr attack sustain release) gate))
        (hpf hpf-freq)
        (rlpf rlpf-freq rlpf-q)
        (overtone.sc.ugen-collide/* amp)
        (free-verb verb verb verb))))

(definst drone-aw-sus
  "I make the 'aw' vowel sound at a given frequency.
   I start/stop with the gate set to 1 or 0."
  [freq   300
   gate   (synth-defaults ::gate)
   amp    (synth-defaults ::vca)
   verb   (synth-defaults ::reverb)
   kr-mul (synth-defaults ::vco)]

    (let [kr-mul     (:value kr-mul)
          eq-freq    [570 840 2410]
          hpf-rlpf   [900 600 0.6]
          q          0.1
          synth-unit (synth-unit-layered freq eq-freq q kr-mul)]

        (synth-filter-chain synth-unit amp verb gate hpf-rlpf)))

(definst drone-ae-sus
  "I make the 'ae' vowel sound at a given frequency.
   I start/stop with the gate set to 1 or 0."
  [freq   100
   gate   (synth-defaults ::gate)
   amp    (synth-defaults ::vca)
   verb   (synth-defaults ::reverb)
   kr-mul (synth-defaults ::vco)]

  (let [kr-mul     (:value kr-mul)
        eq-freq    [270 2290 3010]
        hpf-rlpf   [600 8000 0.6]
        q          0.1
        synth-unit (synth-unit-layered freq eq-freq q kr-mul)]

    (synth-filter-chain synth-unit amp verb gate hpf-rlpf)))

(definst drone-eh-sus
  "I make the 'eh' vowel sound at a given frequency.
   I start/stop with the gate set to 1 or 0."
  [freq   80
   gate   (synth-defaults ::gate)
   amp    (synth-defaults ::vca)
   verb   (synth-defaults ::reverb)
   kr-mul (synth-defaults ::vco)]

  (let [kr-mul     (:value kr-mul)
        eq-freq    [530 1840 2480]
        hpf-rlpf   [0 750 0.9]
        q          0.1
        synth-unit (synth-unit-layered freq eq-freq q kr-mul)]

    (synth-filter-chain synth-unit amp verb gate hpf-rlpf)))

(definst drone-oo-sus
  "I make the 'oo' vowel sound at a given frequency.
   I start/stop with the gate set to 1 or 0."
  [freq   120
   gate   (synth-defaults ::gate)
   amp    (synth-defaults ::vca)
   verb   (synth-defaults ::reverb)
   kr-mul (synth-defaults ::vco)]

  (let [kr-mul     (:value kr-mul)
        eq-freq    [300 870 2240]
        hpf-rlpf   [0 600 0.6]
        q          0.1
        synth-unit (synth-unit-layered freq eq-freq q kr-mul)]

    (synth-filter-chain synth-unit amp verb gate hpf-rlpf)))

;;;;;;;;;;;;;;;;;;;;;
;; Control         ;;
;;;;;;;;;;;;;;;;;;;;;

(defn amplitude-mul
  "This is a quick 'n dirty function that lowers the amplitude over time. It was written to compensate the removal of reverb over time and the increase in the perceived loudness of a sound."
