-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathUnity.tidal
85 lines (77 loc) · 2.46 KB
/
Unity.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import Sound.Tidal.OscStream
import Sound.Tidal.Context as C
let unity = Shape {
params = [ S "text" Nothing,
I "wait" (Just 1),
F "size" (Just 0.5),
F "rotate" (Just 1.0),
I "vertical" (Just 0),
I "horizontal" (Just 0),
F "z" (Just 5.0),
S "figure" Nothing
],
cpsStamp = False,
C.latency = 0
}
unitySlang = OscSlang {path = "/",
timestamp = NoStamp,
namedParams = False,
preamble = []
}
unityStream = do
s <- makeConnection "127.0.0.1" 5891 unitySlang
stream (Backend s $ (\_ _ _ -> return ())) unity
text = makeS unity "text"
wait = makeI unity "wait"
size = makeF unity "size"
rotate = makeF unity "rotate"
vertical = makeI unity "vertical"
horizontal = makeI unity "horizontal"
z = makeF unity "z"
figure = makeS unity "figure"
u1 <- unityStream
cps 1
u1 $
every 4 ((#figure "shroom") . (# size "2") . slow 8) $
sometimes (superimpose (# horizontal (sometimesBy 0.25 (fmap(*(-(1)))) "[2 5 10]/3"))) $
sometimes (superimpose (# vertical (sometimesBy 0.25 (fmap(*(-(1)))) "[2 5 10]/3"))) $
text "silly intro lovecoded with tidalcycles and unity3d"
# wait "[1 5 10]/3"
# size (every 2 (fmap(*1.5)) $ every 4 (fmap(+2)) $ sometimes(within(0,0.25)(fmap(*2))) "[0.25 0.1 0.3 0.35]/4")
# horizontal "0" --[-1 -2 1 2]/4"
# vertical "[-5 10 -10 5]/4"
# z "[-10 0 5 10]/3"
# rotate "[5 1]/2"
# figure "[cube shroom shroom cube]/4"
u1 $
sometimesBy 0.25 (# figure "shroom") $
text "silly intro lovecoded with tidalcycles and unity3d"
# wait (iter 2 "0.25 1")
# size "[3 1]/2"
# vertical "[10 -10]/2"
# horizontal "0"
# z "0"
# figure "cube"
u1 $
every 4 (within(0,0.25)((# rotate (scale 1 5 rand)) . (# figure "shroom"))) $
every 3 (superimpose(# rotate (scale 1 2 rand))) $
text "x x x x x"
# wait "[1 5 2]/3"
# z "5"
# rotate "0"
# size "[1 0.5 0.25]/3"
# vertical "[-1 1]/2"
# horizontal (iter 10 $ listToPat [1..10])
# figure "cube"
u1 $
slow 4 $
superimpose (#horizontal "-10") $
text "x"
# wait "1"
# z (scale 1 10 rand)
# rotate (every 3 (fmap(+5)) "0")
# size (every 3 (within(0,0.25)(fmap (+0.25))) "0.25")
# vertical "0"
# horizontal "10"
# figure "cube"
u1 silence