Skip to content

Instantly share code, notes, and snippets.

bps 0.5
do
let dis p = discretise (1) $ p
let pat = "{1@2 1@1 1@3 1@1 1@3 1@4 1@5 1 1 1?}%8"
let mod p = whenmod 13 10 (slow 2) $ shift' 88 $ sometimes ((0.0625/2) ~>) $ shift' 9 $ p
let vary' a min max p = (|+| control (dis $ shift' a $ choose[min..max])) $ p
let vary a p = vary' a (-3) 3 $ p
let altpat = rarely (stut' 1 (0.125*3) (|+| note "7")) $
slow (dis $ choose [0.5,0.6..2]) $
let discretise = _discretise
rip a b p = within (0.25, 0.75) (slow 2 . rev . stut 8 a b) p
rip' a b c d e p = within (a, b) (slow 2 . rev . stut c d e) p
spike p = ((# delaytime (scale 0.001 0.3 $ slow 7.1 sine1)) . (# delayfeedback (scale 0.7 0.99 $ slow 6.71 sine1))) $ p
spike' p = (# delay "0.3") $ spike $ p
ghost'' a f p = superimpose (((a/2 + a*2) ~>) . f) $ superimpose (((a + a/2) ~>) . f) $ p
ghost' a p = ghost'' a ((|*| gain "0.7") . (|=| end "0.2") . (|*| speed "1.25")) p
ghost p = ghost' 0.125 p
jit start amount p = within (start, (start + 0.5)) (trunc (amount)) p
gtfo p = (const $ sound "~") p
@kindohm
kindohm / sew.hs
Created May 26, 2018 13:52
sew.tidal
let sew stitch p1 p2 = overlay (const <$> p1 <*> a) (const <$> p2 <*> b)
where a = filterValues (id) stitch
b = filterValues (not . id) stitch
d1 $ sew (iter 4 "t f t t f f t f")
(sound "bd(5,8,<0 4>)")
(every 2 (# speed 2) $ off 0.125 (# speed 2) $ sound "sd*4")
# crush 4
@kindohm
kindohm / PerformanceON.bat
Last active May 22, 2018 13:38 — forked from williamfields/PerformanceON.bat
Pre-Performance Script
echo "TURN OFF WINDOWS DEFENDER FROM CONTROL PANEL, THEN HIT SPACE."
pause
echo "TURN OFF DOCKER"
pause
REM PAUSE SCHEDULER
net stop schedule
@kindohm
kindohm / hi.tidal
Last active May 10, 2018 17:50
slice.tidal
d1 $ whenmod 10 8 (|*| speed (scale 1 1.25 $ slow 2 saw)) $
every 4 (# pan (scale 0 1 $ slow 3 rand)) $
sometimesBy 0.15 (|+| n "2") $ shift $
slice ("{0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15}%16" + "<0 0 2 0 1>") 16 $
sound "1bar"
# n "<0 0 0 2 0 3>"
# unit "c" # speed 1 # shape 0.9 # orbit 0 # delay 0 # delayfb 0
@kindohm
kindohm / TidalProc.hs
Created February 6, 2018 22:44
TidalProc.hs
module TidalProc where
import Sound.Tidal.Stream
import Sound.Tidal.Pattern
import Sound.Tidal.Parse
import Sound.Tidal.OscStream
port = 5000
procShape = Shape {
@kindohm
kindohm / processing-stuff.pde
Created January 11, 2018 16:27
tidal-processing
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
float x;
float y;
float z;
float opacity;
@kindohm
kindohm / lsys.hs
Created October 30, 2017 17:50
tidal l-systems
-- calum's code
let lsys n r s = p ("{" ++ lindenmayer n r s ++ "}%8")
let inverse 0 = 1
let inverse 1 = 0
let pat = lsys 2 "1:1 1 ~,0:0,~:~ ~ 1 0 ~" "1 1 1 0 ~"
d1 $ gain pat $ s "bd"
import Sound.Tidal.Utils
let fillIn p' p = struct (splitQueries $ Pattern (f p)) p'
f p (s,e) = removeTolerance (s,e) $ invert (s-tolerance, e+tolerance) $ arc p (s-tolerance, e+tolerance)
invert (s,e) es = map arcToEvent $ foldr remove [(s,e)] (map snd' es)
remove (s,e) xs = concatMap (remove' (s, e)) xs
remove' (s,e) (s',e') | s > s' && e < e' = [(s',s),(e,e')] -- inside
| s > s' && s < e' = [(s',s)] -- cut off right
| e > s' && e < e' = [(e,e')] -- cut off left
| s <= s' && e >= e' = [] -- swallow