
-- Soleil de Sete - LoFi avec accompagnement

-- TODO:
-- Add lead - or use it to improvise? <3
-- Add wind noises at transition points - or equivalent spacey sounds
do
-- resetCycles
setcps (90/60/4)
let chords = "<[a,c,e,g6,b6,d6] [d,fs,a6,c6] [f,a,c6,e6] [c,e,g6,b6]>"
let chordsMin = "<<a c e> <d!3 fs> [f] [c]>" -- TODO confirm/finish/validate
let gFilter = whenmod 32 24 (# djf (slow 8 (range 0.05 0.5 saw)))
let gFilter2 = whenmod 32 24 (# djf (slow 8 (range 0.45 0.75 saw)))
let g = gFilter
let g2 = gFilter2
d1 $ g
  $ mask "<t!16 f!4 t!12>" -- First break
  $ mask "<t!32 f!8 t!24>" -- Post-filter break
  $ mask "<f!6 t f t!24>"  -- Intro mask
  $ "k*<1!8 2!24> . k*[<<3 1> 3!6 4> <8 3 8 <8 [8 4]>>]"
  # "[bd:2,kick:5]"
  # gain 0.76
  # legato 2
  # att 0.1
  # rel 0.8
d2 $ g -- Aerian snare
  -- $ mask "<t!16 f!3 t t!12>" -- First break
  $ mask "<f!12 t!4 f!5 t!13>" -- Snare mask
  $ n "~ <~!3 [~!3 <10 10?>]>. 9"
  # "sn"
  # gain 0.8
  # pan 0.6
  # lpf 1500
d3 $ g2
  $ mask "<f!16 t!12 f!4 t!16 f!4 t!12>"
  $ "d*[<<4!4 [8 <4 8>]!4> 16!4> <16!3 8 16 16 8 8 16 16 8 16 16 8 16 16>]"
  # "drum:2"
  # pan 0.35
  # dry 1.1 # room 0.5 # sz 0.8
  # gain (slow 8 $ range 0.45 0.65 saw)
d5 $ g -- BREAKBEAT BUDDY
  $ mask "<t!32 f!7 [f t] t!24>" -- Post-filter break
  $ mask "<f!8 t!14 f f t!16>"
  $ whenmod 16 8 (
    sometimesBy "0 0.2 . 0.75!3 0"
    (ply "2 . [2|4]"))
  $ chop 16
  $ loopAt 2
  $ "fbreak100"
  # gain 0.79
  # pan 0.65
d4 $ g2
  $ whenmod 4 3 (rarely (off "h" (arp "up" . mask "f f t? t")))
  $ superimpose ((|* gain "0 0.79") . (|+ note 12)) -- Depth
  $ whenmod 16 12 (someCyclesBy "0 1" rev)
  $ note ("[0,<~ [~!7 0*<1!3 2>] ~ ~>]" + chords
    - 24
  )
  # "FMRhodes1"
  # gain (slow 32 $ range 0.66 0.8 saw)
  # sz 0.9
  # room 0.4
d6 $ g
  $ mask "<f!8 t!8 f!4 t!12>"
  -- $ whenmod 64 48 (# crush (8 - (slow 16 $ range "-1.5" 2.5 perlin)))
  $ note ("[0,<~!8 0(<1 <3 5>>,8)!8>] [0,12]"
    |+ chordsMin
    - 24
  )
  # "bassWarsaw"
  # pan 0.3
  # hpf (range 0 500 perlin)
  # gain (slow 16 $ range 0.54 0.6 sine)
  # room 0.4
d5 $ g -- BREAKBEAT BUDDY
  $ mask "<t!16 f!4 t!12>" -- First break
  $ mask "<t!32 f!12 t!20>" -- Post-filter break
  $ mask "<f!12 t!10 f f t!4 f t f f>"
  $ whenmod 16 8 (
    sometimesBy "0 0.2 . 0.75!3 0"
    (ply "2 . [2|4]"))
  $ chop 16
  $ loopAt 2
  $ "fbreak100"
  # pan 0.85
  # gain 0.7
