-- NUIT AGITEEE
-- d f Arc
resetCycles

do
setcps (160/60/4)
let scale = getScale (scaleTable ++ [("gameboy", [1,2,4,5,7,9,11])])
-- once $ note (scale "gameboy" (run 8)) # "superpiano" # gain 2
d1 $ gM1 $ gF1
  -- $ midiOff "^42"  (<| "k . ~ <~!8 k!56> ~ <~!6 <~ k>!54>") -- Attente
  $ midiOff "^41"  (<| "<k ~>") -- TRAP
  $ midiOn "^41" (<| "k k k*[1 <1 <2 4>>] k*<1 2>")
  $ "[jazz,kick:4]"
d2 $ gM2 $ gF1
  $ "~ <~!8 s!56> <s!8 ~!56> <~!8 s!56>"
  # "[sn:20,snare:8]" # rel 0.4 # note "-12"
  # gain 1
d3 $ gM2 $ gF1
  $ midiOff "^43" (mask "[~ [t . <~!3 t> ~!3 ]]*4")
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  $ midiOn  "^76" (ply 2)
  $ n ("~ 0*<1 1 2 1> ~ 0*<1 2 <1 2> 2> ~ <0!32 0*<1!4 2 4!3>!32> ~ <1!16 1*<1 1 2 1 4 1 2 <4 8>>!16>")
  # "amencutup"
  # cut 3
  # panbus 31 "^31"
  |* gain (fast 8 $ range 0.9 1.1 perlin)
d6 $ gF1 $ gM3
  $ someCyclesBy "<f!3 t f f t t>" (superimpose ((|- note 1) . (|* gain 0.9) . (0.125 <~)))
  $ "<~ cp>"
  # drumFrom "rolandtr909" "cp:1"
  # room 0.4 # dry 1.1 # sz 0.5
  # lpf 2000
  # gain 1.1
d4 $ gF2 $ gM3
  $ midiOn "^76" (slow "<4!12 8!4>" . striate "<4!12 8!4>")
  $ midiOn "^44" (slow "<1!12 [1 2]!3 [2 4]>" . mask "<t!6 [<t f> [<t f> f]] [t f]>" . (stut "<4!12 2 2 4 8>" 0.7 "<e!12 e e s s>") . mask "t(2,16)")
  -- $ midiOn "^17" (mask "t(4,16)")
  $ loopAt 8
  $ chop 64
  $ "bass_commodore:7"
  # cut 4
  # crushbus 41 (range 8 0.81 "^32")
  # octersubbus 42 (range 0 7 "^52")
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^29 now belongs to another orbit, so the line(s) below are COMMENTED OUT rather than left firing across columns. Nothing is lost — restore by removing the dashes once gSel folds this onto d4's own control.
  -- # lesliebus 43 (range 0 2 "^29")
  # lsize 2.2
  # lrate (slow 4 $ range 0.2 0.8 sine)
  -- # distortbus 41 (range 0 5 "^53")
  -- # gain (1.1 - 0.1 * "^52" - 0.1 * "^29")
  # room "<0.3!12 0.35 0.4 0.48 0.6>"
d5 $ gF3 $ gM3 -- Mario's 8-bit Harp 
  $ someCyclesBy "^33" ((|- note 12) . (stut 4 0.5 "e"))
  $ midiOn "^89" (superimpose (
    (|- note 12) . (# cut 51) . (# pan 0.2))
    )
  $ whenmod 32 24 (off "e" ((|* gain 0.95) . (|+ pan 0.12) . (|+ note "<12!3 24>")))
  $ note (scale "gameboy" (
    "<1(3,8) [1(3,8), <~ [~!7 2]>] 0(3,8) <0!3 -2>(3,8)>"
    + "<<0 0 2 2> <0 0 2 2> <0 7 7 9> <0 0 9 9>>"
    ))
  # "harpsichord2"
  # distortbus 51 (range 0 0.5 "^53")
  # room 0.4 # dry 0.9 # sz 0.5
  # pan 0.85
  # modIndex 0.3
  # legato 2
  # gain 1.5
d7 $ silence -- FIXME add d7, maybe arps/moog?
d9 $ gF2 $ gM3 -- Essouflement amoureux
  $ arp "up"
  $ note (
    -- "<a a g5 g5> ~ <~!24 d6!7 d5> <a a g g> ~ <~!12 d6!4> <a a g g> <~!16 d6!16>"
    "<a a g5 e5> ~ <~!0 d6!3 d5> <a a g5 cs6> ~ ~ <~ <~ e6> ~ g6> ~"
    -- "c8'maj'4"
    + 4
  + 12
  -- - 2.5 -- "calage"
  )
  # att 0.05
  # rel 2
  # "jungbass:1" # cut 9
  # room 0.3 # dry 1.4 # sz 0.9
  # gain 1.5
d10 $ gM3 $ gF3 -- Angels of constance
  $ note (slow 2 $ ("<[a5, d6] [g5, <e6 <cs6 [cs6 a5]>>]>" - "[12,24]"))
  # "moogBass"
  # room 0.2
  # pan 0.7
d11 $ gF3 $ gM3
  $ note ("<d d e cs d d e cs f f g e f f g a>"
  + "0(<3!3 [3 <5 6>]>,8)"
  + 12
  )
  # "cpluck:3"
  # room 0.8
  # gain 0.85
  # cut 11
d8 $ gM2 $ gF1
  $ midiOn "^92" (ply "1 <2 4 8> 2 <2 [4 8]>")
  $ midiOff "^60" (mask "t(4,8,1)")
  -- $ slice 8 "<~!7 0> 1 <~!6 2 2> 3 <~!4 4!4> 5 <~ 6 ~ ~ 6 ~ 6 6> 7"
  $ midiOn "^36" ((# n "18"))
  $ midiOn "^56" ((# n "6"))
  $ loopAt 2
  $ chop 32
  $ "jungle_breaks:1"
  -- # lpf 5000
  # cut 8
  # gain 0.9
  
  once $  note "d%'maj" # "harpsichord2"
