once "dr*8"

-- region Mad Funk: joyeuse intro techno-funk, partant run 160bpm
-- Tags: Techno, run, funk, crushade
-- Ready: 9.5/10
resetCycles
-- endregion

do
  -- region Nova Utils
  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 = (# djfbus 1 (range 0.05 0.95 "^49"))
  let novaOn  ch pat = someCyclesBy ch pat
  let novaOff ch pat = someCyclesBy  (1 - ch) pat
  -- endregion Nova Utils
  let g = gDJF
  let bpm = 80 -- Que tu crois!
  setcps (bpm/60/4)
  -- d10 $ funk_noise
  d1
    $ g
    -- $ every' 8 7 (# lpf 200)
    -- region Pauses Hip-hop
    $ whenmod 8 6 (juxBy 0.5 rev)
    -- $ "k . k(<3 <5 4>>,8)" -- Le simple
    -- region hardkick
    $ novaOn "^42" (
      superimpose (
        (# "hardkick:4")
        . (sometimesBy "<0!3 0.5>" (stut 2 0.8 "s"))
        . (# legato 0.9)
        -- . (# note (-4))
        . (|* gain 0.65)
        )
    )
    -- region INTRO/Run
    -- $ slow 2 -- intro
    -- $ whenmod 8 6 (# silence)
    $ novaOn  "^41" (<|"k k k k k k k <k [~ k]>")
    $ novaOff "^41" (<|"k . k(<3 5>,8)") -- L'agité
    $ "[cpu,jazz]"
    # midiG' "^78" 0 1.1
    # pan 0.45
  d2 $ g
    $ slow 2
    $ someCyclesBy "^31" (hurry 2)
    $ juxBy 0.75 (rev . sometimes (mask "t(16,16)" . ply 2))
    $ novaOn "^43" (<| "~ s*<1 <2 <4 <8 [8 16]>>>>")
    $ novaOff "^43" (<| "~ s*[4 8]")
    $ "snare:3"
    # gM' 0 1.5 "^79"
    # pan (slow 8 $ range 0.4 0.8 sine)
  d3 $ g -- Drumroll
    -- $ slow 8 -- TODO IN/OUTRO
    -- $ fast (slow 8 "<1 [2 [2|4]] 4 [4 8]>" )
    $ novaOn ("^76")  (slice 8 (run "<8!3 16> 16") . (loopAt 0.5) . (>| "breaks165"))
    $ ply "2 <4 8>" $ "drum:2"
    # gM' 0.3 1.5 "^80"
    # pan (slow 8 $ range 0.2 0.6 cosine)
  d4 $ g  -- Bassline
    $ juxBy 0.5 id
    $ slow 2
    $ sometimesBy "^89" rev -- reverse cowgirl
    $ novaOn  "^58" (slice 8 $ "<0!3 1>*2 3*2 <0 1> 4*<2 4 8>") -- Jumpy rappel
    $ novaOn  "^57" (slice 8 $ "<0!3 <1 2>>*8") -- COME ON CRUSH
    $ novaOff "^57" (slice 8 $ run 8) -- Classique: jumpy groovy
    $ "fbass:8"
    # legato 1
    # crushbus 40 (range 10 3.5 "^53") -- CRUSH THIS
    # gM' 0 1.5 "^81"
    # pan 0.6
  d5 $ g -- Guitare pompe
    -- region Guitare pompe
    $ novaOn "^59" (slice 8 (cat [
      "0*4",
      "0 1 2 3",
      "0*4 1 3(3,8) 5",
      "4 5 6 7",
      "0 7 4 7",
      "[0 4]*4",
      "7 <7 6> <3 5> <7 4>",
      "4*4 . 4*<8 16>",
      "7 0 7 0",
      "0*4"
    ]) . (# n 9))
    -- region INTRO-guitar
    $ novaOff "^59" (slice 8 ( -- Intro
      "0(<1 4>,<1 4 8>) . [1*<1 2 4>, 3(<1 3 5>,8)]"
    ) . (# n 11))
    $ "fguitar"
    # crushbus 50 (range 10 5.5 "^54") -- CRUSH THIS
    # cut 8
    # gM' 0.3 1.5 "^82"
    # pan 0.3
  d6 $ g -- Epiano groovy
    $ sometimesBy "^35" (scramble 8)
    $ sometimesBy "^55" (off "e" ((# cut 61) . (|* gain 0.9)))
    -- $ whenmod 32 16 (whenmod 4 2 (jux rev)) -- TODO variations once introduced
    $ novaOff "^59" (slow 2)
    -- $ mask "f(<1!16 2!16>,2,<1!4 0!4>)" -- TODO INTRO MASK THIS
    -- $ novaOn "^91" (slice 8 "0 3 2 1 0 3 <2 6> 7") -- variant
    -- $ novaOff "^91" (slice 8 "0 3 2 1 4 5 6 7*<1 2>") -- regulier
      -- "3*4 <0 5> 0 <3 4>*2 0*2 5 0 4" -- TODO FREESTYLE
    -- $ slice 8 "3*4 <0 5> 0 <3 4>*2 0*2 5 0 4" -- TODO FREESTYLE
      -- "0 1 2 [3*<4 2>]!4 [5 <4 5>]"
      -- "2*4 3*4 5(3,8)"
      -- "0 3 2 1!5" -- repeat aigu
      -- "5!7 7" -- END OF FILE
      -- "4!5 5 6 7*<1 2>" -- repeat end
    -- )
    $ "fepiano"
    # n (slow 8 "<24 25>")
    # gM' 0.3 1.5 "^83"
    # cut 6
    # pan 0.7
  d7 $ (|- lpf 1000) $ g
    $ whenmod 16 8 (fast 2) $ "clap"
    # gM' 0.3 1.5 "^84"
    # room 0.4
