OLDSKOOL
oldskool.dmt · 125 BPM · 30 s · 960×600
chiptunedemosceneretro
notes
An Amiga demo: copper bars, rotozoomer, fire, sine scroller, bobs and four-channel chip music.
| music | Amiga-style 4-channel chip music: one drum instrument switched by velocity, triangle bass, 0xy arpeggio chords, vibrato lead, everything bitcrushed and lowpassed |
|---|---|
| visual | copper bars, bouncing bobs, a sine scroller, a rotozoomer, classic fire propagating through the feedback buffer with the logo burning in it, timeline-cut scenes, scanlines except where the fire lives |
| file | oldskool.dmt |
|---|---|
| duration | 0:30 |
| video | 960×600 · 30 fps · h264 + audio · 15 MB |
| song | 125 BPM · speed 6 · rpb 4 · 4 channels |
| loop | 0 |
| render | scale 2 · master 0.62 |
| uniforms | kickE snE hatE bassE sc |
| collection | Demos |
| tags | chiptunedemosceneretro |
| source | 302 lines · 10 KB · download |
anatomy
11VM programs
5patterns
1palettes
7timeline events
2text / sample / texture
302source lines
4inst
0chan
1master
1frame
4pixel
1post
4fn
line composition
pattern 33%pixel 31%fn 10%inst 10%palette 3%timeline 3%frame 3%post 3%master 2%text 1%title 0%song 0%order 0%pan 0%uniform 0%
play order
00112233112244
order list · 14 entries
palettes
copper7 keys · lines 14–22
timeline
| at | event | value | source | |
|---|---|---|---|---|
| 0:00 | scene | 0 | L25 | |
| 0:00 | fade | 0 | L25 | |
| 0:00 | fade | 1 | L26 | |
| 0:08 | scene | 1 | L27 | |
| 0:15 | scene | 2 | L28 | |
| 0:23 | scene | 1 | L29 | |
| 0:25 | scene | 3 | L30 |
Event times are derived from the order list, pattern lengths, BPM and RPB. The rendered video is 0:30; the computed song length is 0:27.
resources
| kind | name | info | value |
|---|---|---|---|
| text | scroll | 205 | DMSCENE PRESENTS ... OLDSKOOL ... COPPER BARS, ROTOZOOMER, FIRE AND A SINE SCROLLER, ALL FROM ONE LITTLE VM ... GREETINGS TO THE AMIGA, THE C64 AND EVERYONE STILL COUNTING RASTER LINES ... WRAP |
| text | logo | 7 | DMSCENE |
source
1# @description An Amiga demo: copper bars, rotozoomer, fire, sine scroller, bobs and four-channel chip music.
2# @tags retro, chiptune, demoscene
3# @collection Demos
4# @music Amiga-style 4-channel chip music: one drum instrument switched by velocity, triangle bass, 0xy arpeggio chords, vibrato lead, everything bitcrushed and lowpassed
5# @visual copper bars, bouncing bobs, a sine scroller, a rotozoomer, classic fire propagating through the feedback buffer with the logo burning in it, timeline-cut scenes, scanlines except where the fire lives
6# oldskool.dmt - an Amiga demo: copper bars, rotozoomer, fire, sine scroller, bobs, 4-channel chip music.
7title OLDSKOOL
8song bpm=125 speed=6 rpb=4 channels=4 loop=0 volume=0.62 scale=2
9order 0 0 1 1 2 2 3 3 1 1 2 2 4 4
11text scroll " DMSCENE PRESENTS ... OLDSKOOL ... COPPER BARS, ROTOZOOMER, FIRE AND A SINE SCROLLER, ALL FROM ONE LITTLE VM ... GREETINGS TO THE AMIGA, THE C64 AND EVERYONE STILL COUNTING RASTER LINES ... WRAP "
12text logo "DMSCENE"
14palette copper {
15 0.00 0.00 0.00 0.00
16 0.20 0.00 0.00 0.00
17 0.35 0.80 0.10 0.10
18 0.50 1.00 1.00 0.30
19 0.65 0.10 0.30 1.00
20 0.80 0.00 0.00 0.00
21 1.00 0.00 0.00 0.00
22}
24timeline {
25 0:00 scene=0 fade=0
26 0:04 fade=1
27 4:00 scene=1
28 8:00 scene=2
29 12:00 scene=1
30 13:00 scene=3
31}
33# chip "samples": 8-bit sounding, lowpassed like an Amiga output stage
34inst drums {
35 # one instrument, three sounds by velocity: 40 kick, 30 snare, 20 hat
36 kick = step(0.55, vel)
37 snare = step(0.4, vel) * (1 - kick)
38 hat = 1 - step(0.4, vel)
39 f = 60 + 500 * exp(-t * 50)
40 $p = $p + f / sr
41 k = crush(sin($p * tau), 32) * exp(-t * 10)
42 s = crush(noise(), 8) * exp(-t * 16) + sin(tau * 200 * t) * exp(-t * 35) * 0.6
43 h = crush(hp(noise(), 6000), 4) * exp(-t * 70)
44 out(lp(k * kick * 1.2 + s * snare * 0.8 + h * hat * 0.6, 9000) * 0.75)
45}
46inst bass {
47 e = env(0.002, 0.15, 0.6, 0.05)
48 s = crush(tri(ph) * 0.7 + sqr(ph, 0.5) * 0.3, 16)
49 out(lp(s, 5000) * e * 0.55)
50}
51inst chord {
52 e = env(0.002, 0.3, 0.4, 0.06)
53 s = crush(sqr(ph, 0.5 + 0.25 * sin(t * 6)), 16)
54 out(lp(s, 7000) * e * 0.3)
55}
56inst lead {
57 e = env(0.003, 0.25, 0.5, 0.08)
58 vib = 1 + 0.01 * sin(t * 6) * min(max(t - 0.1, 0) * 5, 1)
59 $p = $p + freq * vib / sr
60 s = crush(saw($p) * 0.5 + sqr($p, 0.3) * 0.5, 24)
61 out(lp(s, 8000) * e * 0.4)
62}
64master {
65 # amiga stereo: hard-ish panned channels bleed through a short delay
66 d = dly(l * 0.5 + r * 0.5, 0.12, 0.2)
67 out(dist(l + d * 0.15, 1.2), dist(r + d * 0.15, 1.2))
68}
69pan 0.5 0.3 0.7 0.5
71# channels: 0 drums (vel picks kick/snare/hat) 1 bass 2 chords (0xy arps) 3 lead
72pattern 0 rows=16 {
73 C-4 1 40 | A-1 2 40 | A-3 3 28 037 | .
74 . | . | . | .
75 C-4 1 20 | A-2 2 36 | . | .
76 . | . | . | .
77 C-4 1 30 | A-1 2 40 | A-3 3 28 037 | .
78 . | . | . | .
79 C-4 1 20 | A-2 2 36 | . | .
80 . | A-1 2 40 | . | .
81 C-4 1 40 | F-1 2 40 | F-3 3 28 047 | .
82 . | . | . | .
83 C-4 1 20 | F-2 2 36 | . | .
84 . | . | . | .
85 C-4 1 30 | F-1 2 40 | F-3 3 28 047 | .
86 . | . | . | .
87 C-4 1 20 | G-1 2 40 | G-3 3 28 047 | .
88 . | G-2 2 36 | . | .
89}
90pattern 1 rows=16 {
91 C-4 1 40 | A-1 2 40 | A-3 3 28 037 | A-4 4 34
92 . | . | . | .
93 C-4 1 20 | A-2 2 36 | . | C-5 4 30
94 . | . | . | .
95 C-4 1 30 | A-1 2 40 | A-3 3 28 037 | E-5 4 34
96 . | . | . | .
97 C-4 1 20 | A-2 2 36 | . | D-5 4 30
98 . | A-1 2 40 | . | C-5 4 30
99 C-4 1 40 | F-1 2 40 | F-3 3 28 047 | A-4 4 34
100 . | . | . | .
101 C-4 1 20 | F-2 2 36 | . | F-4 4 30
102 . | . | . | .
103 C-4 1 30 | F-1 2 40 | F-3 3 28 047 | G-4 4 34
104 . | . | . | .
105 C-4 1 20 | G-1 2 40 | G-3 3 28 047 | B-4 4 30
106 . | G-2 2 36 | . | D-5 4 30
107}
108pattern 2 rows=16 {
109 C-4 1 40 | C-2 2 40 | C-4 3 28 047 | E-5 4 34
110 . | . | . | .
111 C-4 1 20 | C-3 2 36 | . | G-5 4 30
112 . | . | . | .
113 C-4 1 30 | C-2 2 40 | C-4 3 28 047 | C-6 4 34
114 . | . | . | .
115 C-4 1 20 | C-3 2 36 | . | B-5 4 30
116 . | C-2 2 40 | . | G-5 4 30
117 C-4 1 40 | G-1 2 40 | G-3 3 28 047 | A-5 4 34
118 . | . | . | .
119 C-4 1 20 | G-2 2 36 | . | G-5 4 30
120 . | . | . | .
121 C-4 1 30 | G-1 2 40 | G-3 3 28 047 | E-5 4 34
122 . | . | . | .
123 C-4 1 20 | E-1 2 40 | E-3 3 28 038 | D-5 4 30
124 . | E-2 2 36 | . | B-4 4 30
125}
126pattern 3 rows=16 {
127 # fire: half-time, lead holds
128 C-4 1 40 | A-1 2 40 | A-3 3 26 037 | A-4 4 34
129 . | . | . | .
130 . | . | . | .
131 . | . | . | .
132 C-4 1 30 | . | . | .
133 . | . | . | .
134 . | A-1 2 36 | . | .
135 . | . | . | .
136 C-4 1 40 | F-1 2 40 | F-3 3 26 047 | E-5 4 34
137 . | . | . | .
138 . | . | . | .
139 . | . | . | .
140 C-4 1 30 | . | . | .
141 . | . | . | .
142 . | G-1 2 36 | G-3 3 26 047 | D-5 4 30
143 . | . | . | .
144}
145pattern 4 rows=16 {
146 # end: chord stabs and a fill
147 C-4 1 40 | A-1 2 40 | A-3 3 30 037 | A-5 4 34
148 . | . | . | .
149 C-4 1 20 | . | . | .
150 . | . | . | .
151 C-4 1 30 | A-1 2 40 | A-3 3 30 037 | .
152 . | . | . | .
153 C-4 1 20 | . | . | .
154 . | . | . | .
155 C-4 1 40 | F-1 2 40 | F-3 3 30 047 | .
156 . | . | . | .
157 C-4 1 30 | . | . | .
158 C-4 1 30 | . | . | .
159 C-4 1 30 | G-1 2 40 | G-3 3 30 047 | G-5 4 30
160 C-4 1 34 | . | . | .
161 C-4 1 38 | . | . | .
162 C-4 1 40 | . | . | .
163}
165# ------------------------------------------------------------------ helpers
166fn textline(s, px, py, sz) {
167 cx = (u - px) / sz
168 cy = (py - v) / sz
169 i = floor(cx)
170 return glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, strlen(s)) * step(0, cy) * step(cy, 1)
171}
172fn sinescroll(s, base, sz, speed, amp) {
173 # each character cell rides a sine wave
174 per = strlen(s) * sz
175 px = aspect - fract(time * speed / per) * per
176 cx = (u - px) / sz
177 i = floor(cx)
178 wob = base + amp * sin(cx * 0.6 + time * 4)
179 cy = (wob - v) / sz
180 g = glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, strlen(s)) * step(0, cy) * step(cy, 1)
181 cx2 = (u - px - per) / sz
182 i2 = floor(cx2)
183 wob2 = base + amp * sin(cx2 * 0.6 + time * 4)
184 cy2 = (wob2 - v) / sz
185 g2 = glyph(str(s, i2), fract(cx2), fract(cy2)) * step(0, cx2) * step(cx2, strlen(s)) * step(0, cy2) * step(cy2, 1)
186 return max(g, g2)
187}
188fn bob(cx, cy, rad) {
189 d = len(u - cx, v - cy)
190 return (1 - smooth(rad - 0.01, rad, d)) * (0.5 + 0.5 * (1 - d / rad) * (1 - d / rad))
191}
192fn copperbar(cy, hgt) {
193 return exp(-abs(v - cy) / hgt * 3)
194}
196uniform kickE snE hatE bassE sc
198frame {
199 kickE = exp(-trig(0) * 8) * step(0.5, vel(0))
200 snE = exp(-trig(0) * 8) * step(0.35, vel(0)) * (1 - step(0.5, vel(0)))
201 bassE = exp(-trig(1) * 6)
202 sc = evt(scene)
203 select(sc)
204}
206pixel copper {
207 # background copper bars (max-composited), logo in the middle, scroller at the bottom, bobs in between
208 ar = 0
209 ag = 0
210 ab = 0.02
211 repeat k 6 {
212 cy = 0.75 * sin(beat * 0.9 + k * 1.1) * (0.6 + 0.3 * sin(beat * 0.13 + k))
213 pal(copper, 0.5 + (v - cy) * 2.2)
214 ar = max(ar, cget(0))
215 ag = max(ag, cget(1))
216 ab = max(ab, cget(2))
217 }
218 f = evtl(fade)
219 g = f * (0.6 + 0.4 * kickE)
220 ar = ar * g
221 ag = ag * g
222 ab = ab * g
223 repeat b 8 {
224 bx = 1.2 * sin(time * 1.3 + b * 0.35) * aspect * 0.8
225 by = 0.1 + 0.5 * sin(time * 2.1 + b * 0.35)
226 hsv(b * 0.125 + bar * 0.05, 0.8, 1)
227 m = bob(bx, by, 0.09) * f
228 ar = mix(ar, cget(0), m)
229 ag = mix(ag, cget(1), m)
230 ab = mix(ab, cget(2), m)
231 }
232 rgb(ar, ag, ab)
233 lg = textline(logo, -1.05, 0.35, 0.3) * f
234 cadd(lg, lg * 0.9, lg * 0.6)
235 sl = sinescroll(scroll, -0.6, 0.14, 1.0, 0.15) * f
236 cadd(sl, sl, sl * 0.3)
237}
239pixel roto {
240 # rotozoomer: checker/xor texture through a rotating, pulsing zoom; copper strip on top; scroller
241 ang = time * 0.6 + 0.5 * sin(time * 0.3)
242 zm = 3 + 1.5 * sin(time * 0.5) + 2 * kickE
243 rx = rot(u, v, ang) * zm + time * 0.8
244 ry = r1 * zm
245 cx = floor(rx)
246 cy = floor(ry)
247 chk = fract((cx + cy) * 0.5) * 2
248 tex = 0.5 + 0.5 * sin(rx * 3.14) * sin(ry * 3.14)
249 xo = fract(hash(cx * 0.37 + cy * 0.91) * 4)
250 hsv(0.55 + chk * 0.5 + bar * 0.03, 0.7, 0.35 + 0.55 * chk + 0.2 * tex)
251 cmul(0.7 + 0.3 * kickE)
252 bar1 = copperbar(0.8 + 0.1 * sin(beat), 0.05)
253 cadd(bar1, bar1 * 0.3, bar1 * 0.1)
254 sl = sinescroll(scroll, -0.55, 0.14, 1.0, 0.2)
255 cadd(sl, sl, sl)
256 cprev(x, y, 0.2)
257}
259pixel fire {
260 # classic fire: heat lives in the red channel of the previous frame
261 dy = 2.2 / h
262 dx = 1.5 / w
263 heat = (prev(x - dx, y + dy) + prev(x, y + dy) + prev(x + dx, y + dy) + prev(x, y + 2 * dy)) * 0.25
264 cool = 0.012 + 0.03 * hash(x * 311 + y * 977 + frame) * (0.6 + 0.4 * (1 - kickE))
265 heat = heat - cool
266 seed = step(0.985, y) * step(0.3 + 0.4 * (1 - kickE), hash(floor(x * w / 2) + frame * 3))
267 heat = max(heat, seed)
268 # the logo burns too
269 lg = textline(logo, -1.05, 0.25, 0.3)
270 heat = max(heat, lg * (0.75 + 0.25 * sin(time * 20 + u * 10)))
271 heat = clamp(heat, 0, 1)
272 rgb(heat, heat ^ 2.2, heat ^ 8)
273 sl = sinescroll(scroll, 0.75, 0.12, 1.0, 0.08)
274 cadd(sl * 0.6, sl * 0.6, sl)
275}
277pixel end {
278 ar = 0
279 ag = 0
280 ab = 0.02
281 repeat k 8 {
282 cy = -0.9 + k * 0.26 + 0.05 * sin(beat * 2 + k)
283 pal(copper, 0.5 + (v - cy) * 4)
284 ar = max(ar, cget(0))
285 ag = max(ag, cget(1))
286 ab = max(ab, cget(2))
287 }
288 rgb(ar, ag, ab)
289 cmul(0.5 + 0.5 * kickE)
290 lg = textline(logo, -1.05, 0.3, 0.3)
291 cadd(lg, lg, lg)
292 sl = sinescroll(scroll, -0.45, 0.16, 1.4, 0.3)
293 cadd(sl, sl * 0.8, sl * 0.2)
294}
296post {
297 # no scanlines/vignette during the fire scene: its heat lives in the frame buffer
298 notfire = 1 - step(1.5, sc) * step(sc, 2.5)
299 cmul(1 - 0.25 * step(0.5, fract(y * h * 0.5)) * notfire)
300 d = len(u, v)
301 cmul(1 - 0.25 * d * d * notfire)
302}
Click a line number to link to that line.