-- Solar - breakbeat nostalgic playground


do
setcps (110/60/4)
let modIndex = pF "modIndex"
let gDJF1 = (# djfbus 1 (range 0.02 0.98 "^49"))
let gDJF2 = (# djfbus 2 (range 0.05 0.95 "^50"))
let g1 = (gDJF1)
let g2 = (gDJF2)
let mBreak = (midiOn "^41" (mask "t f . f <f!4 t!4> <f!2 t!6> t"))
let mDegrade = (midiOn "^73" (chop 4))
let m = mBreak . mDegrade
d1 $ g1 $ m --
  $ mask "<f!4 t!12>"
  $ fix ((# cut 1). (|* gain 0.85)) ("808bd")
  $ midiOn "^41" (<| "k k k <k [<~ k> k]>")
  $ midiOff "^41" (<| "k . ~ <k k ~ ~> k*<1!3 2 2 2 1 2> <~ ~ k <k ~>>")
  $ "[jazz,808bd:1,hh:5]"
  # midiG' "^78" 0 1.7
d3 $ g1 $ m -- Snare
   -- $ mask "<f!3 [f t] t!8 [t f]!4>"
   -- $ fast "<1!4 2!10 4 [4 8]>"
   $ s "~ s ~ s"
   # "sn"
   # speed (range 0 2 "^51")
   # n "[14,20]"
   # note "<0!7 -4>"
   # midiG' "^79" 0 1.4
d2 $ g1 $ m -- BREAK
  -- FIXME(#94) d2 drives more controls than the grid gives it (BT2 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 d2's own control with gSel.
  -- FIXME(#94) d2 drives more controls than the grid gives it (BT2 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 d2's own control with gSel.
  $ midiOn ("^42" - "^76") (ply 2)
  $ midiOn "^76" (striate 4)
  $ loopAt 2
  $ whenmod 8 6 (off "h" id . mask "t . f")
  $ slice 8 (run 8)
  $ "break:11"
  # hpf 500
  # speed (range 0 2 "^30")
  -- FIXME(#54) d2 drives more controls than the grid gives it (B2 only (C1-3 are the family gF filters)). ^32 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 d2's own control.
  -- # octerbus       20 (range 0 0.5 "^32")
  -- # octersubbus    21 (range 0 1.2 "^32")
  -- # octersubsubbus 22 (range 0 1.2 "^32")
  # midiG' "^80" 0 1.9
  # cut 2
d4
  $ whenmod 4 3 (off "q" id)
  $ midiOn "^44" ((
    (|+| note (
    arp "<up!8 converge!7 diverge>"
    "c'maj'8" - "[0,12]")
  )))
  $ rev
  $ struct "~ t"
  $ slow 4
  $ arpeggiate
  $ note "e3'maj"
  # "bassWarsaw"
  # crushbus 51 (range 16 4.6 "^32")
  # midiG' "^81" 0 1.25
  # pan 0.2
d5 $ g2
  $ midiOn "^89" (superimpose (
    (sometimesBy "0!3 0.45" (ply 2)) .
    (|+| note (
    arp "<up!8 converge!7 diverge>"
    "c'maj'8" - "[12 24]*2")
  )))
  $ struct "~ t"
  $ slow 4
  $ arpeggiate
  $ note "e3'maj"
  # "FMRhodes1"
  -- # room "<0.4!3 0.7>"
  # pan 0.8
  # modIndex (range 0 128 "^33")
  # crushbus 51 (range 16 4.6 "^53")
  # midiG' "^82" 0 2
d9 $ g1 $ m
  $ midiOff "^60" (mask "<f!8 t!124>")
  $ midiOn "^92" (<| "[~ c]*[4 <4 8 4 [8 4]>]")
  $ midiOff "^92" (<| "~ c")
  $ "clap"
  # speed (range 0.5 1.5 "^56")
  # midiG' "^84" 0 1.0




-- REGION BACKYARD

d8 $ g2 -- FIXME REMOVE OR SAVE
  $ whenmod 8 4 (rarely (striate 2))
  $ whenmod 16 8 (sometimesBy "0 1" rev)
  $ midiOn "^92" (
    slice 2 (run "<2 1 2 4 1 4 6 16>")
  )
  $ loopAt 2
  $ "forgan:2"
  # midiG' "^83" 0 1
  # crushbus 8 (range 16 1.5 "^36")
  # cut 8
  # pan 0.8

d7 $ g -- Hello PWM!
  $ (|* gain "<1!15 0.8>")
  $ midiOn "^91" (chop "<[8 <4 16>]!15 1>")
  $ midiOn "^59" (superimpose $ segment 16)
  $ note (mel - 12)
  # "superpwm"
  # semitone "<7!3 5>" -- 2nd Oscillator quinte/quarte
  # accelerate "<0!7 <6 12>>"
  # rate "<1!5 2 4 <1 4>>"
  # resonance (slow 32 $ range 0.2 0.6 sine)
  # crushbus 71 (range 10 3 "^35")
  # midiG' "^81" 0 1.42


d7 $ g2 -- Back bows: dissonant now, not the best angels I ever saw
$ superimpose ((# cut 71)
. (# n 3)
. mask "t(<1 1 0 [3 <3 1>]>,8)"
)
$ someCyclesBy "<f!4 t!3 g>" rev
$ struct "t(<1 <3 5>>,8)"
$ arp "up"
$ note "<e'maj'4!3 b'maj'4!4 e'maj'4>"
# "cbow"
# n "0"
# midiG' "^83" 0 0.7
# room 0.3
# pan 0.7
# cut 7
-- Funky Bassline: not convicned?
d4 $ g $ m
$ striate 2
$ loopAt 2
$ slice 8 (run 8)
$ "fbass:3"
# midiG' "^81" 0 1.4
# crushbus 4 (range 16 1.5 "^32")
# cut 4
# pan 0.2


d6 $ g -- Nappes Rhodes
  $ note (
    prog
    + "0 12"
  )
  # "FMRhodes1"
  # pan 0.2
  # modIndex (range 0 100 "^34")
  # crushbus 61 (range 16 5 "^54")
  # midiG' "^82" 0 1.5
d9 $ g
  $ midiOff "^60" (mask "<f!8 t!124>")
  $ midiOn "^92" (<| "[~ c]*[4 <4 8 4 [8 4]>]")
  $ midiOff "^92" (<| "~ c")
  $ "clap"
  # speed (range 0.5 1.5 "^56")
  # midiG' "^84" 0 1.7



d1 $ "jazz*4" # gain 0.6
d3 $ note (scale "aeolian" "2 0*<1 2> 3 <5!3 5(3,8,<0 4>)>"
  + "[0,7]")
  # "bassWarsaw"
  # tremolodepth 12
  # tremolorate 4
  # gain 0.75 # octave 4
