import Controls

-- Controls:
-- 1A 2A 3A 4A 5A 6A 7A 8A UP  DOWN
--^13 14 15 16 17 18 19 20 104 105
-- 1B 2B 3B 4B 5B 6B 7B 8B L   R
--^29 30 31 32 33 34 35 36 106 107
-- 1C 2C 3C 4C 5C 6C 7C 8C
--^49 50 51 52 53 54 55 56
-- 1F 2F 3F 4F 5F 6F 7F 8F
--^77 78 79 80 81 82 83 84
-- 1: Global        - DJF     TODO    TODO
-- 2: Kick          - TODO    TODO    TODO
-- 3: Drumroll      - Jux     Ply2    Pan
-- 4: Break         - sbSlice sbStri  TODO
-- 5: Etincelles    - LPF5&6  LPQ5&6  Crush5&6
-- 6: ArpElectrique - TODO    TODO    TODO
-- 7: Claps         - TODO    TODO    TODO
-- 8: Choirs        - TODO    TODO    TODO

do
setcps (80/60/4)
let gGain = (cF 0.5 "77")
let gFilter = (# djf "^49")
let gRoom = (|* room (range 0 0.5 "^29"))
let gSize = (|* size (range 0 0.8 "^13"))
let gF = (gFilter . gSize . gRoom)
let gG a = (gain (gGain * a)) -- gain Global
let gM a = (gG (range 0.2 0.8 a)) -- gain Modéré
let gM' l h a = (gG (range l h a)) -- gain ModéréManuel
let whenPont1 p = whenmod 16 10 p
let prog = ("<g4'sus>")
d1 $ gF
  $ whenPont1 (mask "t(2,4)")
  $ "k . k(<3 <1!3 5>>,8)"
  # "[reverbkick,jazz]"
  # room 0.3 # dry 0.97
  # gM (1.3 * "^78")
d2 $ gF
  $ whenPont1 (fast "4!3 <4!3 2 4 2>")
  $ sometimesBy ("^51") (jux rev)
  $ sometimesBy ("^31") (ply 2)
  $ fast "[8 <8 16>]"
  $ "[dr,drum:2]"
  # pan ("^16")
  # dry 0.98
  # gM "^79"
d3 $ gF
  $ whenPont1 (mask "t(<4!3 6 4 2>,16)")
  $ someCyclesBy ("^32") (striate 16)
  $ someCyclesBy ("^52") (
    slice 8 "[0 2 0 <6 4>]*2")
  $ "fbreak80"
  # gM' 0.3 1 "^81"
  # lpf (range 0 5000 "^16")
  # cut 3
d4 $ gF
  $ jux (|+ room 0.1)
  $ sometimesBy ("^53") (rev . chop 8)
  $ loopAt 2
  $ "fguitar:8"
  # gM "^81"
  # pan (0.5 + (perlin * "^17"))
  # cut 3
d5
-- $ gF
  -- $ off "q" (|+ room 0.1)
  -- $ sometimesBy ("^53") (rev . chop 8)
  $ loopAt 2
  $ "fbass:11"
  # cut 5
  -- # lpq ("^34")
  -- # lpf (range 10000 0 "^54")
  # gM' 0.25 1.1 "^82"
  # pan (0.5 + (perlin * "^18"))

d6
  $ "[~ s]*<2!4 4!3 [4 8]>"
  # "snare:2"
  # gM "^80"
