Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code from a live-coded performance at MusicLab 5: Lockdown Rave by UiOUiO RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion, University of Oslo.
--The 5th edition of MusicLab is an algorave (algorithmic rave) featuring Renick Bell based in Japan, Khoparzi based in India, and researchers in Norway. Renick Bell and Khoparzi will improvise live-coded music on their computers while the audience dances. We will measure audience members' movement using our new MusicLab mobile application that uses smartphones' accelerometers and gyroscopes. We will also ask questions about the experience of the concert.
-- Watch the performance at https://www.youtube.com/watch?v=hJ73IGYawuM&t=865s
-- More information here: https://www.uio.no/ritmo/english/news-and-events/events/musiclab/2020/musiclab-5---lockdown-rave/index.html
-- All the custom functions are described in the end
bpm(160)
load "voxs"
load "smalldirt"
load "maschine"
load "breaks"
p "letsgo"
$ grain16 "5*4" dsqv # s "vox:7"
-- # g (slowsaw)
d1 $ stack [
silence
-- , stb 0.27 (# silence) $ stbdub 0.2 $ footwork3 $ grain16 (run 15) hdsqv # n 7
-- , footwork2 $ grain16 (run 8) hdsqv # n 7 # nudge (cycleChoose [tn' 1.3, tn])-- # note "<7 7 12 7>"
-- , grain16 "5" dsqv # n 7 # g 1
-- , grain16 "[~ 5]*<2 [6 2]>" dsqv # n 7 # g 1
, stbdub' 0.27 0.3 $ grain16 "[[~] 5]*8" hdsqv # n 7 # g 0.7 # note "[12,0,7,19]" # o "[5,6]"
] # s "vox"
d2m' 16
$ ob
$ often (off 0.5 ((# s "varbass:2") . (# l 1) . (# o (cycleChoose [6, 6, 5, 7])) . (# note 0) . (# g 0.9)))
-- Bass sample
$ off 0.125 ((# s "beben:7") . (# l 1) . (# o (cycleChoose [6, 6, 5, 4])) . (# note "<0 3 -2>") . (# g 1.2))
$ linger 0.125
$ fa 1
$ randcat [footwork2 $ g 1]
# s "dudak:2" -- Heavy kickdrum
-- # silence
d3m' 3 $ cat [offed' 1 $ g 1, footwork3 $ g 1]
# s "jstrim" # n 5 -- Rimshot sound
-- # silence
p "cp"
$ whenmod 8 7 (# silence)
$ s "[~ ~ ~ cp]" # hpf (rtris 600 2000 40)
# rvb' 1 0.9 # orbit 10
p "hat"
$ oftflip
$ stb 0.3 (offed' 4)
$ fa 8
$ s "808:1" # g 0
-- Hi hat loop
p "hat-2"
$ stbdub'' 0.5 en 0.7
$ fast 2 $ binstruct "<165 173>"
$ slice 32 (odd 4) $ s "minim:66"
-- # silence
-------------------------------------------------------------------------------
bpm(150)
d1 $ degradeBy 0.1237 $ stack [
silence
-- , stbdub' 0.9 sn $ s "jstrim" >| n (dancehall2 4) # up 12
,
-- oftflip $
-- loud $
stb 0.3 (# squiz 2) $
stb 0.33 (# coarse 8) $
stb 0.13 (|* speed (-2)) $
-- stbdub' 0.4 sn $
(# gain (fa 2 $ dancehall2 $ "1")) $
sl "[2|[2 2 1 2]]" $ scramble 4 $ chop 32 $ breaks # n 101 # speed "[2|4]"
-- # silence
-- , whenmod 16 2 (# note "<0 3 0 -2>") $ stb 0.2 (fa 2 . footwork2) $ slg "bass3"
-- , slg "jungbass:1*<2 [4 1]>" # nudge 0.125 # up "<3 -2>"
-- , fa 2 $ rater $ binstruct "<170 180>" $ s "dudak:5"
-- , fa 2 $ binstruct "<128 128 128 140>" $ s "dudak:8"
-- , stbdub' 0.5 sn $ offed $ s "jstrim:2"
]
d2m' 8
-- $ stbdub 0.3
$ chancervb
-- $ stb 0.7 (off 0.25 (# up 15))
$ stb 0.4 (off 0 (# up 12))
-- $ stb 0.41 (off 0 (dubd . (# up (footwork $ 3))))
-- $ linger 0.125 $ dancehall
-- $ smash 64 [16,8,4]
$ melpad2 # l 0.5
# rvb' 0.3 0.5
# note "[7,12]" # g 0
let odd a = (((r a) + 1) * 2) - 1 -- run of odd numbers
even a = ((r a) + 1) * 2 -- run of even numbers
oddi a = rev (odd a) -- odd inverted
eveni a = rev (even a) -- even inverted
qn = (1/4)
en = (1/8)
qv = (1/8)
sn = (1/16)
sqv = (1/16) -- Semi quaver
tn = (1/32)
dsqv = (1/32) -- Demi Semi quaver
hdsqv = (1/64) -- Hemi Demi Semi quaver
rsin i o = rg' i o sin -- ranged' sine
rcos i o = rg' i o cos -- ranged' cosine
rtri i o = rg' i o tri -- ranged' triangle
rsaw i o = rg' i o saw -- ranged' saw
risaw i o = rg' i o isaw -- ranged' inverted saw
rsq i o = rg' i o sq -- ranged' square
grain' = grp [mF "begin", mF "end"]
grain s w = begin s # end (s + w)
grain8 s w = begin (en' s) # end ((en' s) + w)
grain16 s w = begin (sn' s) # end ((sn' s) + w)
offed = struct "[~ t]*2"
offed' f p = fast f $ struct "[~ t]" $ p
footwork1 = struct "t(3,8,2)"
footwork2 = struct "t(5,8)"
footwork3 = struct "t(<3 5>,8,2)"
footwork4 = struct "t(3,8,<0 7>)"
footwork = struct "[t ~ ~ t ~ ~ t ~]"
footwork' f p = fast f $ struct "[t ~ ~ t ~ ~ t ~]" $ p
altfoot = struct (cat ["[t ~ ~ t ~ ~ t ~]", "[~ t ~ ~ t ~ ~ t]", "[~ ~ t ~ ~ t ~ ~]"])
dancehall = struct "[1 ~ ~ 1] ~"
dancehall' f p = fast f $ struct "[1 ~ ~ 1] ~" $ p
dancehall1 = struct "[1 ~ ~ 1] ~"
dancehall2 = struct "[1 <~ 1> ~ 1] ~"
dancehall3 = struct "[1 <~ 1 ~> <~ 1> 1] ~"
dancehall4 = struct "[t ~ ~ t] [~ <~ ~ ~ t>]"
stb a p = sometimesBy a p
binstruct p = struct (binary p)
binstruct' s a p = struct (binaryN s a) $ p
chancervb p = (# room (scramble 8 "0!7 0.9")) . (# size (wchoose[(1,0.1), (0.5, 0.25), (0, 0.5)])) $ p
ob = trunc (slow 4 $ "<0.25 0.5 0.75 1>")
ob' d = trunc (slow d $ "<0.25 0.5 0.75 1>")
dubd p = sometimes (stut (choose[4, 8]) 0.0125 (1/8)) $ p
dubd' d p = sometimes (stut (choose[4, 8]) d (1/8)) $ p
dubd'' d t p = sometimes (stut (choose[4, 8]) d t) $ p
stbdub d p = sometimesBy d (stut (choose[4, 8]) en en) $ p
stbdub' d t p = sometimesBy d (stut (choose[4, 8]) en t) $ p
stbdub'' d t f p = sometimesBy d (stut (choose[4, 8]) f t) $ p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment