import Sound.Tidal.ParVagues.Control

setcps 0.5

setcps 0

-- Pray the Funk: choeurs laudatifs
-- Tags: Breakbeat, gospel, funk
resetCycles

do
let gG a = (gain ("^77" * a)) -- gain Global
let gM' l h a = (gG (range l h a)) -- gain Modéré
let gM a = (gM' 0.2 0.8 a) -- gain Modéré doux
let gDJF = (midiDJF "^49" 200 9800 0 1000)
let novaOn  ch pat = (someCyclesBy ch pat)
let novaOff ch pat = someCyclesBy (1 - ch) (pat)
let g = (gDJF)
d1 $ g  -- KICK
  -- $ whenmod 8 6 (# silence)
  $ novaOn "^74" (mask "t(11,12)" . fast "<2!6 4 2>") -- Folie
  $ novaOn "^42" (<| "k*<1!8 2!8> . k(<0 1 0 1 3 5 5 8>,8,<0!3 2>)") -- L'annonce
  $ novaOff "^42" (<| "k(<1 [1|2|5]>,8) . k(<3 5>,8)") -- Le classique
  $ "reverbkick"
  # room 0.2
  # pan 0.4
  # gM' 0.2 1.5 "^78"
d4 $ g -- BREAKBEAT
  $ someCyclesBy "^74" -- Intro
  (slice 8 "0 4")
  $ someCyclesBy "^75" -- Laggy
  (slice 8 "0 <1 1(<3 5>,8,<0 4>)> 2 3(<3 5>,8)")
  $ someCyclesBy "^76" -- Fulltime!
  (slice 8 "0 1 2 <3!2 ~ 3> 4 5 6 7*<1 <2 4>>")
  $ loopAt 1 $ slice 8 (run 8)
  $ "break:1"
  # gM' 0 1.8 "^79"
  # speedbus 41 (range 0 2 "^51")
  # cut 4
d2 $ g -- Snares gretscha
  $ someCyclesBy "^44" (
    (whenmod 16 8 (# lpf (slow 8 $ range 15000 1000 saw))
    . hurry 2
    . (|* gain 1.1)
    )
  )
  $ fast 2
  $ n ("6(<4 <3 5>>,8)")
  # "gretsch"
  # pan 0.3
  # gM' 0.2 1.4 "^80"
d3 $ g -- Metal drumroll
  $ someCyclesBy "^60" (fast "1 . 2 4")
  $ "gretsch*<8!3 [16 . [16 | 32]]>" # n "[4|5]"
  # note ("<-2 -4 -2 0>")
  # gM' 0 0.9 "^84"
d5 -- Fragments of Wiley
  $ (# lpf (range 5000 200 "^54"))
  $ g
  $ novaOn "^90" (segment "<2 [2 4] [4 8] [16 32]>")
  $ novaOn  "^58" (slow 16)
  $ novaOff "^58" (slow 4)
  $ "pray"
  # crush (range 10 2.5 "^54")
  # n "<0!4 1!8>"
  # cut 5
  # pan 0.8
  # gM' 0 1.5 "^82"
d6 -- TODO Rework
  $ superimpose (arp "<up!2 down up>" . fast 2 . (|- note 12))
  $ note ("[e3,<~ gs4!2 b4>,e4] [fs3,fs4]")
  # "FMRhodes1"
  # rel (range 0.2 1 "^53")
  # amp (range 0.4 0.8 "^81")
  # gM' 0.8 1.6 "^81"
d7 $ g
  $ midiOn "^91" (ply 2)
  $ midiOn "^59" (fast 2)
  $ s "~ clap"
  # room 0.5 # size 0.4 # dry 0.95
  # note (range "-6" 6 "^55")
  # gM' 0 1.6 "^83"
