resetCycles

do
let len = 64
let outLen = 16
let brk = 32
let whenOut pat = whenmod len (len - outLen) pat
let whenIn  pat = someCyclesBy "<16!8 0!48>" pat
let whenMont pat= someCyclesBy "<0!24 t!8>"  pat
let whenDrop pat= someCyclesBy "<t!8 0!24>"  pat
let whenPt1 pat = someCyclesBy "<1!32 0!32>" pat
let whenPt2 pat = someCyclesBy "<0!32 1!32>" pat
let whenPt2Begin pat = someCyclesBy "<0!32 1!8 0!20>" pat
let whenInFade  = whenIn  (|* gain (slow outLen $ range 0.8 1   saw))
let riff = "<[c ~ c ~ . ds d ~] [<c c ds c> ~ ~ ~]>"
setcps (125/60/4)
d1
  $ whenInFade
  $ mask "<f!7 t!57>" -- Masked intro
  -- $ mask "<t!16 [t f!3] f!7 t(2,4)!8 t!8>"
  $ superimpose (# lpf 200)
  $ "kicklinn*4"
  # release 0.15
  # gain 0.89
d2
  $ whenInFade
  $ mask "<f(1,4)!7 t!57>" -- Masked intro
  $ whenMont (|+ room (slow 8 $ range 0 0.2 saw))
  $ whenDrop (# hpf (slow 8 $ range 4000 0 saw))
  $ superimpose (# note "-4")
  $ "~ c ~ c*<1 1 2 <1 1 2 1>>"
  # lpf 4000
  # "electro1:3"
  # room 0.8 # dry 1 # sz 0.8
  # pan 0.8
  # gain 1.1
d3
  $ whenIn (# silence)
  $ whenMont (|+ room (slow 8 $ range 0 0.2 saw))
  $ whenDrop (# hpf (slow 8 $ range 1000 0 saw))
  $ superimpose ((# n "3") . (# cut 31))
  $ note (scale "melodic" (
    2
    + "0 1 2 3"
    + "<0 3 1 2>"
    |+| "0 -2*<1!4 2!4 4!6 0 0>"
    )
  )
  # "moog"
  # legato 1
  # room 0.5 # sz 0.6
  # gain 0.35
  # cut 3
d4 -- Cymb
  $ whenInFade
  $ whenMont (fast "<[1!3 2] [1 2 1 2] 1 [1 2!3]>")
  $ degradeBy (slow 16 $ "<1 0.8 0.5 0>")
  $ sometimesBy "0.1 0 <1 1 1 0.5> <0 0.1!2 1>" (ply 2)
  $ fast 4 "~ electro1:1"
  # gain 0.75
d5
  $ whenIn (# release (slow 8 $ range 0.1 0.5 saw))
  $ whenmod 16 10 (
    (# crush (slow 6 $
      range 10 1.5 saw))
  )
  $ note riff
  # "supersaw"
  # gain 0.5
  # pitch1 7
  # pan 0.35
  # room 0.1
  # cut 1
d6 -- Bassline + PWM Arps
  $ superimpose (
    whenInFade
    . whenMont (# lpf (slow 8 $ range 2000 200 saw))
    . (|- note 12)
    . struct "t*2 t(<3 5 [3|5] [5 8]>,8)"
    . (# pan 0.2)
    . (# gain 0.65)
  )
  $ note (
    (slow 2 $ "<c3 ds3 [g3 <g3 as3>] c4>") |+| "0*<4 [8 16]>"
  ) # "superpwm"
  # gain "<0!16 0.7!16>"
  # resonance "0.1"
  # pan 0.6
  # room 0.4
  -- # reson
d8
  $ whenDrop (mask "f . f t")
  $ mask "<f!32 t!32>"
  $ slice 8 "[0 1 2 3] 2 <0 3!3> <0 0 3 3>"
  $ "brass:19"
  # cut 21
  # gain 0.65


once $ "kaamelott:3" # begin 0.35 # cut 21 -- izonpacompri
once $ "kaamelott:3" # begin 0.8 # cut 21 -- Code!

once $ "sax" # cut 4

once $ "fbass:37" # cut 1 # gain 1

once $ "electro1:2" # gain 1.5
