-- From https://tidalcycles.org/index.php/Tutorial#Shifting_Time

setcps 1

d1
$ sometimes (hurry 2)
$ sometimes (off 0.5 (+ 0))
$ every 4 (0.25 ~>)
$ whenmod 16 14 (# gain 0)
$ fast 2
$ s "reverbkick"
# pan 0.2
# gain 0.8

d2
$ whenmod 16 13 (# gain 0.7)
$ every' 16 15 (fast 2)
$ every 16 (# gain 0.7)
$ every 16 (hurry 2)
$ fast 2
$ s "hardkick:3"
# gain 0.5
# pan 0.8

d3
$ sometimesBy 0.2 (jux rev)
$ up "1(<2 <6 0>>,8)"
# s "glitch2"
# n 6

d4
$ degradeBy 0.3
$ sometimesBy 0.2 (jux rev)
$ sometimes (off 0 (# up 2))
$ sometimes (off 0 (# up 5))
$ rev
$ chop 8 $ s "moan"
# crush 5
# pan (rand)
# gain 0.6

d5
$ slow 2
$ n "<0 3>/8"
# s "toys"

-- Tuto area

d1 $ every 8 (rev) $ every 4 (density 2) $ sound "bd hh sn cp"

d1 $ whenmod 16 14 (# speed "2") $ sound "bd arpy*2 cp bass2"

d1 $ whenmod 8 6 (const $ sound "arpy(3,8) bd*4") $ sound "bd sn bass2 sn"
d1 $ every 12 (const $ sound "bd*4 sn*2") $ sound "bd sn bass2 sn"

-- Composing Multi-Part Patterns

d1 $ every 4 (slow 2) $ whenmod 5 3 (# speed "0.75 1.5") $ stack [
 sound "bd bd*2",
 sound "hh*2 [sn cp] cp future*4",
 sound (samples "arpy*8" (run 16))
] # speed "[[1 0.8], [1.5 2]*2]/3"
