LIFEFORCE
lifeforce.dmt · 128 BPM · 1:00 · 960×600
homagelongcinematicmorph
notes
A study after Lifeforce by Andromeda Software Development (2007): a cyclic tone poem from birth through vessels, cells and leaves to release. One pixel program morphs eight scenes continuously.
| file | lifeforce.dmt |
|---|---|
| duration | 1:00 |
| video | 960×600 · 30 fps · h264 + audio · 10 MB |
| song | 128 BPM · speed 6 · rpb 4 · 7 channels |
| loop | 0 |
| render | scale 2 · dither on · master 0.60 |
| uniforms | he kickE snareE arpE shock |
| tags | homagelongcinematicmorph |
| source | 703 lines · 25 KB · download |
anatomy
14VM programs
16patterns
0palettes
9timeline events
3text / sample / texture
703source lines
10inst
0chan
1master
1frame
1pixel
1post
13fn
line composition
pattern 42%fn 36%inst 9%pixel 6%post 2%timeline 2%frame 1%master 1%text 0%title 0%song 0%order 0%pan 0%uniform 0%
play order
01012323454567678989101110111213121314141515
order list · 32 entries
timeline
| at | event | value | source | |
|---|---|---|---|---|
| 0:00 | acts | 0 | L379 | |
| 0:08 | acts | 1 | L380 | |
| 0:15 | acts | 2 | L381 | |
| 0:23 | acts | 3 | L382 | |
| 0:30 | acts | 4 | L383 | |
| 0:38 | acts | 5 | L384 | |
| 0:45 | acts | 6 | L385 | |
| 0:53 | acts | 7 | L386 | |
| 1:00 | acts | 8 | L387 |
Event times are derived from the order list, pattern lengths, BPM and RPB.
resources
| kind | name | info | value |
|---|---|---|---|
| text | ttl | 9 | LIFEFORCE |
| text | credit | 55 | AFTER LIFEFORCE BY ANDROMEDA SOFTWARE DEVELOPMENT, 2007 |
| text | withlove | 9 | with love |
source
1# @description A study after Lifeforce by Andromeda Software Development (2007): a cyclic tone poem from birth through vessels, cells and leaves to release. One pixel program morphs eight scenes continuously.
2# @tags homage, morph, cinematic
3# lifeforce.dmt - a study after "Lifeforce" by Andromeda Software Development (2007)
4# Original 128 BPM cyclic tone poem: birth -> vessels -> cells -> leaves -> the reach
5# -> underwater -> crimson aggression -> release. 32 bars = ~59.98 s.
6# One pixel program morphs eight scenes continuously; one tracker drives the whole arc.
8title LIFEFORCE
9song bpm=128 speed=6 rpb=4 channels=7 loop=0 volume=0.60 scale=2 dither=1
10order 0 1 0 1 2 3 2 3 4 5 4 5 6 7 6 7 8 9 8 9 10 11 10 11 12 13 12 13 14 14 15 15
11pan 0.5 0.5 0.62 0.5 0.38 0.6 0.34
13text ttl "LIFEFORCE"
14text credit "AFTER LIFEFORCE BY ANDROMEDA SOFTWARE DEVELOPMENT, 2007"
15text withlove "with love"
17# two-stage heart thump (lub-dub) for birth and death; fixed low body, deep and soft
18inst heart {
19 lub = exp(-t * 15)
20 dub = exp(-(t - 0.24) * 18) * step(0.24, t)
21 $p = $p + 46 / sr
22 out(sin($p * tau) * (0.9 * lub + 0.55 * dub) + sin($p * tau * 2) * 0.18 * lub)
23}
24inst kick {
25 f = 48 + 470 * exp(-t * 42)
26 $p = $p + f / sr
27 body = sin($p * tau) * exp(-t * 7)
28 click = noise() * exp(-t * 120) * 0.22
29 out(dist(body + click, 1.8) * 0.9)
30}
31inst snare {
32 body = osc(t * 178) * exp(-t * 30)
33 air = hp(noise(), 1500) * exp(-t * 22)
34 out((body * 0.28 + air * 0.85) * 0.6)
35}
36inst hat {
37 n = hp(noise(), 7600)
38 out(n * exp(-t * (45 + 70 * (1 - vel))) * 0.28)
39}
40inst bass {
41 e = env(0.002, 0.12, 0.0, 0.03)
42 $sub = $sub + freq * 0.5 / sr
43 s = saw(ph) * 0.55 + sqr($sub, 0.5) * 0.5 + sin($sub * tau) * 0.4
44 s = svf(s, 160 + 900 * e, 0.3)
45 out(s * e * 0.75)
46}
47inst pad nna=continue {
48 third = p0 > 0.5 ? 1.259921 : 1.189207
49 $p3 = $p3 + freq * third / sr
50 $p5 = $p5 + freq * 1.498 / sr
51 e = env(0.35, 0.9, 0.8, 1.2)
52 a = tri(ph) * 0.40 + tri($p3) * 0.26 + tri($p5) * 0.20 + saw(ph) * 0.12
53 a = svf(a, 400 + 500 * sin(t * 0.4) + 300 * e, 0.25)
54 out(a * e * 0.4)
55}
56inst pluck {
57 e = min(t * 200, 1) * exp(-t * 4.2)
58 m = sin(ph * tau * 2.2) * 1.6 * exp(-t * 4)
59 s = sin(ph * tau + m) + sin(ph * tau * 1.49 + m * 0.4) * 0.3
60 out(s * e * 0.3)
61}
62inst stab {
63 e = env(0.004, 0.08, 0.2, 0.05)
64 $p = $p + freq / sr
65 s = bsaw($p, freq) * 0.5 + saw($p) * 0.35 + sqr($p * 0.5, 0.5) * 0.2
66 s = svf(s, 600 + 2600 * e + 900 * p0, 0.4)
67 out(dist(s, 1.9) * e * 0.5)
68}
69inst air {
70 e = env(0.35, 0.6, 0.7, 1.2)
71 n = svf(noise(), 700 + 400 * sin(t * 0.13) + 300 * e, 0.7)
72 out(hp(n, 200) * e * 0.14)
73}
74inst shimmer {
75 e = exp(-t * 2.5) * min(t * 150, 1)
76 m = sin(ph * tau * 5.02) * 1.4 * exp(-t * 3)
77 s = sin(ph * tau + m) + sin(ph * tau * 2.01 + m * 0.5) * 0.28
78 out(hp(s, 500) * e * 0.2)
79}
81master {
82 w = verb((l + r) * 0.5, 0.62, 0.48)
83 room = hp(w, 500)
84 out(dist(hp(l + room * 0.10, 24), 1.02) * 0.92, dist(hp(r + room * 0.10, 24), 1.02) * 0.92)
85}
87# channels: 0 heart/kick 1 snare 2 hat 3 bass 4 pad 5 lead 6 air
89pattern 0 rows=16 {
90 C-3 1 38 | . | . | . | A-3 6 28 S00 | . | C-5 9 1C
91 . | . | . | . | . | . | .
92 . | . | . | . | . | . | .
93 . | . | . | . | . | . | .
94 . | . | . | . | . | E-6 10 14 | .
95 . | . | . | . | . | . | .
96 . | . | . | . | . | . | .
97 . | . | . | . | . | . | .
98 C-3 1 30 | . | . | . | . | . | .
99 . | . | . | . | . | . | .
100 . | . | . | . | . | . | .
101 . | . | . | . | . | . | .
102 . | . | . | . | A-3 6 24 S00 | . | .
103 . | . | . | . | . | . | .
104 . | . | . | . | . | . | .
105 . | . | . | . | . | . | .
106}
107pattern 1 rows=16 {
108 C-3 1 40 | . | . | . | E-3 6 24 S00 | . | C-5 9 1A
109 . | . | . | . | . | . | .
110 . | . | . | . | . | . | .
111 . | . | . | . | . | . | .
112 . | . | . | . | . | E-6 10 12 | .
113 . | . | . | . | . | . | .
114 . | . | . | . | . | . | .
115 . | . | . | . | . | . | .
116 C-3 1 30 | . | . | . | . | . | .
117 . | . | . | . | . | . | .
118 . | . | . | . | . | . | .
119 . | . | . | . | A-3 6 20 S00 | . | .
120 . | . | . | . | . | . | .
121 . | . | . | . | . | . | .
122 . | . | . | . | . | . | .
123 . | . | . | . | . | . | .
124}
125pattern 2 rows=16 {
126 C-3 1 36 | . | C-6 4 10 | . | A-3 6 26 S00 | . | .
127 . | . | . | . | . | . | .
128 . | . | C-6 4 12 | A-1 5 34 | . | . | .
129 . | . | . | . | . | . | .
130 C-3 1 34 | . | C-6 4 10 | . | . | . | .
131 . | . | . | . | . | . | .
132 . | . | C-6 4 12 | A-1 5 32 | . | . | .
133 . | . | . | . | . | . | .
134 C-3 1 36 | . | C-6 4 10 | . | . | . | .
135 . | . | . | . | . | . | .
136 . | . | C-6 4 12 | E-2 5 34 | . | . | .
137 . | . | . | . | . | . | .
138 C-3 1 34 | . | C-6 4 10 | . | A-3 6 22 S00 | . | .
139 . | . | . | . | . | . | .
140 . | . | C-6 4 12 | A-1 5 30 | . | . | .
141 . | . | . | . | . | . | .
142}
143pattern 3 rows=16 {
144 C-3 1 36 | . | C-6 4 10 | . | A-3 6 24 S00 | . | .
145 . | . | . | . | . | . | .
146 . | . | C-6 4 12 | F-1 5 34 | . | . | .
147 . | . | . | . | . | . | .
148 C-3 1 34 | . | C-6 4 10 | . | . | . | .
149 . | . | . | . | . | . | .
150 . | . | C-6 4 12 | F-1 5 32 | . | . | .
151 . | . | . | . | . | . | .
152 C-3 1 36 | . | C-6 4 10 | . | . | . | .
153 . | . | . | . | . | . | .
154 . | . | C-6 4 12 | C-2 5 34 | . | . | .
155 . | . | . | . | . | . | .
156 C-3 1 34 | . | C-6 4 10 | . | F-3 6 22 SFF | . | .
157 . | . | . | . | . | . | .
158 . | . | C-6 4 12 | F-1 5 30 | . | . | .
159 . | . | . | . | . | . | .
160}
161pattern 4 rows=16 {
162 C-3 1 34 | . | C-6 4 14 | F-1 5 36 | F-3 6 26 SFF | A-4 7 20 | .
163 . | . | . | . | . | . | .
164 . | . | . | . | . | C-5 7 16 | .
165 . | . | . | . | . | . | .
166 C-3 1 30 | . | C-6 4 14 | . | . | . | .
167 . | . | . | . | . | . | .
168 . | . | . | C-2 5 34 | . | D-5 7 16 | .
169 . | . | . | . | . | . | .
170 C-3 1 34 | . | C-6 4 14 | F-1 5 36 | . | . | .
171 . | . | . | . | . | . | .
172 . | . | . | . | . | E-5 7 16 | .
173 . | . | . | . | . | . | .
174 C-3 1 30 | . | C-6 4 14 | . | F-3 6 22 SFF | . | .
175 . | . | . | . | . | . | .
176 . | . | . | C-2 5 30 | . | A-4 7 16 | .
177 . | . | . | . | . | . | .
178}
179pattern 5 rows=16 {
180 C-3 1 34 | . | C-6 4 14 | C-2 5 36 | C-4 6 26 SFF | E-5 7 20 | .
181 . | . | . | . | . | . | .
182 . | . | . | . | . | G-5 7 16 | .
183 . | . | . | . | . | . | .
184 C-3 1 30 | . | C-6 4 14 | . | . | . | .
185 . | . | . | . | . | . | .
186 . | . | . | G-1 5 34 | . | E-5 7 16 | .
187 . | . | . | . | . | . | .
188 C-3 1 34 | . | C-6 4 14 | C-2 5 36 | C-4 6 22 SFF | . | .
189 . | . | . | . | . | . | .
190 . | . | . | . | . | C-5 7 16 | .
191 . | . | . | . | . | . | .
192 C-3 1 30 | . | C-6 4 14 | . | . | . | .
193 . | . | . | . | . | . | .
194 . | . | . | G-1 5 30 | . | A-4 7 16 | .
195 . | . | . | . | . | . | .
196}
197pattern 6 rows=16 {
198 C-3 1 36 | . | C-6 4 1A | C-2 5 36 | C-4 6 26 SFF | C-5 7 22 | .
199 . | . | C-6 4 10 | . | . | . | .
200 . | . | C-6 4 1A | . | . | E-5 7 18 | .
201 . | C-5 3 14 | C-6 4 10 | . | . | . | .
202 C-3 1 34 | . | C-6 4 1A | G-1 5 34 | . | G-5 7 18 | .
203 . | . | C-6 4 10 | . | . | . | .
204 . | . | C-6 4 1A | . | . | A-5 7 20 | .
205 . | . | C-6 4 10 | . | . | . | .
206 C-3 1 36 | . | C-6 4 1A | C-2 5 36 | C-4 6 22 SFF | C-5 7 22 | .
207 . | . | C-6 4 10 | . | . | . | .
208 . | C-5 3 14 | C-6 4 1A | . | . | E-5 7 18 | .
209 . | . | C-6 4 10 | . | . | . | .
210 C-3 1 34 | . | C-6 4 1A | G-1 5 34 | . | G-5 7 18 | .
211 . | . | C-6 4 10 | . | . | . | .
212 . | . | C-6 4 1A | . | . | D-6 7 16 | .
213 . | C-5 3 16 | C-6 4 10 | . | . | . | .
214}
215pattern 7 rows=16 {
216 C-3 1 36 | . | C-6 4 1A | C-2 5 36 | C-4 6 24 SFF | E-5 7 20 | .
217 . | . | C-6 4 10 | . | . | . | .
218 . | . | C-6 4 1A | . | . | G-5 7 18 | .
219 . | C-5 3 14 | C-6 4 10 | . | . | . | .
220 C-3 1 34 | . | C-6 4 1A | G-1 5 34 | . | C-6 7 16 | .
221 . | . | C-6 4 10 | . | . | . | .
222 . | . | C-6 4 1A | . | . | A-5 7 20 | .
223 . | . | C-6 4 10 | . | . | . | .
224 C-3 1 36 | . | C-6 4 1A | C-2 5 36 | C-4 6 22 SFF | C-5 7 20 | .
225 . | . | C-6 4 10 | . | . | . | .
226 . | C-5 3 14 | C-6 4 1A | . | . | E-5 7 18 | .
227 . | . | C-6 4 10 | . | . | . | .
228 C-3 1 34 | . | C-6 4 1A | G-1 5 34 | . | G-5 7 18 | .
229 . | . | C-6 4 10 | . | . | . | .
230 . | . | C-6 4 1A | . | . | E-6 7 14 | .
231 . | C-5 3 16 | C-6 4 10 | . | . | . | .
232}
233pattern 8 rows=16 {
234 C-3 1 40 | . | C-6 4 12 | G-1 5 36 | G-3 6 30 SFF | A-4 7 26 | C-5 9 1C
235 . | . | . | . | . | . | .
236 . | . | . | . | . | . | .
237 . | . | . | . | . | . | .
238 . | C-5 3 20 | . | . | . | C-5 7 24 | .
239 . | . | . | . | . | . | .
240 . | . | . | G-1 5 34 | . | . | .
241 . | . | . | . | . | . | .
242 C-3 1 38 | . | C-6 4 12 | . | G-3 6 28 SFF | D-5 7 22 | .
243 . | . | . | . | . | . | .
244 . | . | . | E-2 5 34 | . | . | .
245 . | . | . | . | . | . | .
246 . | C-5 3 26 | . | . | G-3 6 24 SFF | E-5 7 26 | .
247 . | . | . | . | . | . | .
248 . | . | . | . | . | . | .
249 . | . | . | . | . | E-5 7 20 | .
250}
251pattern 9 rows=16 {
252 C-3 1 40 | . | C-6 4 12 | E-1 5 36 | E-3 6 28 SFF | G-5 7 24 | C-5 9 18
253 . | . | . | . | . | . | .
254 . | . | . | . | . | . | .
255 . | . | . | . | . | . | .
256 . | C-5 3 20 | . | . | . | E-5 7 22 | .
257 . | . | . | . | . | . | .
258 . | . | . | G-1 5 34 | . | . | .
259 . | . | . | . | . | . | .
260 C-3 1 38 | . | C-6 4 12 | . | E-3 6 26 SFF | D-5 7 22 | .
261 . | . | . | . | . | . | .
262 . | . | . | E-2 5 34 | . | . | .
263 . | . | . | . | . | . | .
264 . | C-5 3 26 | . | . | G-3 6 24 SFF | C-5 7 24 | .
265 . | . | . | . | . | . | .
266 . | . | . | . | . | A-4 7 20 | .
267 . | . | . | . | . | . | .
268}
269pattern 10 rows=16 {
270 . | . | . | D-2 5 32 | D-3 6 26 S00 | C-6 10 22 | C-5 9 12
271 . | . | . | . | . | . | .
272 . | . | . | . | . | . | .
273 . | . | . | . | . | . | .
274 . | . | . | . | . | G-5 10 18 | .
275 . | . | . | . | . | . | .
276 . | . | . | . | . | . | .
277 . | . | . | . | . | . | .
278 . | . | . | D-2 5 30 | . | D-6 10 20 | .
279 . | . | . | . | . | . | .
280 . | . | . | . | . | . | .
281 . | . | . | . | D-3 6 22 S00 | . | .
282 . | . | . | . | . | . | .
283 . | . | . | . | . | A-5 10 18 | .
284 . | . | . | . | . | . | .
285 . | . | . | . | . | . | .
286}
287pattern 11 rows=16 {
288 . | . | . | F-1 5 30 | F-3 6 24 SFF | A-5 10 18 | C-5 9 10
289 . | . | . | . | . | . | .
290 . | . | . | . | . | C-6 10 16 | .
291 . | . | . | . | . | . | .
292 . | . | . | . | . | . | .
293 . | . | . | . | . | . | .
294 . | . | . | C-2 5 28 | . | E-6 10 14 | .
295 . | . | . | . | . | . | .
296 . | . | . | . | . | . | .
297 . | . | . | . | . | . | .
298 . | . | . | D-2 5 28 | . | G-5 10 14 | .
299 . | . | . | . | . | . | .
300 . | . | . | . | . | D-6 10 16 | .
301 . | . | . | . | . | . | .
302 . | . | . | . | . | . | .
303 . | . | . | . | . | . | .
304}
305pattern 12 rows=16 {
306 C-3 2 40 | . | C-6 4 1E | E-1 5 40 | E-3 6 2C SFF | E-4 8 28 | C-5 9 16
307 . | . | C-6 4 12 | . | . | . | .
308 . | . | C-6 4 1E | . | . | E-4 8 24 | .
309 . | C-5 3 22 | C-6 4 12 | . | . | . | .
310 C-3 2 40 | . | C-6 4 1E | E-1 5 40 | . | G-4 8 24 | .
311 . | . | C-6 4 12 | . | . | . | .
312 . | . | C-6 4 1E | . | . | E-4 8 26 | .
313 . | . | C-6 4 12 | . | . | . | .
314 C-3 2 40 | . | C-6 4 1E | D-2 5 3A | E-3 6 2C SFF | D-5 8 24 | .
315 . | . | C-6 4 12 | . | . | . | .
316 . | C-5 3 26 | C-6 4 1E | . | . | E-4 8 26 | .
317 . | . | C-6 4 12 | . | . | . | .
318 C-3 2 40 | . | C-6 4 1E | E-1 5 40 | . | G-4 8 24 | .
319 . | . | C-6 4 12 | . | . | . | .
320 . | . | C-6 4 1E | . | . | A-4 8 26 | .
321 C-3 2 30 | C-5 3 26 | C-6 4 12 | . | . | B-4 8 24 | .
322}
323pattern 13 rows=16 {
324 C-3 2 40 | . | C-6 4 1E | D-2 5 40 | E-3 6 2C SFF | A-4 8 28 | C-5 9 18
325 . | . | C-6 4 12 | . | . | . | .
326 . | C-5 3 20 | C-6 4 1E | . | . | E-4 8 24 | .
327 . | . | C-6 4 12 | . | . | . | .
328 C-3 2 40 | . | C-6 4 1E | D-2 5 40 | . | B-4 8 24 | .
329 . | . | C-6 4 12 | . | . | . | .
330 . | C-5 3 20 | C-6 4 1E | . | . | A-4 8 26 | .
331 . | . | C-6 4 12 | . | . | . | .
332 C-3 2 40 | . | C-6 4 1E | C-2 5 3A | E-3 6 2C SFF | G-4 8 24 | .
333 . | . | C-6 4 12 | . | . | . | .
334 . | C-5 3 24 | C-6 4 1E | . | . | E-4 8 26 | .
335 . | . | C-6 4 12 | . | . | . | .
336 C-3 2 40 | . | C-6 4 1E | B-1 5 40 | . | D-5 8 24 | .
337 . | . | C-6 4 12 | . | . | . | .
338 C-3 2 30 | . | C-6 4 1E | . | . | E-4 8 26 | .
339 C-3 2 40 | C-5 3 30 | C-6 4 12 | . | . | G-4 8 26 | .
340}
341pattern 14 rows=16 {
342 C-3 1 26 | . | . | . | A-3 6 20 S00 | . | C-5 9 0A
343 . | . | . | . | . | . | .
344 . | . | . | . | . | . | .
345 . | . | . | . | . | . | .
346 . | . | . | . | . | . | .
347 . | . | . | . | . | . | .
348 . | . | . | . | . | . | .
349 . | . | . | . | . | . | .
350 . | . | . | . | . | . | .
351 . | . | . | . | . | . | .
352 . | . | . | . | . | . | .
353 . | . | . | . | . | . | .
354 C-3 1 1E | . | . | . | . | . | .
355 . | . | . | . | . | . | .
356 . | . | . | . | . | . | .
357 . | . | . | . | . | . | .
358}
359pattern 15 rows=16 {
360 . | . | . | . | A-3 6 16 S00 | . | C-5 9 08
361 . | . | . | . | . | . | .
362 . | . | . | . | . | . | .
363 . | . | . | . | . | . | .
364 . | . | . | . | . | . | .
365 . | . | . | . | . | . | .
366 . | . | . | . | . | . | .
367 . | . | . | . | . | . | .
368 C-3 1 16 | . | . | . | . | . | .
369 . | . | . | . | . | . | .
370 . | . | . | . | . | . | .
371 . | . | . | . | . | . | .
372 . | . | . | . | . | . | .
373 . | . | . | . | . | . | .
374 . | . | . | . | . | . | .
375 . | . | . | . | . | . | .
376}
378timeline {
379 0:00 acts=0
380 4:00 acts=1
381 8:00 acts=2
382 12:00 acts=3
383 16:00 acts=4
384 20:00 acts=5
385 24:00 acts=6
386 28:00 acts=7
387 32:00 acts=8
388}
390# ---- helpers (inlined) -----------------------------------------------------
391fn sdS(px, py, ax, ay, bx, by) {
392 abx = bx - ax
393 aby = by - ay
394 tt = clamp(((px - ax) * abx + (py - ay) * aby) / (abx * abx + aby * aby + 0.0001), 0, 1)
395 return len(px - ax - abx * tt, py - ay - aby * tt)
396}
397fn hplot(px, py, s, ox, oy) {
398 hx = (px - ox) / s
399 hy = (py - oy) / s
400 q = hx * hx + hy * hy - 1
401 return q * q * q - hx * hx * hy * hy * hy
402}
403fn sdR(px, py, cx, cy, hw, hh) {
404 dx = abs(px - cx) - hw
405 dy = abs(py - cy) - hh
406 return len(max(dx, 0), max(dy, 0)) + min(max(dx, dy), 0)
407}
409# ---- eight compositions, each paints the colour accumulator -----------------
410fn s_bluefig(px, py) {
411 headx = -0.30
412 gy0 = -0.76
413 heady = gy0 + 0.78
414 hipx = -0.30
415 hipy = gy0 + 0.40
416 legLx = -0.42
417 legLy = gy0 + 0.06
418 legRx = -0.19
419 legRy = gy0 + 0.06
420 arm2x = -0.12
421 arm2y = gy0 + 0.50
422 arX = -0.02 + 0.05 * sin(beat * 0.4)
423 arY = gy0 + 0.62
424 body = min(len(px - headx, py - heady) - 0.10, sdS(px, py, headx, heady - 0.10, hipx, hipy) - 0.06)
425 body = min(body, sdS(px, py, hipx, hipy, legLx, legLy) - 0.055)
426 body = min(body, sdS(px, py, hipx, hipy, legRx, legRy) - 0.055)
427 body = min(body, sdS(px, py, headx, heady - 0.06, arX, arY) - 0.055)
428 body = min(body, sdS(px, py, headx, heady - 0.08, arm2x, arm2y) - 0.055)
429 sil = step(body, 0.0)
430 rim = exp(-abs(body) * 14)
431 proj = 0.5 + 0.5 * ((px - headx) * 0.6 + (py - heady) * 0.8)
432 lit = smooth(0.2, 0.75, proj)
433 bgv = 0.05 + 0.13 * exp(-abs(py - 0.02) * 1.5) + 0.05 * fbm(px * 2.2, py * 2.2 + beat * 0.04, 3)
434 hsv(0.60, 0.55, clamp(bgv * (1 - sil * 0.88), 0, 1.2))
435 litv = rim * lit * (0.6 + 0.5 * sin(beat * 2))
436 cadd(litv * 1.15, litv * 0.72, litv * 0.32)
437 face = exp(-len(px - headx - 0.045, py - heady + 0.01) * 30) * lit
438 cadd(face * 0.75, face * 0.45, face * 0.16)
439 hg = exp(-len(px - 0.55, py - 0.55) * 3.0) * (0.22 + 0.28 * he)
440 cadd(hg * 0.95, hg * 0.32, hg * 0.14)
441 gn = hash(px * 913 + py * 427 + t * 9) * 0.05
442 cadd(gn, gn * 0.9, gn)
443}
444fn s_temple(px, py) {
445 # massive sandstone gateway, close to camera
446 pillar = step(0.40, abs(px)) * step(abs(px), 0.92) * step(-0.55, py) * step(py, 0.24)
447 lintel = step(0.24, py) * step(py, 0.46) * step(abs(px), 0.96)
448 door = step(abs(px), 0.38) * step(-0.34, py) * step(py, 0.24)
449 ground = step(py, -0.55) * step(abs(px), 1.10)
450 stone = pillar + lintel
451 # block seams: horizontal courses on pillars/lintel, vertical joints on lintel
452 seamC = smooth(0.012, 0.05, abs(fract(py * 5.0 + 0.5) - 0.5))
453 seamJ = smooth(0.012, 0.05, abs(fract(px * 2.6 + 0.5) - 0.5))
454 seam = seamC * seamJ
455 # light from the doorway spills onto inner pillar faces and under-lintel
456 facet = exp(-abs(abs(px) - 0.44) * 4.5) * step(abs(px), 0.92)
457 ulint = exp(-max(0.24 - py, 0) * 8) * step(abs(px), 0.96) * step(py, 0.26)
458 lit = clamp(facet + ulint, 0, 1.4)
459 # sky: dark red-brown above the lintel
460 skyv = 0.055 + 0.075 * smooth(0.46, 0.95, py)
461 lightspill = exp(-abs(px) * 2.4) * exp(-max(-0.55 - py, 0) * 4) * 0.9
462 dust = step(0.9960, hash(floor(px * 80 - beat * 0.9) * 3 + floor(py * 60) * 7 + floor(beat * 2)))
463 hsv(0.030, 0.55, clamp(skyv, 0, 1))
464 stonev = 0.28 + 0.30 * lit
465 cadd(stone * (0.44 + stonev), stone * (0.34 + stonev * 0.82), stone * (0.20 + stonev * 0.6))
466 cmul(1 - stone * (1 - seam) * 0.42)
467 # desert floor, lit near the doorway
468 sandv = 0.16 + lightspill * 0.5
469 cadd(ground * (0.26 + lightspill * 0.55), ground * (0.18 + lightspill * 0.42), ground * 0.10)
470 # white doorway (recess) + a thin lit door frame
471 drim = exp(-abs(abs(px) - 0.38) * 16) * step(-0.34, py) * step(py, 0.24)
472 cadd(door * 1.30 + drim * 1.1, door * 1.10 + drim * 0.9, door * 0.95 + drim * 0.7)
473 cadd(lightspill * 0.85, lightspill * 0.6, lightspill * 0.35)
474 cadd(dust * 0.9, dust * 0.72, dust * 0.5)
475}
476fn s_cenote(px, py) {
477 wd = 0.10 + 0.20 * smooth(-1.0, 1.0, py) + 0.05 * fbm(px, py * 2 + beat * 0.1, 2)
478 sh1 = exp(-abs(px * 0.9 + py * 0.55 - 0.3) * 3.6)
479 sh2 = exp(-abs(px * 0.9 + py * 0.55 + 0.4) * 3.6)
480 sh3 = exp(-abs(px * 0.9 + py * 0.55 - 1.0) * 3.6)
481 shaft = (sh1 * 1.0 + sh2 * 0.65 + sh3 * 0.45) * step(-0.25, px * 0.9 + py * 0.55)
482 # cave walls: darken the top and far sides to frame the shaft opening
483 cave = 0.60 * (1 - smooth(0.22, 0.85, py)) + 0.55 * (smooth(1.12, 1.58, abs(px))) * (1 - smooth(0.0, 0.55, py))
484 # diver: clear human silhouette (head/torso/two arms/two legs), angled
485 dvx = -0.06 + 0.05 * sin(beat * 0.3)
486 dvy = 0.02 + 0.06 * sin(beat * 0.2)
487 head = len(px - (dvx + 0.05), py - (dvy + 0.26)) - 0.075
488 torso = sdS(px, py, dvx, dvy + 0.22, dvx - 0.06, dvy + 0.01) - 0.075
489 armU = sdS(px, py, dvx + 0.01, dvy + 0.22, dvx + 0.15, dvy + 0.36) - 0.032
490 armD = sdS(px, py, dvx, dvy + 0.20, dvx + 0.13, dvy + 0.08) - 0.032
491 legF = sdS(px, py, dvx - 0.07, dvy, dvx - 0.14, dvy - 0.18) - 0.048
492 legB = sdS(px, py, dvx - 0.05, dvy + 0.01, dvx - 0.02, dvy - 0.19) - 0.048
493 db = min(min(min(min(head, torso), armU), min(armD, legF)), legB)
494 diver = step(db, 0.0)
495 rimd = exp(-abs(db) * 15) * shaft
496 pl = step(0.9960, hash(floor(px * 55 + beat * 0.4) + floor(py * 40) * 31 + floor(beat * 3)))
497 hsv(0.562, 0.55, clamp(wd * (1 - cave * 0.55), 0, 1))
498 cadd(shaft * 0.5, shaft * 0.68, shaft * 0.95)
499 cmul(1 - cave * 0.5)
500 cmul(1 - diver * 0.94)
501 cadd(pl * 0.3, pl * 0.8, pl * 0.9)
502 cadd(rimd * 0.5, rimd * 0.7, rimd * 0.9)
503}
504fn s_gear(px, py) {
505 # cracked blue-teal rock, lit from the upper-left
506 lite = 0.5 + 0.5 * (px * 0.75 + py * 0.65)
507 rock = fbm(px * 2.6, py * 2.8, 3)
508 cr = vor(px * 2.2, py * 2.2)
509 ced = r2 - cr
510 crackline = exp(-ced * 34) * 0.55
511 rockv = 0.08 + 0.13 * rock + 0.10 * lite + crackline * 0.05
512 # giant stone gear: thick rim + 14 square teeth + dark hub + 3 spokes
513 rx = rot(px, py, beat * 0.10)
514 ry = r1
515 r = len(rx, ry)
516 a = atan2(ry, rx)
517 ta = fract(a * 14 / tau)
518 tooth = smooth(0.28, 0.40, ta) * (1 - smooth(0.60, 0.72, ta))
519 tex = 0.565 + 0.115 * tooth
520 rim = abs(r - tex) - 0.075
521 gear = (1 - smooth(0.008, 0.06, rim)) * step(r, 0.72)
522 hub = step(r, 0.17)
523 spoke = smooth(0.26, 0.34, abs(0.5 + 0.5 * sin(a * 3))) * step(r, 0.52) * (1 - step(r, 0.17))
524 # stone shading: lit upper-left, darker lower-right, dark hub
525 shade = 0.32 + 0.42 * (0.5 + 0.5 * (px * 0.8 + py * 0.6)) - 0.13 * step(r, 0.20)
526 stv = gear * shade + spoke * shade * 0.8 + hub * 0.10
527 hsv(0.52 + 0.04 * rock, 0.34, clamp(rockv, 0, 1.1))
528 cadd(stv * 0.52, stv * 0.56, stv * 0.62)
529 # pendulum / pointer swinging under the lintel-top
530 pend = 0.75 * sin(beat * 1.0)
531 rodx = 0.34 * sin(pend)
532 rody = -0.34 * cos(pend)
533 rod = sdS(px, py, 0.0, 1.05, rodx, 1.05 + rody)
534 bob = len(px - rodx, py - (1.05 + rody)) - 0.06
535 psh = 0.34 + 0.4 * (0.5 + 0.5 * (px * 0.8 + py * 0.6))
536 pv = (1 - smooth(0.004, 0.025, min(rod, bob))) * psh
537 cadd(pv * 0.5, pv * 0.55, pv * 0.6)
538 # small dial / sub-gear below-right
539 dcx = 0.62
540 dcy = -0.46
541 dx2 = px - dcx
542 dy2 = py - dcy
543 dr2 = len(dx2, dy2)
544 da = atan2(dy2, dx2)
545 dring = (1 - smooth(0.008, 0.04, abs(dr2 - 0.15))) * step(dr2, 0.16)
546 dtick = exp(-abs(sin(da * 8 - beat * 0.4)) * 24) * step(dr2, 0.14)
547 needle = exp(-abs(sin(da - 0.6 - 0.5 * sin(beat * 0.7)) * 3) * 18) * step(dr2, 0.16)
548 dsv = dring * 0.32 + dtick * 0.5 + needle * 0.45
549 cadd(dsv * 0.5, dsv * 0.55, dsv * 0.6)
550}
551fn s_emblem(px, py) {
552 hh = hplot(px, py, 0.30, 0.0, 0.06)
553 core = smooth(0.0, 0.45, -hh)
554 rim2 = exp(-abs(hh) * 15)
555 hsv(0.0, 0.0, 0.02)
556 hc = core * (0.55 + 0.45 * he) + rim2 * (0.3 + 0.35 * he)
557 cadd(hc * 1.35, hc * 0.26, hc * 0.16)
558 vein = smooth(0.5, 0.9, fbm(px * 8, py * 8, 3))
559 cmul(1 - core * vein * 0.5)
560 skull = len(px, py - 0.34) - 0.17
561 eyeL = len(px + 0.06, py - 0.39) - 0.05
562 eyeR = len(px - 0.06, py - 0.39) - 0.05
563 sk = step(skull, 0.0) * (1 - step(eyeL, 0.0)) * (1 - step(eyeR, 0.0))
564 cadd(sk * 0.88, sk * 0.86, sk * 0.82)
565 ringR = len(px, py)
566 cr = abs(ringR - 0.58)
567 angl = atan2(py, px)
568 shine = 0.35 + 0.65 * smooth(-1.0, 1.0, sin(angl * 4 + beat * 0.5))
569 chrome = (1 - smooth(0.008, 0.04, cr))
570 ch = chrome * shine
571 cadd(ch * 0.95, ch * 0.98, ch * 1.1)
572 ban = sdR(px, py, 0.0, -0.74, 0.40, 0.10)
573 bv = 1 - smooth(0.003, 0.03, ban)
574 cadd(bv * 0.44, bv * 0.26, bv * 0.15)
575 roll = len(px - 0.38, py - 0.74) - 0.045 + len(px + 0.38, py - 0.74) - 0.045
576 cadd((1 - smooth(0.0, 0.03, roll)) * 0.5, (1 - smooth(0.0, 0.03, roll)) * 0.32, (1 - smooth(0.0, 0.03, roll)) * 0.2)
577}
578fn s_sunset(px, py) {
579 t2 = 0.5 + 0.5 * py
580 skyh = 0.055 + 0.02 * (1 - t2)
581 skyv = 0.14 + 0.55 * t2 + 0.14 * fbm(px * 2.0 - beat * 0.03, py * 3, 2)
582 sun = exp(-len(px - 0.35, py + 0.18) * 4.5) * 0.9
583 ground = step(py, -0.30)
584 dome = len(px - 0.25, py - 0.04) - 0.18
585 tow = sdR(px, py, 0.25, -0.22, 0.11, 0.18)
586 minr = sdR(px, py, 0.56, -0.12, 0.04, 0.24)
587 tower = min(min(dome, tow), minr)
588 bird = 0
589 repeat i 3 {
590 bx = fract(beat * 0.05 + i * 0.23) * 2.6 - 1.3
591 by = 0.32 + 0.08 * sin(beat * 0.5 + i * 2.1)
592 b1 = sdS(px, py, bx - 0.055, by, bx, by + 0.03) - 0.006
593 b2 = sdS(px, py, bx + 0.055, by, bx, by + 0.03) - 0.006
594 bird += 1 - smooth(0.002, 0.02, min(b1, b2))
595 }
596 hsv(skyh, 0.7, clamp(skyv, 0, 1.3))
597 cadd(sun * 1.1, sun * 0.55, sun * 0.12)
598 cmul(1 - step(tower, 0.0) * 0.94 - bird * 0.88)
599 cmul(1 - ground * 0.30)
600}
601fn s_polaroid(px, py) {
602 rx = rot(px, py, 0.40 + 0.03 * sin(beat * 0.5))
603 ry = r1
604 photo = 1 - smooth(0.004, 0.03, sdR(rx, ry, 0.0, 0.16, 0.52, 0.42))
605 card = 1 - smooth(0.002, 0.03, sdR(rx, ry, 0.0, 0.0, 0.68, 0.62))
606 frameV = card - photo
607 split = 0.5 + 0.5 * (rx * 0.62 + ry * 0.62)
608 tg = smooth(-0.16, 0.16, sin(ry * 14 - rx * 6))
609 lionv = 0.12 + 0.55 * smooth(0.3, 0.7, fbm(rx * 5 + 9, ry * 5, 2))
610 fins = exp(-abs(sin(rx * 8 - ry * 4)) * 6) * 0.5
611 bgv = 0.16 * (1 - photo) * fbm(rx * 3, ry * 3 + beat * 0.05, 2) + photo * (0.10 + 0.24 * fbm(rx * 3, ry * 3, 2))
612 hsv(0.55, 0.5, clamp(bgv, 0, 1.1))
613 cadd(frameV * 1.2, frameV * 1.16, frameV * 1.1)
614 tigw = smooth(0.32, 0.68, 1 - split) * photo
615 lionw = smooth(0.32, 0.68, split) * photo
616 cadd(tigw * (0.10 + 0.92 * tg) * 0.95, tigw * (0.12 + 0.72 * tg) * 0.55, tigw * (0.08 + 0.40 * tg) * 0.18)
617 cadd(lionw * 0.08, lionw * (0.20 + 0.55 * lionv + fins * 0.4), lionw * (0.5 + 0.4 * lionv + fins * 0.6))
618}
619fn s_release(px, py, dimf) {
620 hh = hplot(px, py, 0.46 * dimf + 0.02, 0.0, 0.06)
621 core = smooth(0.0, 0.4, -hh)
622 rim2 = exp(-abs(hh) * 18)
623 hc = (core * (0.55 + 0.45 * he) + rim2 * (0.3 + 0.4 * he)) * dimf
624 shards = step(0.9986, hash(floor(px * 70 - beat) + floor(py * 60) * 17)) * dimf * (0.3 + 0.2 * sin(beat * 3 + px * 8))
625 hsv(0.99, 0.5, clamp(0.02 * dimf + hc, 0, 1.2))
626 cadd(shards * 0.5, shards * 0.4, shards * 0.7)
627}
628fn s_void(px, py) {
629 rgb(0, 0, 0)
630}
632# ---- one morphing pixel program --------------------------------------------
633uniform he kickE snareE arpE shock
635frame {
636 he = exp(-trig(0) * 9) + exp(-(trig(0) - 0.24) * 11) * step(0.24, trig(0)) * 0.55
637 kickE = exp(-trig(0) * 13) * step(0.004, vel(0))
638 snareE = exp(-trig(1) * 11) * step(0.004, vel(1))
639 arpE = exp(-trig(5) * 8)
640 shock = exp(-trig(6) * 10) * step(0.004, vel(6))
641}
643pixel {
644 act = evtl(acts)
645 seg = floor(act)
646 ff = fract(act)
647 k = smooth(0.42, 1.0, ff)
648 s2 = seg + 1
649 born = smooth(0.0, 1.4, t)
650 fin = 1 - smooth(57.5, 59.4, t)
651 gv = born * fin
652 dimf = 1 - smooth(7.35, 7.9, act)
654 if seg < 1 { s_bluefig(u, v) }
655 else { if seg < 2 { s_temple(u, v) }
656 else { if seg < 3 { s_cenote(u, v) }
657 else { if seg < 4 { s_gear(u, v) }
658 else { if seg < 5 { s_emblem(u, v) }
659 else { if seg < 6 { s_sunset(u, v) }
660 else { if seg < 7 { s_polaroid(u, v) }
661 else { if seg < 8 { s_release(u, v, dimf) }
662 else { s_void(u, v) } } } } } } } }
663 ar = cget(0)
664 ag = cget(1)
665 ab = cget(2)
667 if s2 < 1 { s_bluefig(u, v) }
668 else { if s2 < 2 { s_temple(u, v) }
669 else { if s2 < 3 { s_cenote(u, v) }
670 else { if s2 < 4 { s_gear(u, v) }
671 else { if s2 < 5 { s_emblem(u, v) }
672 else { if s2 < 6 { s_sunset(u, v) }
673 else { if s2 < 7 { s_polaroid(u, v) }
674 else { if s2 < 8 { s_release(u, v, dimf) }
675 else { s_void(u, v) } } } } } } } }
676 br = cget(0)
677 bg2 = cget(1)
678 bb = cget(2)
680 rgb(mix(ar, br, k) * gv, mix(ag, bg2, k) * gv, mix(ab, bb, k) * gv)
681}
683fn textline(s, px, py, sz) {
684 cx = (u - px) / sz
685 cy = (py - v) / sz
686 i = floor(cx)
687 return glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, strlen(s)) * step(0, cy) * step(cy, 1)
688}
690post {
691 blum = tap(-1, 0) + tap(1, 0) + tap(0, -1) + tap(0, 1)
692 rgb(cget(0) + blum * 0.10, cget(1) + blum * 0.10, cget(2) + blum * 0.10)
693 dd = len(u, v)
694 cmul(clamp(1 - 0.26 * dd, 0.0, 1.0))
695 tA = clamp(1 - smooth(8.0, 14.0, t) * 0.55, 0.45, 1.0)
696 tl = textline(ttl, -0.63, 0.84, 0.14)
697 cadd(tl * tA * 1.0, tl * tA * 0.84, tl * tA * 0.62)
698 cr = textline(credit, -0.715, -0.760, 0.023)
699 cadd(cr * 0.55, cr * 0.55, cr * 0.62)
700 wl = textline(withlove, -0.52, -0.645, 0.05)
701 wl = wl * (0.75 + 0.25 * sin(beat * 0.4))
702 cadd(wl * 0.30, wl * 0.36, wl * 0.46)
703}
Click a line number to link to that line.