aboutsummaryrefslogtreecommitdiffstats
path: root/tunes/music_formula_collection.txt
blob: f0669e1241352051f5eecb21c25ee5d5c5647ea6 (plain)
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
from: http://pelulamu.net/countercomplex/music_formula_collection.txt

Collection of oneliner music formulas. Version 2011-10-18

I've tried to collect all the formulas in the related threads etc.
(excluding those that clearly sound like random first experiments or total
crap; when several variants are available, i've chosen the shortest one)

If you think I've missed something that should be here, please let me know.

====== 1ST ITERATION ======

// viznut 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>12)|(t>>8))&(63&(t>>4)))

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
(t*(t>>5|t>>8))>>(t>>16)

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>9)|(t>>13))&(25&(t>>6)))

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>11)&(t>>8))&(123&(t>>3)))

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(t>>8*((t>>15)|(t>>8))&(20|(t>>19)*5>>t|(t>>3)))

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
(-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14))

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg "Space Invaders vs Pong"
t*(t>>((t>>9)|(t>>8))&(63&(t>>4)))

====== 2ND ITERATION ======

// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
(t>>6|t|t>>(t>>16))*10+((t>>11)&7)

// pyryp 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
v=(v>>1)+(v>>4)+t*(((t>>16)|(t>>6))&(69&(t>>9)))

// red- 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
(t|(t>>9|t>>7))*t&(t>>11|t>>9)

// miiro 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
t*5&(t>>7)|t*3&(t*4>>10)

// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y (xpansive+varjohukka)
(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)

// skurk+raer 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t))

// xpansive 2011-09-29 http://pouet.net/topic.php?which=8357&page=2 "Lost in Space"
((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)

====== 3RD ITERATION ======

// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
(t*5&t>>7)|(t*3&t>>10)

// bst 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
(int)(t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t

// kb 2011-10-04 http://pouet.net/topic.php?which=8357&page=8 44kHz
((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)

// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o  
(t&t%255)-(t*3&t>>13&t>>6)

// droid 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
t>>4|t&((t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15)))

// ryg 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o 44.1 kHz
((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)

// stephth 2011-10-03 http://news.ycombinator.com/item?id=3063359
(t*9&t>>4|t*5&t>>7|t*3&t/1024)-1

// viznut+oasiz 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Dante's Inferno" short version
((t*(t>>12)&(201*t/100)&(199*t/100))&(t*(t>>14)&(t*301/100)&(t*399/100)))+((t*(t>>16)&(t*202/100)&(t*198/100))-(t*(t>>17)&(t*302/100)&(t*298/100)))

// viznut+oasiz 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Dante's Inferno" long version
((t*(t>>12)&(201*t/100)&(199*t/100))&(t*(t>>14)&(t*301/100)&(t*399/100)))+((t*(t>>16)&(t*202/100)&(t*198/100))-(t*(t>>18)&(t*302/100)&(t*298/100)))

// mu6k 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Long-line Theory", Chaos Theory cover, optimized by ryg, p01 et al., JS-only
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s

// 216 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
t*(t^t+(t>>15|1)^(t-1280^t)>>10)

// mu6k http://www.youtube.com/watch?v=tCRPUv8V22o 32.0 kHz
(3e3/(y=t&16383)&1)*35 +(x=t*"6689"[t>>16&3]/24&127)*y/4e4 +((t>>8^t>>10|t>>14|x)&63)

====== 0XA VIDEOS ======

// harism 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
((t>>1%128)+20)*3*t>>14*t>>18 

// tangent128 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))

// ultrageranium 2011-10-12 http://0xa.kuri.mu/2011/10/09/bitop-videos/
(t*t/256)&(t>>((t/1024)%16))^t%64*(0xC0D3DE4D69>>(t>>9&30)&t%32)*t>>18

====== ALL COLLECTED FORMULAS (length order) ======

// trivial minimum: plain sawtooth
t

// minimal sierpinski harmony
t&t>>8

// "the 42 melody", separately discovered by several people on irc etc
t*(42&t>>10)

// danharaj 2011-10-03 http://www.reddit.com/r/programming/comments/kyj77/algorithmic_symphonies_from_one_line_of_code_how/ "fractal trees", 216's version
t|t%255|t%257

// droid 2011-10-05 http://pouet.net/topic.php?which=8357&page=10
t>>6&1?t>>5:-t>>4

// Niklas_Roy 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
t*(t>>9|t>>13)&16

// krcko 2011-10-04 http://rafforum.rs/index.php/topic,123.0.html
(t&t>>12)*(t>>4|t>>8)

// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
(t*5&t>>7)|(t*3&t>>10)

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
(t*(t>>5|t>>8))>>(t>>16)

// miiro 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
t*5&(t>>7)|t*3&(t*4>>10)

// robert 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
(t>>13|t%24)&(t>>7|t%19)

// Niklas_Roy 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
(t*((t>>9|t>>13)&15))&129

// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o  
(t&t%255)-(t*3&t>>13&t>>6)

// krcko 2011-10-04 http://rafforum.rs/index.php/topic,123.0.html
(t&t>>12)*(t>>4|t>>8)^t>>6

// blueberry 2011-10-05 http://pouet.net/topic.php?which=8357&page=12 11kHz
t*(((t>>9)^((t>>9)-1)^1)%13)

// rrola 2011-10-04 http://pouet.net/topic.php?which=8357&page=9 optimized by ryg
t*(0xCA98>>(t>>9&14)&15)|t>>8

// tonic 2011-10-01 http://pouet.net/topic.php?which=8357&page=5 "mr. arpeggiator playing a solo"
(t/8)>>(t>>9)*t/((t>>14&3)+4)

// FreeFull 2011-10-12 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
(~t/100|(t*3))^(t*3&(t>>5))&t

// red- 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
(t|(t>>9|t>>7))*t&(t>>11|t>>9)

// harism 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
((t>>1%128)+20)*3*t>>14*t>>18 

// droid 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
t&(sin(t&t&3)*t>>5)/(t>>3&t>>6)

// viznut 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>12)|(t>>8))&(63&(t>>4)))

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>9)|(t>>13))&(25&(t>>6)))

// 216 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
t*(t^t+(t>>15|1)^(t-1280^t)>>10)

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(((t>>11)&(t>>8))&(123&(t>>3)))

// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y (xpansive+varjohukka)
(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)

// stephth 2011-10-03 http://news.ycombinator.com/item?id=3063359
(t*9&t>>4|t*5&t>>7|t*3&t/1024)-1

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg "Space Invaders vs Pong"
t*(t>>((t>>9)|(t>>8))&(63&(t>>4)))

// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
(t>>6|t|t>>(t>>16))*10+((t>>11)&7)

// yumeji 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
(t>>1)*(0xbad2dea1>>(t>>13)&3)|t>>5

// ryg 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
(t>>4)*(13&(0x8898a989>>(t>>11&30)))

// marmakoide 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
(t>>(t&7))|(t<<(t&42))|(t>>7)|(t<<5)

// robert 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
(t>>7|t%45)&(t>>8|t%35)&(t>>11|t%20)

// lucasvb 2011-10-03 http://www.reddit.com/r/programming/comments/kyj77/algorithmic_symphonies_from_one_line_of_code_how/
(t>>6|t<<1)+(t>>5|t<<3|t>>3)|t>>2|t<<1

// bear @ celephais
t+(t&t^t>>6)-t*((t>>9)&(t%16?2:6)&t>>9)

// xpansive 2011-09-29 http://pouet.net/topic.php?which=8357&page=2 "Lost in Space"
((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)

// rez 2011-10-05 http://pouet.net/topic.php?which=8357&page=11 js-only optimized by ryg
t*(1+"4451"[t>>13&3]/10)&t>>9+(t*0.003&3)

// marmakoide 2011-10-03 http://pouet.net/topic.php?which=8357&page=7 "Lemmings March"
(t>>5)|(t<<4)|((t&1023)^1981)|((t-67)>>4)

// droid 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
t>>4|t&(t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15))

// rez 2011-10-03 http://pouet.net/topic.php?which=8357&page=7
t*(t/256)-t*(t/255)+t*(t>>5|t>>6|t<<2&t>>1)

// viznut 2011-10-06 #countercomplex "moon scanner generalization", based on jaffa's formula
((t>>5&t)-(t>>5)+(t>>5&t))+(t*((t>>14)&14))

// viznut 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
(t*((3+(1^t>>10&5))*(5+(3&t>>14))))>>(t>>8&3)

// droid 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
t>>4|t&DIV((t>>5),(t>>7-(t>>15)&-t>>7-(t>>15)))

// pyryp 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
v=(v>>1)+(v>>4)+t*(((t>>16)|(t>>6))&(69&(t>>9)))

// bst 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
(int)(t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t

// tangent128 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))

// tejeez 2011-10-05 #countercomplex
(~t>>2)*((127&t*(7&t>>10))<(245&t*(2+(5&t>>14))))

// lokori 2011-10-04 #suomiscene
(t+(t>>2)|(t>>5))+(t>>3)|((t>>13)|(t>>7)|(t>>11))

// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
t*(t>>8*((t>>15)|(t>>8))&(20|(t>>19)*5>>t|(t>>3)))

// Aaron_Krister_Johnson 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
(t>>4)|(t%10)|(((t%101)|(t>>14))&((t>>7)|(t*t%17)))

// jounim 2011-10-04 #suomiscene
((t&((t>>5)))+(t|((t>>7))))&(t>>6)|(t>>5)&(t*(t>>7))

// spikey 2011-10-04 #suomiscene based on jounim's formula
((t&((t>>23)))+(t|(t>>2)))&(t>>3)|(t>>5)&(t*(t>>7))

// akx 2011-10-05 http://twitter.com/#!/akx
(((((t*((t>>9|t>>13)&15))&255/15)*9)%(1<<7))<<2)%6<<4

// bst 2011-10-05 http://pouet.net/topic.php?which=8357&page=10
((t%42)*(t>>4)|(0x15483113)-(t>>4))/(t>>16)^(t|(t>>4))

// skurk 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
t*(t>>((t&4096)?((t*t)/4096):(t/4096)))|(t<<(t/256))|(t>>4)

// skurk+raer 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t))

// yumeji 2011-10-06 http://pouet.net/topic.php?which=8357&page=12 "badbeats & safe"
t*((0xbadbea75>>((t>>12)&30)&3)*0.25*(0x5afe5>>((t>>16)&28)&3))

// bst 2011-10-11 http://pouet.net/topic.php?which=8357&page=18
t>>16|((t>>4)%16)|((t>>4)%192)|(t*t%64)|(t*t%96)|(t>>16)*(t|t>>5)

// bear @ celephais
t>>6^t&37|t+(t^t>>11)-t*((t%24?2:6)&t>>11)^t<<1&(t&598?t>>4:t>>10) 

// kb 2011-10-04 http://pouet.net/topic.php?which=8357&page=8 44kHz
((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)

// bst 2011-10-05 http://pouet.net/topic.php?which=8357&page=12
(t>>5)|(t>>4)|((t%42)*(t>>4)|(0x15483113)-(t>>4))/(t>>16)^(t|(t>>4))

// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
(-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14))

// ultrageranium 2011-10-12 http://0xa.kuri.mu/2011/10/09/bitop-videos/
(t*t/256)&(t>>((t/1024)%16))^t%64*(0xC0D3DE4D69>>(t>>9&30)&t%32)*t>>18

// visy 2011-10-06 http://pouet.net/topic.php?which=8357&page=13
(t%25-(t>>2|t*15|t%227)-t>>3)|((t>>5)&(t<<5)*1663|(t>>3)%1544)/(t%17|t%2048)

// ryg 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o 44.1 kHz
((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)

// mu6k http://www.youtube.com/watch?v=tCRPUv8V22o 32.0 kHz
(3e3/(y=t&16383)&1)*35 +(x=t*"6689"[t>>16&3]/24&127)*y/4e4 +((t>>8^t>>10|t>>14|x)&63)

// Ola 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
((1-(((t+10)>>((t>>9)&((t>>14))))&(t>>4&-2)))*2)*(((t>>10)^((t+((t>>6)&127))>>10))&1)*32+128

// raer 2011-10-07 http://pouet.net/topic.php?which=8357&page=16 stereo 11kHz
L: ((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t)) R: t*(((t>>9)^((t>>9)-1)^1)%13)

// ryg 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
((t>>4)*(13&(0x8898a989>>(t>>11&30)))&255)+((((t>>9|(t>>2)|t>>8)*10+4*((t>>2)&t>>15|t>>8))&255)>>1)

// gasman 2011-10-05 http://pouet.net/topic.php?which=8357&page=12 js-only
(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]

// a1k0n http://news.ycombinator.com/item?id=3063359 js-only
SS=function(s,o,r,p){var c=s.charCodeAt((t>>r)%p);return c==32?0:31&t*Math.pow(2,c/12-o)},SS("0 0     7 7     037:<<",6,10,32) + (t&4096?SS("037",4,8,3)*(4096-(t&4095))>>12 : 0)

// mu6k 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Long-line Theory", Chaos Theory cover, optimized by ryg, p01 et al., JS-only
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s