-- Tidal crime Investigation
-- Published as https://m.soundcloud.com/parvagues/tidal-crime
-- Image original: [Stormy blue see in sunlight by Ben Mack](https://www.pexels.com/photo/stormy-blue-sea-in-sunlight-5326990/)

resetCycles

once $ "dr" # gain 1.2

do
-- region Nova Utils
let gFactor = 1.4
let gG a = (gain (gFactor * "^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
-- endregion Nova Utils
let sawHarmonic = pF "sawHarmonic"
let mix = pF "mix"
let modIndex = pF "modIndex" -- 0.2
let g = gDJF
let gMix = ((# mix (range 0 20 "^53")) . (|* gain (range 1 0.7 "^53")))
let gMod = ((# modIndex (range 0.2 100 "^33")) . (|* gain (range 1 0.6 "^33")))
let gP = (gMix . gMod)
let keyboard = "FMRhodes1"
setcps (110/60/4)
d1 $ g
  -- $ mask "<<f!4 t f!3> t!12 f!4 t f!3 t!8>"
  $ novaOff "^42" (<|"k . ~ k ~ ~")
  $ novaOn "^42" (<| "k k k <k!3 k*2>")
  $ "[jazz,cpu2,kick:5]"
  -- # gM' 0 1.2 "^78"
d2 $ g
  $ whenmod 16 8 (-- clap
    superimpose ((# "clap") . (# lpf 200) . (# note "-0")
    . (|* gain "<0.85 0.9 1!6>"))
  )
  $ novaOn "^42"  (<| "~ s ~ s*2")
  $ novaOff "^42" (<| "~ s ~ s")
  $ "sn:20"
  # lpf 2000
  -- # gM' 0.2 0.9 "^79"
d3 $ g
  $ novaOn ("^76") --BOUTON NASSIM
  (slice 8 ("<[0 .. 7]!3 [0 1 2 ~ . 0 1 2 ~]>") . (loopAt 1)
  . (>| "breaks125")
  . (|* gain 0.9)
  )
  $ novaOff "^76" (|* gain (slow 16 $ range 0.7 1 saw))
  $ "d d d d d d d*2 d"
  # "[drum:2,amencutup:5]"
  -- # gM' 0 1.25 "^80"
  # pan (slow 16 $ range 0.1 0.9 sine)
  # room 0.2 # dry 0.99
d4 $ g $ gP -- Gauche
  $ mask "<f!4 t!12 f!8 t!8>"
  $ note "<c3!3 as3> . ~ [gs3 g3]"
  # keyboard
  -- # gM' 0 1.5 "^81"
  # pan 0.45
d5 $ g $ gP -- Droite 2/3
  $ whenmod 16 10 (superimpose (const
    $ note (
      "[gs5 g5 gs5 ~] [g5 ~ . <gs5 as5>] . ~"
    )
    # keyboard
    # pan 0.65
    # gM' 0 1.5 "^81"
  ))
  $ mask "<f!6 t!10 t!8 f!4 t!4>"
  $ note (
    "<c3 [as4 gs3 g3 ~] cs3 c3> . ~ <[gs3 g3][gs3 g3 f3]>" + 12
  )
  # keyboard
  # pan 0.55
  -- # gM' 0 0.9 "^81"
d6 $ g -- Horloge
  $ fast 8
  $ note "<0 -2>"
  # "drum:2"
  # hpf 5000
  # hpq 0.3
  # room 0.1 # dry 0.98
  -- # gain ("^80" * 0.45)
d7 $ g
  $ mask "<f!8 t!8>"
  $ note "[gs5 g5 gs5 ~] [g5 ~ . <gs5 as5>] . <~ ~ [<g5 ~> ~ . <gs5 ~>] [~ as5]> ~"
  # "strings"
  # sawHarmonic 1.9
  # pan 0.1
  # mix 0.8
  -- # gM' 0 1.1 "^83"
  # room 0.2
d8 $ g
  $ novaOn "^90" (superimpose (chop 16))
  $ novaOn "^58" (+ note (slow 4 "<0 12>"))
  $ note ("<c3 c3 g3 gs3>")
  # "bassWarsaw"
  # voice (range 0.1 2 "^34")
  # room 0.6 # sz 0.2
  -- # gM' 0.4 1 "^82"
  # crush (range 12 3.6 "^54")



d9 $ note ("gs5(3,8)") # "supergong" # gM' 0 0.8 "^83"

  11   │     //Standard Definitions
  12   │     out = 0, freq = 440, amp = 1, gate = 1, pan = 0, freqLag = 0.2, att = 0.001, dec = 0.1, sus = 0.75, rel = 0.3,
  13   │     //Other Controls (mix ranges from 0 - 1)
  14   │     rq = 0.001, combHarmonic = 4, sawHarmonic = 1.5, mix = 0.33;


once $ "amencutup:3" # gain 0.6
