{-
Anny: Juliese
anny.audio

Current version: 1.2.0
Compatibility:
  Tidal Cycles  1.0-dev (cb070d6)
  SuperDirt     1.0-dev (1c526bf)
  SuperCollider 3.8
License: CC-BY-SA https://creativecommons.org/licenses/by-sa/4.0/

See README.md for more information
-}

let bpm b = cps (b/60)
    every' n o f = when ((== (o-1)) . (`mod` n)) f
    msil = mapM_ ($ silence)
    d'drum = d1
    d'perc = d2
    d'bass = d3
    d'eg = d4
    d'gt = d5
    d'udu = d6
    d'pc = d7
    d'pcl = d8
    d'wbass = d9

bpm 99
hush

-- @juldrum
d'drum $ -- overlay ((1 ~>) $ s "cy/8") $ -- (3), (4) remove
  -- overlay ((0.5 ~>) $ s "sn/2") $ -- (2)
  -- every' 8 8 (overlay $ (0.32 ~>) $ s "k*2") $ -- (1)
  -- every' 12 2 (density 3) $ -- (5)
  s "k"

-- @julbass
d'bass $
  -- slowspread (\x -> within (0.5, 1) (x)) [id, slow 2 . brak] $ -- (4)
  -- whenmod 4 2 (density 3) $ -- (3)
  -- whenmod 3 2 (slow 2) $ -- (2)
  sound "[[vb vb:1] ~]/2"
  # end (slow 1.4 "0.2 0.4")
  # vowel "e o"
  -- # speed (slow 2.5 "1 -1") -- (1)

-- juldrum @ 1

-- @julperc
d'perc $
  -- iter 5 $ -- (4)
  -- (# pan (density 16 "0.25 0.75")) $ -- (3)
  -- whenmod 16 15 (density 3) $ -- (1)
  smash 16 [0.25, 0.5] $
  -- every 3 (append $ sound "hh:1 hh") $ -- (2)
  sound "hh hh:2"
  # gain 0.6

-- julbass @ 1
-- julperc @ 1
-- juldrum @ 2

-- julperc @ 2
-- juldrum @ 3

-- julbass @ 2
-- julperc @ 3

-- juldrum @ 4
-- julbass @ 3
-- julperc @ 4

-- @juludu
d'udu $
  -- (every' 5 3 $ brak) $ -- (3)
  -- (every' 3 2 . sometimesBy 0.5 $ density (4/3)) $ -- (1)
  -- (whenmod 7 5 $ trunc (5/6)) $ -- (2)
  slow 4 . chop 128 $
  sound (samples "udu" (slow 4 $ irand 4))
  # gain 0.8
  # cut 6

-- @julwbass
d'wbass $ -- (sometimesBy 0.6 $ superimpose (rev . slow (5/4))) $ -- (5)
  -- every' 4 4 (0.32 ~>) $ -- (2)
  chop 16 $
  sound "[wb wb:1 ~ ~]/4"
  -- sound "[wb [wb:1 wb:2] ~ ~]/4" -- (1)
  -- sound "[wb [wb:1 wb:2] ~ [wb:1 wb:2]]/4" -- (2)
  -- sound "[wb [wb:1 wb:2] ~ [[wb:1 wb:1/2] wb:2]]/4" -- (4)
  # gain 0.9
  -- # speed "[1 1 2]/3" -- (3)

-- julwbass @ 1
-- julwbass @ 2

-- @juleg
d'eg $ -- (0.18 <~) $ -- (4)
  -- every 2 (const silence) $ -- (4), (5) remove
  -- (# speed (scale 0.8 1.3 $ slow 4 saw1)) $ -- (2)
  density 0.25 $ -- (3) 0.245
  -- slowspread density [1, 2, 0.5, 2] $ -- (1)
  gap 128 $ s "eg*2"
  # cut 4
  # gain 0.8

-- juleg @ 1
-- juleg @ 2
-- julwbass @ 3
-- juleg @ 3

msil [d'perc, d'bass]

-- juleg @ 4
-- juludu @ 1
-- juldrum @ 5

-- @julpc
d'pc $
  -- whenmod 7 5 (density 1.25) $ -- (3)
  -- slowspread ($) [rev, id, brak, (0.25 ~>), id] $ -- (2)
  -- slowspread (\x -> within x (slow 1.5)) [(0.25, 0.5), (0.75, 1), (0.25, 0.75)] $ -- (1)
  slow 16 $ gap 48 $ sound "pc:1"
  # gain 0.7
  # cut 7
  # speed "[1 0.7]"

-- julpc @ 1
-- juludu @ 2

-- julpc @ 2

-- julwbass @ 4
-- julpc @ 3

-- @julgt
d'gt $ -- density 0.98 $ -- (2)
  every 2 (within (0, 0.5) (0.07 <~)) $ (0.07 ~>) $
  chop 128 $
  s "[gt [~ gt] ! ~]/2"
  # cut 5
  # gain 0.87
  -- # speed (scale 1 1.25 $ slow 1.95 sinewave1) -- (1)

-- julgt @ 1

-- julwbass @ 5
-- julperc @ 4

-- julbass @ 4
-- juludu @ 3
-- juleg @ 5

-- julgt @ 2

msil [d'eg, d'wbass]

-- @juldrum2
d'drum $ stack [
  every' 8 7 (overlay $ (0.32 ~>) $ s "k") $ s "[k ~ k*2 ~]/4",
  every' 16 16 (overlay $ (0.82 ~>) $ s "sn") $ (1 ~>) $ s "sn/2"
  ]

-- @julpcl
d'pcl $ -- superimpose (slow (10/9) . rev) $ -- (1)
  slow 16 . gap 64 $ s "pclow"
  # gain 0.8
  -- # speed "1 1.5" -- (2)

-- julpcl @ 1
-- julpcl @ 2

msil [d'bass, d'udu, d'pc]

-- julpcl @ 0

hush
