This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dolls.csd
207 lines (174 loc) · 5.31 KB
/
dolls.csd
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
//trans rights
//Copyright © 2022 Amy Universe
//This work is free. You can redistribute it and/or modify it under the
//terms of the Do What The Fuck You Want To Public License, Version 2,
//as published by Sam Hocevar. See the COPYING file for more details.
//thank you, mog
//CW: GUNSHOT SOUNDS AT BEAT 30
<CsoundSynthesizer>
<CsOptions>
-odac -Lstdin -m231 ;-m227
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
#define TEMPO #120#
#define FRQ #($TEMPO/60)#
#define BEAT #(60/$TEMPO)# ;1/$FRQ
gaVerbL,gaVerbR init 0
#include "mycorrhiza.orc"
#include "perfuma.orc"
#include "utils.orc"
#include "mixer.orc"
seed 105
instr Tree
;32 nodes, 0 values and 16 branches each
tree_init(32, 0, 16)
;connections
node_connect_i(0, 1)
node_connect_i(0, 2)
node_connect_i(1, 3)
node_connect_i(1, 4)
node_connect_i(2, 5)
node_connect_i(3, 6)
;node_connect_i(5, 7)
endin
instr Terrain
kTrig1 = MyMetro($FRQ/4)
kTrig2 = MyMetro($FRQ/8)
kTrig3 = MyMetro($FRQ*1)
;different climbs for different melodies
if kTrig1 == 1 then
kAN1 = node_climb3(0)
endif
if kTrig2 == 1 then
kAN2 = node_climb3(0)
endif
if kTrig3 == 1 then
kAN3 = node_climb3(0)
endif
;waves
iRamp ftgenonce 0,0,2^14,7, -1,2^14,1
iTanh ftgenonce 0,0,2^14,"tanh", -5, 5, 0
iSaw ftgenonce 0,0,2^14,7, 0,2^13,1,0,-1,2^13,0
iSqur ftgenonce 0,0,2^14,7, 1,2^13,1,0,-1,2^13,-1
iSin ftgenonce 0,0,2^14,10, 1
iCos ftgenonce 0,0,2^14,11, 1
iWav ftgenonce 0,0,2^18,9, 100,1.000,0, 278,0.500,0, 518,0.250,0,
816,0.125,0, 1166,0.062,0, 1564,0.031,0, 1910,0.016,0
;pitch of every step
kPch1[] = fillarray(7.00, 7.03, 8.01, 8.05, 8.08, 9.01, 6.03, 7.03)
kPch2[] = fillarray(7.03, 7.07, 8.05, 8.08, 9.01, 9.05, 6.07, 7.07)
kPch3[] = fillarray(7.07, 8.00, 8.08, 9.01, 9.05, 9.08, 6.08, 7.10)
;slew them
kCps1 = lineto(cpspch(kPch1[kAN1]), 0.2)
kCps2 = lineto(cpspch(kPch2[kAN2]), 0.2)
kCps3 = lineto(cpspch(kPch3[kAN1]), 0.2)
;superformula parameters of every step
kM1[] = fillarray(+02.00, +41.00, +02.00, +02.00, +02.00, +02.00, +02.00, +02.00)
kM2[] = fillarray(+02.00, +41.00, +02.00, +02.00, +02.00, +02.00, +02.00, +02.00)
kN1[] = fillarray(+00.20, +00.20, +00.20, +00.20, +04.00, +04.00, +00.20, +00.20)
kN2[] = fillarray(+01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00)
kN3[] = fillarray(+01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00)
kA[] = fillarray(+01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00)
kB[] = fillarray(+01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00, +01.00)
;slew limit them
km1,km2,kn1,kn2,kn3,ka,kb =
lineto(kM1[kAN3], 0.03),
lineto(kM2[kAN3], 0.03),
lineto(kN1[kAN3], 0.03),
lineto(kN2[kAN3], 0.03),
lineto(kN3[kAN3], 0.03),
lineto(kA[kAN3] , 0.03),
lineto(kB[kAN3] , 0.03)
kX, kY, kRX, kRY = 0.5, 0.5, 0.05, 0.05
//amp,cps,x,y,rx,ry,rot,tab0,tab1,m1,m2,n1,n2,n3,a,b,period
aSig1 sterrain 0.5, kCps1, kX,kY, kRX,kRY, 0, iSin,iWav, km1,km2,kn1,kn2,kn3,ka,kb,0
aSig2 sterrain 0.5, kCps2, kX,kY, kRX,kRY, 0, iWav,iWav, km1,km2,kn1,kn2,kn3,ka,kb,0
aSig3 sterrain 0.5, kCps3, kX,kY, kRX,kRY, 0, iWav,iWav, km1,km2,kn1,kn2,kn3,ka,kb,0
aSig4 sterrain 0.9, kCps1/4, kX,kY, kRX,kRY, 0, iSin,iWav, km1,km2,kn1,kn2,kn3,ka,kb,0
aSig = (aSig1+aSig2+aSig3)/3
if timeinsts() > 40 then
kAmp rms aSig
kNois rspline 0, 1, 0.01, 2
kTrig trigger kAmp+kNois, .8, 0
schedkwhen(kTrig,0,1, "Kick", 0, 0.2, 230, 20, 0.3, 1, 0.1)
aSig = (aSig1+aSig2+aSig3+aSig4)/4
endif
if timeinsts() > 60 then
kTrig4 = MyMetro($FRQ*4)
kEnv = triglinseg(kTrig4, 1, $BEAT/4, 0)
aSig *= kEnv
endif
aSig dcblock aSig
vincr gaVerbL, aSig*db(-18)
vincr gaVerbR, aSig*db(-18)
sbus_mix 1, aSig
endin
;p4=IFrq, p5=EFrq, p6=amp, p7=distortion, p8=VrbSend
;schedulek("Kick", 0, 0.5, 230, 20, 1, 0, 0)
;hey alley, this will forever be my kick!
instr Kick
iIFrq = p4
iEFrq = p5
aAEnv expseg p6+1,abs(p3),1
aAEnv -= 1
aFEnv expseg iIFrq,abs(p3)/10,iEFrq
aSig oscili aAEnv, aFEnv
iTanh ftgenonce 0,0,1024,"tanh", -5, 5, 0
aSig distort aSig*2, 0.2, iTanh
aSig limit aSig, -0.5,0.5
aSig += moogladder(aSig, iIFrq*2, .3)
aSig = pdhalf(aSig, expseg(-(p7+1), abs(p3), -1)+1)
aSig dcblock aSig
vincr gaVerbL, aSig*(p8)
vincr gaVerbR, aSig*(p8)
sbus_mix 2, aSig
endin
instr Guns
kS init -1
kT = MyMetro($FRQ/2)
kMul[] fillarray 6, 4, 6, 8, 5, 8, 3, 1
kDiv[] fillarray 2, 2, 4, 2, 1, 2, 1, 1
kM[], kD[] Perfuma $FRQ, kMul, kDiv
kS += kT
kS = wrap(kS, 0, 8)
schedkwhen(kM[kS],0,0, "Kick", 0, 0.2, 230, 20, 0.3, 1, 0.1)
endin
instr Verb
gaVerbL dcblock gaVerbL
gaVerbR dcblock gaVerbR
kRoomSize init 0.69 ; room size (range 0 to 1)
kHFDamp init 0.8 ; high freq. damping (range 0 to 1)
if timeinsts() > 40 then
kRoomSize = 0.99
endif
al,ar freeverb gaVerbL,gaVerbR,kRoomSize,kHFDamp, 44100, 1
sbus_mix 0, al, ar
;outs al, ar
clear gaVerbL,gaVerbR
endin
schedule("Verb", 0, -1)
instr Out
aL, aR sbus_out
aL clip aL, 0, db(-6)
aR clip aR, 0, db(-6)
outs aL, aR
sbus_clear_all
endin
schedule("Out", 0, -1)
</CsInstruments>
<CsScore>
t 0 120
i"Tree" 0 0
i"Terrain" 0 [4*60]
i"Guns" 60 16
i"Kick" [4*60] 0.2 230 20 0.3 1 0.1
i"Kick" + 0.5 230 20 0.3 1 0.3
i"Kick" + 0.5 230 20 0.3 1 0.5
s 264
e
</CsScore>
</CsoundSynthesizer>