-
Notifications
You must be signed in to change notification settings - Fork 5
/
boot.tidal
33 lines (29 loc) · 1.49 KB
/
boot.tidal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- boot file. primarily sets up the MIDI device and ports, and some custom functions
-- MIDI imports
import Sound.Tidal.Context
import Sound.Tidal.MIDI.Stream
import Sound.Tidal.MIDI.Kindohm.Rack
import Sound.Tidal.MIDI.Kindohm.CustomParams
-- init MIDI devices on OS
devs <- midiDevices
-- connect tidal-midi to specific ports.
-- note that "rackController" comes from kindohm's tidal-midi-rack project
r1 <- midiStream devs "Scarlett 18i8 USB" 1 rackController
m <- midiStream devs "Scarlett 18i8 USB" 15 rackController
erebus <- midiStream devs "Scarlett 18i8 USB" 7 rackController
keys <- midiStream devs "Scarlett 18i8 USB" 16 rackController
-- custom Tidal transform/effect functions
let 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
gtfo p = (const $ sound "~") p
shift p = (1024 <~) p
shift' x p = (x <~) p
choose xs = (xs !!) <$> (irand $ fromIntegral $ length xs)
one p = stut' 1 (0.125/2) (|*| gain "1") $ p
one' p = rarely (stut' 1 (0.125/2) (|*| gain "1")) $ shift' 1024 $ p
one'' p = sometimes (stut' 1 (0.125/2) (|*| gain "1")) $ shift' 1024 $ p
rep n p = stut' (n-1) (0.125*3) (|*| gain "1") $ p
rep' n p = stut' (n-1) (0.125/2*3) (|*| gain "1") $ p
rep'' n p = stut' (n-1) (0.125/4*3) (|*| gain "1") $ p