Last active
October 2, 2024 13:03
-
-
Save khoparzi/1d886914874d5fb68173c4202e2daced to your computer and use it in GitHub Desktop.
Code from a live-coded performance at GitHub Satellite Mar 2020 with @samarthgulati
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- _______ __ __ _______ __ _______ __ __ __ __ __ | |
-- | __|__| |_| | |.--.--.| |--. | __|.---.-.| |_.-----.| | |__| |_.-----. | |
-- | | | | _| || | || _ | |__ || _ || _| -__|| | | | _| -__| | |
-- |_______|__|____|___|___||_____||_____| |_______||___._||____|_____||__|__|__|____|_____| | |
------------------------------------------------------------------------------ | |
-- HARMONIUM | |
d1 | |
-- $ degradeBy 0.2 | |
$ off 0.02 (# up "[2,4,5,14]") | |
-- $ off 0.02 (# up "[2,4,5]/4") | |
-- $ off 0.02 (# up "[3,5]/4") | |
-- $ off 0.01 (# up 5) | |
$ s "iac/4" # up 0 | |
# att 0.25 | |
-- # rel 0.2) | |
# midichan 0 | |
# bpmm 140 | |
------------------------------------------------------------------------------- | |
p "hat" | |
-- $ every 8 (fast "2 [4 3]") | |
$ binstruct 255 -- Fast hats | |
-- $ binstruct 170 -- Eighth quarter | |
$ stack [ | |
silence | |
-- , hat808 # speed (range 0.7 0.9 $ slow 4.3 $ saw) | |
, s "808:1" | |
, s "808:1" # nudge en # up 12 -- For some extra funkiness | |
] | |
# orb 3 | |
xfadeIn "kick" 4 -- Main kick | |
-- $ chup | |
-- $ spread binstruct [144, 146, 144, 150] | |
-- $ every 8 (press) | |
-- $ spreadstruct' 2 [144, 146] | |
-- $ spread binstruct [170] | |
$ s "dudak:3" | |
-- # g 1.1 | |
# hpf 100 | |
-- # lpf 3000 | |
# orb 1 | |
-- Crispy hats | |
d4m | |
-- $ every 3 (fast 2) | |
-- $ press | |
$ s "bthat*4" # n 7 | |
-- d1 | |
xfadeIn 1 8-- $ | |
-- $ press | |
$ slg "btchord" | |
-- # up 1 | |
# up (cat [1, 1, 3, 5]) | |
# lpf 1500-- # g 0.8 | |
-- # comb 0.5 | |
-- # silence | |
xfadeIn 5 4 | |
$ stb 0.3 (# accelerate (randcat [0, 1.23, -2.32])) | |
-- $ stb 0.2 (# crush 4) | |
$ slg "btbass" | |
# lpf (rg 200 1600 $ slow 3.4 $ sine) | |
# up (cat [0, 1, 4, -5]) | |
-- # up "-5" | |
-- # g 0.6 | |
-- # silence | |
d3m' 4 | |
-- $ si (oftflip . fast 2) | |
$ fast 2 | |
$ s "~ cp"-- # bpf 2200 | |
# end 0.51 | |
-- # speed (rg 1.2 2.3 $ slowsine) | |
d4m' 8 -- Never hurts to have a little dubstep in ;) | |
$ spreadstruct' 1 [8] $ s "btdubsnr" # n 9 | |
# hpf 400 # lpf 5200 | |
# end (slow 3.4 $ saw * 0.5 + 0.4) | |
# amp 0.6 | |
d2 -- Some big crunchy kicks | |
-- $ spreadstruct [144, 146] | |
-- $ spreadstruct [4, 8] | |
-- $ si (# s "808bd") | |
$ s "jstkick:7" | |
-- # coarse (cat [4, 2, 8]) | |
# del' (cat [0, "0.7 0"]) "[0.125, 3/4]" 0.6 | |
# silence | |
d4m' 8 | |
-- $ withflip | |
-- $ footwork3 | |
$ fast 2 | |
-- $ spread binstruct [4, 6, 4, 12, 4, "128 2"] | |
-- $ spread binstruct [8, 8, 8, 16] | |
-- $ spread binstruct [4, 4, 4, 5] | |
$ spread binstruct [128, 128, 129, 130] | |
-- $ si (# s "amen:6") | |
$ si (# s "devinesn:3?") | |
$ slg "[jstrim:4]" | |
-- $ slg "[jstrim:2]" # g 1.3 | |
# hpf 800 # lpf 4000 | |
-- # rvb' 0.3 0.5 | |
xfadeIn 1 8 | |
-- $ stb 0.1 (si (# rvb' 0.8 0.1)) | |
$ stb 0.2 (spread scramble [3,5,7]) | |
-- $ ob | |
$ palindrome | |
-- $ stutWith 2 (slow 3.7 $ saw) (|* speed 0.5) | |
$ slice 32 (r 8) | |
$ slg "[pads:23]" # silence | |
# up "[0, 12, 24]" |+ up 0 | |
-- # djf (range 0.3 0.46 $ slow 5.6 $ sine) | |
-- # djf 0.34 | |
-- # room (slow 8.4 $ saw) | |
-- # size 0.8 | |
-- # lpf 4200 | |
# hpf 1000 | |
-- # g in77 | |
xfadeIn 2 8 | |
-- $ chup | |
-- $ spreadstruct' 2 [132, 144] | |
-- $ off 0 ((# n 17) . (# g 0.9)) | |
$ s "btdubkick" | |
# n "[4]" | |
p "dhol" | |
$ stack [ | |
silence | |
-- , fa "<1!6 1 1>" $ n "5 [~ ~ 5 ~] ~ 5" -- For the Bayan | |
-- , n "~ <6*<1!3 2>>" | |
-- , fa "<1 1 1 1 1>" $ n "5 [~ ~ 5 ~] ~ 5*<1 2>" -- Variation for the Bayan | |
-- , press $ dubd $ n "<~ 6>" | |
-- , every 4 (within (0.75, 1) (fast 3)) $ fa 4 $ n "2 <3 3 3 4>" # amp ((shrand 2124) * 0.3) -- For the Dayan | |
-- , every 4 (within (0.75, 1) (fast 3)) $ fa 2 $ n "2 <3 3 3 4>" # amp ((shrand 2124) * 0.3) -- Chilling on the Dayan | |
-- , every 4 (within (0.75, 1) (fast 2)) $ fa 8 $ n "2 <3 3 3 7>" # amp ((shrand 3476) * 0.3) -- Party on the Dayan | |
] # s "dhol" # orb 6 | |
d2m' 64 -- Hard kick to bring in the party | |
-- $ spreadstruct' "1" [144, 146] | |
$ s "btdubkick" # n "[5,17]" | |
d5m -- Simple bass | |
-- $ press | |
-- $ every 3 (within (0.5, 1) (fast 2)) | |
$ slg "jungbass*2" # n 2 | |
# up "2" # att 0.1 # rel 0.1 | |
-- Music line 1 | |
xfadeIn 6 8 | |
-- d6 | |
-- $ every 4 (# dels' 0.4 2 0.73) | |
$ every 2 (scramble 8) | |
$ ply 2 | |
$ s "music-125bpm" # n 5 | |
-- # bpmm 135 | |
# lpf' (rg 800 5000 $ slow 6.3 $ sine) 0.3 | |
# shape 0.3 | |
-- # lpf 800 | |
>| grain (tn' (r 4)) tn | |
-- # g 0.4 | |
# silence | |
-- Music line 2 | |
-- xfadeIn 6 2 | |
-- $ chup | |
d6 | |
$ every 7 (scramble 2) | |
$ every 4 (# dels' 0.29 2 0.73) | |
$ ply 1 | |
$ linger 0.5 | |
$ s "music-125bpm" # n 8 | |
-- # bpmm 135 | |
# lpf' (rg 800 5000 $ slow 6.3 $ sine) 0.3 | |
-- # lpf 1200 | |
-- # shape 0.6 | |
>| grain (tn' (r 16)) tn | |
------------------------------------------------------------------------------- | |
-- Electro tumbi | |
-- xfadeIn 6 2 | |
d6--' 16 | |
-- $ stb 0.24 (within (0.75, 1) (fast 2)) | |
-- $ palindrome | |
-- $ spreadstruct' 2 [144, 148, 152, 140] | |
$ s "tumbi*8" # n 1 | |
-- # grain (tn' (r )) (range tn sn $ slow 4.3 $ saw) | |
# grain (tn' (r 7)) tn | |
-- # up 2 | |
# dels' 0.15 2 0.9 | |
# g 1.2 | |
-- # shape 0.4 | |
-- # hpf 300 # lpf 800 | |
# bpmm 140 | |
-- # silence | |
------------------------------------------------------- | |
-- Some special sauce functions and aliases | |
let bpmm b = cps (b/120/2) | |
binstruct p = struct (binary p) | |
spreadstruct bin = spread binstruct bin | |
spreadstruct' speed bin = fast speed . spread binstruct bin | |
binstruct' s a p = struct (binaryN s a) $ 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 ~]" | |
bo p = trunc (segment 8 $ slowsaw + 0.125) $ p | |
ob = trunc (slow 4 $ "<0.25 0.5 0.75 1>") | |
ob' d = trunc (slow d $ "<0.25 0.5 0.75 1>") | |
chup = silent | |
dels' amount timediv feed = delay amount # delaytime ((1/16)* timediv) # delayfeedback feed | |
dubd p = sometimes (stut (choose[4, 8]) 0.0125 (1/8)) $ p | |
dubd' d p = sometimes (stut (choose[4, 8]) d (1/8)) $ p | |
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 | |
qn' m = (1/4) * m | |
en' m = (1/8) * m | |
qv' m = (1/8) * m | |
sn' m = (1/16) * m | |
sqv' m = (1/16) * m | |
tn' m = (1/32) * m | |
dsqv' m = (1/32) * m | |
hdsqv' m = (1/64) * m | |
r = run | |
-- For muting | |
let d1m a = p 1 $ chup $ a | |
d2m a = p 2 $ chup $ a | |
d3m a = p 3 $ chup $ a | |
d4m a = p 4 $ chup $ a | |
d5m a = p 5 $ chup $ a | |
d6m a = p 6 $ chup $ a | |
d7m a = p 7 $ chup $ a | |
d8m a = p 8 $ chup $ a | |
-- Mute patterns every x cycles | |
d1m' a = p 1 . (|< orbit 0) . (every a (const "~")) | |
d2m' a = p 2 . (|< orbit 1) . (every a (const "~")) | |
d3m' a = p 3 . (|< orbit 2) . (every a (const "~")) | |
d4m' a = p 4 . (|< orbit 3) . (every a (const "~")) | |
d5m' a = p 5 . (|< orbit 4) . (every a (const "~")) | |
d6m' a = p 6 . (|< orbit 5) . (every a (const "~")) | |
d7m' a = p 7 . (|< orbit 6) . (every a (const "~")) | |
d8m' a = p 8 . (|< orbit 7) . (every a (const "~")) | |
d9m' a = p 9 . (|< orbit 8) . (every a (const "~")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment