dmscene Demos & source

FUNCTION 07

function07.dmt · 174 BPM · 44 s · 960×600

homagednbmechanical

notes

A study of f07, the Function 2007 invitation by Conspiracy: a mechanical honeycomb tunnel of counter-rotating gear rings, Voronoi cells and hot cores over 174 BPM two-step drum & bass. An homage with original code and music.

filefunction07.dmt
duration0:44
video960×600 · 30 fps · h264 + audio · 22 MB
song174 BPM · speed 6 · rpb 4 · 6 channels
loop0
renderscale 2 · dither on · master 0.68
uniformskickE snareE hatE bassE padE glassE
tagshomagednbmechanical
source399 lines · 16 KB · download

anatomy

10VM programs
8patterns
0palettes
0timeline events
11text / sample / texture
399source lines
6inst
0chan
1master
1frame
1pixel
1post
2fn

line composition

pattern 38%pixel 25%post 14%inst 11%fn 4%text 3%master 2%frame 2%title 0%song 0%order 0%uniform 0%

play order

01234523452345662345234523457777

order list · 32 entries

timeline

This demo has no timeline events; it is driven by the tracker clock and per-frame programs.

resources

kindnameinfovalue
textFEST18FUNCTION
textFEST242007
textCITY8BUDAPEST
textDATE1521-23
textDATE29SEPTEMBER
textMOOD110A FRIENDLY
textMOOD23AND
textMOOD39WELCOMING
textMOOD410ATMOSPHERE
textSEE17SEE YOU
textSEE25THERE

source

download .dmt
1# @description A study of f07, the Function 2007 invitation by Conspiracy: a mechanical honeycomb tunnel of counter-rotating gear rings, Voronoi cells and hot cores over 174 BPM two-step drum & bass. An homage with original code and music.
2# @tags homage, mechanical, dnb
3# function07.dmt - a study of f07 - The Function 2007 Invitation by Conspiracy.
4# A mechanical honeycomb tunnel: counter-rotating gear rings, voronoi cells,
5# hot cores and invitation text, over a 174 BPM two-step drum & bass score.
6# Original code and music; the composition is an homage, not a port.
7title FUNCTION 07
8song bpm=174 speed=6 rpb=4 channels=6 loop=0 volume=0.68 scale=2 dither=1
9order 0 1 2 3 4 5 2 3 4 5 2 3 4 5 6 6 2 3 4 5 2 3 4 5 2 3 4 5 7 7 7 7
11# ---------------------------------------------------------------- instruments
12inst kick {
13 f = 46 + 210 * exp(-t * 38)
14 $p = $p + f / sr
15 body = sin($p * tau) * exp(-t * 7.0)
16 click = hp(noise(), 2500) * exp(-t * 120) * 0.2
17 out(dist((body * 1.5 + click) * 0.85, 1.2))
19inst snare {
20 n = svf(noise(), 1800 + 2500 * exp(-t * 22), 0.35)
21 body = sin((200 - 80 * exp(-t * 25)) * t * tau) * exp(-t * 20)
22 out((r2 * 0.55 + n * 0.7 + body * 0.3) * exp(-t * 10) * 0.55)
24inst hat {
25 n = hp(noise(), 8000 + 2000 * vel)
26 out(n * exp(-t * (40 + 50 * (1 - vel))) * 0.22)
28inst bass {
29 e = env(0.005, 0.15, 0.70, 0.15)
30 s = saw(ph * 1.003) + saw(ph * 0.997)
31 s = svf(s, 180 + 900 * e, 0.35)
32 sub = sin(ph * tau)
33 out((sub * 0.5 + s * 0.35) * e * 0.52)
35# p0: S00 minor 7, S80 major 7, SFF dominant 7.
36inst chord nna=continue {
37 e = env(0.02, 0.45, 0.65, 0.80)
38 third = p0 < 0.33 ? 3 : 4
39 seventh = p0 > 0.33 && p0 < 0.66 ? 11 : 10
40 t3 = pow(2.0, third / 12.0)
41 t5 = pow(2.0, 7.0 / 12.0)
42 t7 = pow(2.0, seventh / 12.0)
43 s = sin(t * freq * tau) * 0.65
44 s = s + sin(t * freq * t3 * tau) * 0.45
45 s = s + sin(t * freq * t5 * tau) * 0.30
46 s = s + sin(t * freq * t7 * tau) * 0.22
47 s = svf(s, 900 + 900 * e + 300 * sin(t * 0.3), 0.22)
48 out(s * e * 0.35)
50inst glass {
51 e = exp(-t * 2.8)
52 m = sin(ph * tau * 2.01) * exp(-t * 3.0) * 1.5
53 out((sin(ph * tau + m) + sin(ph * tau * 2.005) * 0.3) * e * 0.20)
56master {
57 dl = dly(l, 0.32, 0.30)
58 dr = dly(r, 0.47, 0.30)
59 vl = verb(l + dr * 0.18, 0.76, 0.48)
60 vr = verb(r + dl * 0.18, 0.76, 0.48)
61 ml = lp(l + dr * 0.20 + vl * 0.12, 14000)
62 mr = lp(r + dl * 0.20 + vr * 0.12, 14000)
63 out(dist(ml, 1.25), dist(mr, 1.25))
66# ---------------------------------------------------------------- score
67# channels: 0 kick 1 snare 2 hat 3 bass 4 chord 5 glass
68pattern 0 rows=16 {
69 C-2 1 26 | . | . | D-2 4 30 | D-3 5 28 S00 | .
70 . | . | C-6 3 6 | . | . | .
71 . | . | . | . | . | .
72 . | . | C-6 3 5 | . | . | .
73 . | . | . | . | . | .
74 . | . | . | . | . | .
75 . | . | C-6 3 5 | . | . | .
76 . | . | . | . | . | .
77 . | . | . | A#1 4 28 | A#3 5 26 S80 | .
78 . | . | C-6 3 6 | . | . | .
79 . | . | . | . | . | .
80 . | . | C-6 3 5 | . | . | .
81 . | . | . | . | . | .
82 . | . | . | . | . | .
83 . | . | C-6 3 5 | . | . | .
84 . | . | . | . | . | .
86pattern 1 rows=16 {
87 C-2 1 34 | . | . | D-2 4 34 | D-3 5 30 S00 | .
88 . | . | C-6 3 9 | . | . | .
89 . | . | . | . | . | .
90 . | . | C-6 3 7 | . | . | .
91 . | D-4 2 20 | . | . | . | .
92 . | . | C-6 3 8 | . | . | .
93 . | . | . | . | . | .
94 . | . | C-6 3 6 | . | . | .
95 C-2 1 32 | . | . | A#1 4 32 | A#3 5 28 S80 | .
96 . | . | C-6 3 9 | . | . | .
97 . | . | . | . | . | .
98 . | . | C-6 3 7 | . | . | .
99 . | D-4 2 18 | . | . | . | .
100 . | . | C-6 3 8 | . | . | .
101 . | . | . | . | . | .
102 . | . | C-6 3 6 | . | . | .
104pattern 2 rows=16 {
105 C-2 1 40 | . | . | D-2 4 40 | D-3 5 30 S00 | .
106 . | . | C-6 3 13 | . | . | .
107 . | . | . | . | . | C-6 6 16
108 . | . | C-6 3 9 | . | . | .
109 . | D-4 2 34 | . | . | . | .
110 . | . | C-6 3 10 | . | . | .
111 . | . | . | . | . | .
112 . | . | C-6 3 7 | . | . | .
113 C-2 1 38 | . | . | D-2 4 38 | D-3 5 28 S00 | .
114 . | . | C-6 3 12 | . | . | .
115 C-2 1 28 | . | . | . | . | .
116 . | . | C-6 3 9 | . | . | .
117 . | D-4 2 34 | . | . | . | .
118 . | . | C-6 3 10 | . | . | .
119 . | D-4 2 14 | . | . | . | .
120 . | . | C-6 3 7 | . | . | .
122pattern 3 rows=16 {
123 C-2 1 40 | . | . | A#1 4 40 | A#3 5 30 S80 | .
124 . | . | C-6 3 13 | . | . | .
125 . | . | . | . | . | A#5 6 15
126 . | . | C-6 3 9 | . | . | .
127 . | D-4 2 34 | . | . | . | .
128 . | . | C-6 3 10 | . | . | .
129 . | . | . | . | . | .
130 . | . | C-6 3 7 | . | . | .
131 C-2 1 38 | . | . | A#1 4 38 | A#3 5 28 S80 | .
132 . | . | C-6 3 12 | . | . | .
133 C-2 1 28 | . | . | . | . | .
134 . | . | C-6 3 9 | . | . | .
135 . | D-4 2 34 | . | . | . | .
136 . | . | C-6 3 10 | . | . | .
137 . | D-4 2 14 | . | . | . | .
138 . | . | C-6 3 7 | . | . | .
140pattern 4 rows=16 {
141 C-2 1 40 | . | . | F-2 4 40 | F-3 5 30 S80 | .
142 . | . | C-6 3 13 | . | . | .
143 . | . | . | . | . | F-5 6 16
144 . | . | C-6 3 9 | . | . | .
145 . | D-4 2 34 | . | . | . | .
146 . | . | C-6 3 10 | . | . | .
147 . | . | . | . | . | .
148 . | . | C-6 3 7 | . | . | .
149 C-2 1 38 | . | . | F-2 4 38 | F-3 5 28 S80 | .
150 . | . | C-6 3 12 | . | . | .
151 C-2 1 28 | . | . | . | . | .
152 . | . | C-6 3 9 | . | . | .
153 . | D-4 2 34 | . | . | . | .
154 . | . | C-6 3 10 | . | . | .
155 . | D-4 2 14 | . | . | . | .
156 . | . | C-6 3 7 | . | . | .
158pattern 5 rows=16 {
159 C-2 1 40 | . | . | C-2 4 40 | C-4 5 30 S80 | .
160 . | . | C-6 3 13 | . | . | .
161 . | . | . | . | . | C-6 6 16
162 . | . | C-6 3 9 | . | . | .
163 . | D-4 2 34 | . | . | . | .
164 . | . | C-6 3 10 | . | . | .
165 . | . | . | . | . | .
166 . | . | C-6 3 7 | . | . | .
167 C-2 1 38 | . | . | C-2 4 38 | C-4 5 28 S80 | .
168 . | . | C-6 3 12 | . | . | .
169 C-2 1 28 | . | . | . | . | .
170 . | . | C-6 3 9 | . | . | .
171 . | D-4 2 34 | . | . | . | .
172 . | . | C-6 3 10 | . | . | .
173 . | D-4 2 14 | . | . | . | .
174 . | . | C-6 3 7 | . | . | .
176pattern 6 rows=16 {
177 . | . | . | G-2 4 36 | G-3 5 28 S00 | .
178 . | . | C-6 3 7 | . | . | .
179 . | . | . | . | . | D-5 6 16
180 . | . | . | . | . | .
181 . | . | C-6 3 6 | . | . | .
182 . | . | . | . | . | .
183 . | . | . | . | . | A-5 6 14
184 . | . | C-6 3 6 | . | . | .
185 . | . | . | A-1 4 36 | A-3 5 26 SFF | .
186 . | . | C-6 3 7 | . | . | .
187 . | . | . | . | . | C-6 6 16
188 . | . | . | . | . | .
189 . | . | C-6 3 6 | . | . | .
190 . | . | . | . | . | .
191 . | . | . | . | . | F-5 6 14
192 . | . | C-6 3 6 | . | . | .
194pattern 7 rows=16 {
195 C-2 1 30 | . | . | D-2 4 34 | D-3 5 28 S00 | .
196 . | . | C-6 3 9 | . | . | .
197 . | . | . | . | . | .
198 . | . | C-6 3 7 | . | . | .
199 . | D-4 2 26 | . | . | . | .
200 . | . | C-6 3 8 | . | . | .
201 . | . | . | . | . | D-5 6 14
202 . | . | C-6 3 6 | . | . | .
203 C-2 1 28 | . | . | D-2 4 32 | D-3 5 26 S00 | .
204 . | . | C-6 3 9 | . | . | .
205 . | . | . | . | . | .
206 . | . | C-6 3 7 | . | . | .
207 . | D-4 2 24 | . | . | . | .
208 . | . | C-6 3 8 | . | . | .
209 . | . | . | . | . | .
210 . | . | C-6 3 6 | . | . | .
213# ---------------------------------------------------------------- visuals
214text FEST1 "FUNCTION"
215text FEST2 "2007"
216text CITY "BUDAPEST"
217text DATE1 "21-23"
218text DATE2 "SEPTEMBER"
219text MOOD1 "A FRIENDLY"
220text MOOD2 "AND"
221text MOOD3 "WELCOMING"
222text MOOD4 "ATMOSPHERE"
223text SEE1 "SEE YOU"
224text SEE2 "THERE"
225uniform kickE snareE hatE bassE padE glassE
227fn textline(s, px, py, sz) {
228 cx = (u - px) / sz
229 cy = (py - v) / sz
230 i = floor(cx)
231 return glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, strlen(s)) * step(0, cy) * step(cy, 1)
234fn centerline(s, py, sz) {
235 n = strlen(s)
236 tw = n * 6.0 * sz
237 cx = (u + tw * 0.5) / sz
238 cy = (py - v) / sz
239 i = floor(cx)
240 return glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, n) * step(0, cy) * step(cy, 1)
243frame {
244 kickE = exp(-trig(0) * 8)
245 snareE = exp(-trig(1) * 10)
246 hatE = exp(-trig(2) * 20)
247 bassE = cenv(3)
248 padE = cenv(4)
249 glassE = cenv(5)
252pixel {
253 # off-centre vanishing point: the tunnel drifts instead of being a sunburst
254 cx = 0.22 * sin(t * 0.09)
255 cy = 0.16 * cos(t * 0.11)
256 ang = 0.18 * sin(t * 0.13)
257 rx = rot(u - cx, v - cy, ang)
258 ry = r1
259 r0 = len(rx, ry) + 0.02
260 a = atan2(ry, rx)
261 sa = sin(a)
262 z = 1.0 / r0 + t * 1.0
264 # voronoi cell wall in (cos, sin, z) space, seam-free
265 vd = vor(cos(a) * 4.0 + 2.0 + z * 0.12, sa * 4.0 - 1.0 - z * 0.10)
266 vid = r1
267 cell = 1.0 - smooth(0.15, 0.55, vd)
268 cedge = exp(-abs(vd - 0.42) * 22.0)
270 # depth bands sweeping toward the camera
271 band = fract(z * 0.35)
272 dring = exp(-abs(band - 0.5) * 16.0)
274 # big foreground gear, off-centre
275 g1x = -0.62 + 0.06 * sin(t * 0.10)
276 g1y = 0.24 + 0.05 * cos(t * 0.12)
277 g1d = len(rx - g1x, ry - g1y)
278 g1a = atan2(ry - g1y, rx - g1x)
279 g1r = 0.24
280 t1 = smooth(0.35, 0.65, sin(g1a * 22 + t * 0.9))
281 g1b = smooth(g1r - 0.035, g1r, g1d) * (1 - smooth(g1r + 0.015, g1r + 0.035, g1d))
282 g1t = smooth(g1r + 0.010, g1r + 0.025, g1d) * (1 - smooth(g1r + 0.050, g1r + 0.070, g1d)) * t1
283 g1h = 1 - smooth(0.055, 0.085, g1d)
284 gear1 = max(max(g1b, g1t), g1h)
286 # second gear, counter-rotating
287 g2x = 0.58 + 0.05 * cos(t * 0.08)
288 g2y = -0.30 + 0.05 * sin(t * 0.11)
289 g2d = len(rx - g2x, ry - g2y)
290 g2a = atan2(ry - g2y, rx - g2x)
291 g2r = 0.18
292 t2 = smooth(0.35, 0.65, sin(g2a * 16 - t * 1.1))
293 g2b = smooth(g2r - 0.030, g2r, g2d) * (1 - smooth(g2r + 0.015, g2r + 0.030, g2d))
294 g2t = smooth(g2r + 0.008, g2r + 0.020, g2d) * (1 - smooth(g2r + 0.040, g2r + 0.055, g2d)) * t2
295 gear2 = max(g2b, g2t)
297 # toothed ring flying down the depth
298 t3 = smooth(0.40, 0.60, sin(a * 18 + t * 0.7))
299 mring = dring * (0.25 + 0.75 * t3)
301 # hot core and light rays
302 core = exp(-r0 * 11.0)
303 rays = pow(0.5 + 0.5 * sin(a * 16 + z * 2.5 - t * 0.6), 14)
305 # colour: green/yellow/orange/cyan zones
306 hue = fract(0.16 + 0.08 * sin(z * 0.22 + t * 0.17) + 0.10 * sa + 0.05 * t)
307 hsv(hue, 0.85, 0.16)
308 cmul(0.45 + 0.85 * cell + 0.55 * cedge + 0.30 * dring)
309 cadd(gear1 * 0.95, gear1 * 0.50, gear1 * 0.15)
310 cadd(gear2 * 0.20, gear2 * 0.75, gear2 * 0.95)
311 cadd(mring * 0.35, mring * 0.45, mring * 0.20)
312 cadd(core * 0.60, core * 0.45, core * 0.25)
313 cadd(rays * 0.12, rays * 0.16, rays * 0.20)
314 cadd(kickE * 0.15, kickE * 0.06, kickE * 0.18)
316 # invitation text gates
317 gA = smooth(2.0, 2.8, t) * (1.0 - smooth(6.4, 7.2, t))
318 gB = smooth(8.0, 8.8, t) * (1.0 - smooth(13.4, 14.2, t))
319 gC = smooth(16.0, 16.8, t) * (1.0 - smooth(20.4, 21.2, t))
320 gD = smooth(24.0, 24.8, t) * (1.0 - smooth(28.4, 29.2, t))
321 gE = smooth(38.0, 38.8, t) * (1.0 - smooth(43.4, 44.2, t))
322 tb = smooth(0.22, 0.14, abs(v + 0.12)) * max(max(gA, gB), max(max(gC, gD), gE))
323 cmul(1.0 - 0.55 * tb)
325 tA1 = centerline(FEST1, -0.10, 0.060) * gA
326 tA2 = centerline(FEST2, -0.18, 0.060) * gA
327 tB1 = centerline(MOOD1, -0.02, 0.050) * gB
328 tB2 = centerline(MOOD2, -0.10, 0.060) * gB
329 tB3 = centerline(MOOD3, -0.18, 0.050) * gB
330 tB4 = centerline(MOOD4, -0.26, 0.050) * gB
331 tC = centerline(CITY, -0.12, 0.060) * gC
332 tD1 = centerline(DATE1, -0.06, 0.060) * gD
333 tD2 = centerline(DATE2, -0.14, 0.055) * gD
334 tE1 = centerline(SEE1, -0.08, 0.070) * gE
335 tE2 = centerline(SEE2, -0.18, 0.070) * gE
336 tt = max(max(max(tA1, tA2), max(tB1, tB2)), max(max(tB3, tB4), max(tC, max(max(tD1, tD2), max(tE1, tE2)))))
337 cadd(tt * 0.95, tt * 0.98, tt * 1.00)
339 # highlight roll-off so the core does not become a white hole
340 rv = cget(0)
341 gv = cget(1)
342 bv = cget(2)
343 rgb(dist(rv, 1.30), dist(gv, 1.30), dist(bv, 1.30))
346post {
347 cr = tap(0.0, 0.0)
348 cg = r1
349 cb = r2
350 br = 0.0
351 bg = 0.0
352 bb = 0.0
353 tr = tap(0.004, 0.0)
354 br = br + tr
355 bg = bg + r1
356 bb = bb + r2
357 tr = tap(-0.004, 0.0)
358 br = br + tr
359 bg = bg + r1
360 bb = bb + r2
361 tr = tap(0.0, 0.004)
362 br = br + tr
363 bg = bg + r1
364 bb = bb + r2
365 tr = tap(0.0, -0.004)
366 br = br + tr
367 bg = bg + r1
368 bb = bb + r2
369 tr = tap(0.007, 0.007)
370 br = br + tr
371 bg = bg + r1
372 bb = bb + r2
373 tr = tap(-0.007, -0.007)
374 br = br + tr
375 bg = bg + r1
376 bb = bb + r2
377 cr = cr + br * 0.10
378 cg = cg + bg * 0.10
379 cb = cb + bb * 0.10
381 # soft bloom + slight chromatic fringe
382 cr = cr + br * 0.04 + 0.015 * (1.0 - smooth(0.0, 0.5, len(u, v)))
383 cg = cg + bg * 0.04
384 cb = cb + bb * 0.04
385 vg = 1.0 - 0.38 * smooth(0.35, 1.05, len(u * 0.85, v))
386 cr = cr * vg
387 cg = cg * vg
388 cb = cb * vg
389 gr = hash(x * 917.0 + y * 271.0 + frame * 13.0) - 0.5
390 cr = cr + gr * 0.02
391 cg = cg + gr * 0.02
392 cb = cb + gr * 0.02
393 if (y < 0.055 || y > 0.945) {
394 cr = 0.0
395 cg = 0.0
396 cb = 0.0
397 }
398 rgb(cr, cg, cb)

Click a line number to link to that line.

← FEEDBACK