# @description An homage to fr-025 by Farbrausch (2003): a disco music video with a faceted mirror ball, beams, a reflective dance floor, a dancer, spinning vinyl and a neon city. All music, text and visuals are original. # @tags homage, demoscene # popular.dmt - THE POPULAR DEMO: a study/homage of fr-025 by Farbrausch (2003). # Disco music video: faceted mirror ball, beams, reflective dance floor, dancer, # spinning vinyl, neon city, scroller. 120 BPM filtered-house/disco, 48 s. # All music, text and visuals are original. title THE POPULAR DEMO song bpm=120 speed=6 rpb=4 channels=8 loop=0 volume=0.5 scale=2 dither=1 order 0 0 1 1 2 2 3 3 4 4 5 5 6 7 5 2 3 4 5 2 3 4 8 8 pan 0.5 0.55 0.42 0.46 0.5 0.38 0.6 0.55 text ttl "THE POPULAR DEMO" text crd "AFTER FR-025: THE POPULAR DEMO / FARBRAUSCH 2003" text capA "EVERYBODY SHINE" text capB "DANCE TILL SUNRISE" text capC "THE CITY MOVES WITH US" text scl " MOVE YOUR FEET THE BEAT IS CALLING ... SHINE LIKE A MIRROR BALL ... RIDE THE RHYTHM THROUGH THE CITY LIGHTS ... KEEP ON DANCING TILL THE SUN COMES UP ... ONE VM SIX PROGRAMS NO WAITING ROOMS ... THE MIRROR NEVER STOPS SPINNING ... " palette disco { 0.00 0.02 0.01 0.07 0.22 0.18 0.05 0.36 0.42 0.62 0.10 0.66 0.58 1.00 0.16 0.74 0.72 0.12 0.80 1.00 0.86 1.00 0.76 0.28 1.00 1.00 0.96 0.88 } # ---------------------------------------------------------------- timeline timeline { 0:00 scEL=0 glEL=0.0 tAEL=1.0 hAEL=0.0 hBEL=0.0 hCEL=0.0 1:00 glEL=0.25 2:00 glEL=0.45 2:00 scEL=3 glEL=0.45 4:00 scEL=1 glEL=0.35 hAEL=0.0 4:04 hAEL=1.0 7:00 scEL=2 glEL=0.55 hAEL=0.0 9:00 scEL=5 glEL=0.75 hAEL=0.0 hCEL=1.0 11:00 scEL=1 glEL=0.55 hCEL=0.0 11:04 hAEL=1.0 13:00 scEL=4 glEL=0.85 hAEL=1.0 15:00 scEL=6 glEL=1.00 hAEL=0.0 15:04 hBEL=1.0 17:00 scEL=6 glEL=1.00 19:00 scEL=6 hBEL=0.0 19:04 hCEL=1.0 22:00 scEL=6 glEL=1.00 tAEL=1.0 hCEL=0.0 } # ---------------------------------------------------------------- instruments # ch0 kick ch1 clap ch2 hat ch3 bass ch4 stab ch5 choir ch6 lead ch7 fx inst kick { f = 46 + 540 * exp(-t * 40) $kp = $kp + f / sr body = sin($kp * tau) * exp(-t * 7.5) punch = hp(noise(), 3200) * exp(-t * 110) * 0.45 out(dist(body * 1.75 + punch, 1.3) * exp(-t * 2.2) * 0.84) } inst clap { g = exp(-t * 38) + (1 - step(0.004, t)) * 0.85 g = g + 0.7 * exp(-pow((t - 0.012) / 0.0018, 2)) + 0.5 * exp(-pow((t - 0.023) / 0.0018, 2)) s = svf(noise(), 1250, 0.5) bp = r2 out(hp(bp, 700) * g * 0.6 + hp(noise(), 3600) * exp(-t * 30) * 0.16) } inst hat { out(hp(noise(), 7600) * exp(-t * (46 + 300 * (1 - vel))) * 0.3) } inst ohat { s = hp(noise(), 6800) + sin(ph * tau * 2.4) * exp(-t * 30) * 0.10 out(s * exp(-t * (11 + 20 * (1 - vel))) * 0.24) } inst bas { e = env(0.004, 0.10, 0.55, 0.05) s = bsqr(ph, 0.5, freq) * 0.75 + bsaw(ph, freq) * 0.4 s = lp(s, 340 + 2300 * e * e) out(dist(s, 1.2) * e * 0.56) } inst stab nna=continue { e = env(0.006, 0.075, 0.40, 0.11) g = 0 repeat k 3 { fk = 1.0 if (k == 1) { fk = pow(2, (3 + p0) / 12) } if (k == 2) { fk = 1.4983 } g = g + bsaw(ph * fk + 0.02 * k, freq * fk) + bsaw(ph * 1.004 * fk, freq * 0.997 * fk) * 0.45 } s = svf(g * 0.72, 470 + 5400 * e, 0.34) out(dist(s, 1.24) * e * 0.33) } inst choir nna=continue { vc = 1 + 0.005 * sin(t * 4.7) * min(1, t * 1.6) $cp = $cp + freq * vc / sr s = saw($cp) + saw($cp * 1.007) * 0.7 + saw($cp * 0.501) * 0.45 a1 = svf(s, 610 + 150 * sin(t * 0.43), 0.55) a1 = r2 a2 = svf(s, 1180 + 210 * sin(t * 0.31), 0.55) a2 = r2 a3 = svf(s, 2450, 0.62) a3 = r2 e = env(0.25, 0.45, 0.85, 0.65) out((a1 + a2 * 0.6 + a3 * 0.22) * e * 0.42) } inst lead nna=continue { vc = 1 + 0.006 * sin(t * 6.4) * min(1, t * 4) $ld = $ld + freq * vc / sr e = env(0.008, 0.20, 0.66, 0.26) s = bsqr($ld, 0.42, freq) + bsaw($ld * 1.002, freq) * 0.6 + sin($ld * tau * 2.001) * 0.13 s = svf(s, 850 + 5200 * e, 0.28) out(dist(s, 1.15) * e * 0.31) } inst crash { out(hp(noise(), 4200) * exp(-t * 2.3) * vel * 0.3 + hp(noise(), 1600) * exp(-t * 1.5) * vel * 0.12) } inst riser { ris = min(t / 1.85, 1) out(hp(noise(), 350 + 5300 * ris * ris) * ris * ris * 0.26) } chan 5 { w = verb(x, 0.88, 0.4) out(x * 0.7 + w * 0.55) } chan 6 { d = dly(x, 0.375, 0.42) w = verb(x, 0.8, 0.5) out(x * 0.85 + d * 0.3 + w * 0.12) } master { w = verb(l * 0.55 + r * 0.55, 0.8, 0.5) out(dist(l + w * 0.16, 1.12), dist(r + w * 0.16, 1.12)) } # 1 kick 2 clap 3 hat 4 ohat 5 bas 6 stab 7 choir 8 lead 9 crash 10 riser # P0 intro Dm pattern 0 rows=16 { . | . | . | . | D-4 6 20 S00 | D-3 7 2A S00 | . | C-4 9 30 . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | D-4 6 16 S00 | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | D-4 6 18 S00 | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | D-4 6 18 S00 | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 28 | . | . | . | . | . . | . | C-3 3 24 | . | . | . | . | . } # P1 groove Dm pattern 1 rows=16 { C-2 1 3A | . | . | D-2 5 34 | D-4 6 24 S00 | . | . | . . | . | C-3 3 24 | D-3 5 2E | . | . | . | . C-2 1 38 | C-3 2 30 | C-3 3 20 | D-2 5 34 | . | . | . | . . | . | C-3 3 24 | D-3 5 2E | D-4 6 1C S00 | . | . | . C-2 1 38 | . | C-3 3 20 | D-2 5 34 | . | . | . | . . | . | C-3 3 28 | D-3 5 2E | . | . | . | . C-2 1 36 | C-3 2 30 | C-3 3 20 | D-2 5 34 | . | . | . | . . | . | C-3 3 28 | D-3 5 2E | . | . | . | . } # P2 groove Bb (choir + stabs full) pattern 2 rows=16 { C-2 1 3A | . | . | A#0 5 34 | A#3 6 2A SFF | A#2 7 2A SFF | . | . . | . | C-3 3 24 | A#2 5 2E | . | . | . | . C-2 1 38 | C-3 2 30 | C-3 3 20 | A#0 5 34 | . | . | . | . . | . | C-3 3 24 | A#2 5 2E | A#3 6 1C SFF | . | . | . C-2 1 38 | . | C-3 3 20 | A#0 5 34 | . | . | . | . . | . | C-3 3 28 | A#2 5 2E | . | . | . | . C-2 1 36 | C-3 2 30 | C-3 3 20 | A#0 5 34 | . | . | . | . . | . | C-3 3 28 | F-2 5 2E | . | . | . | . } # P3 chorus F (lead hook 1) pattern 3 rows=16 { C-2 1 3A | . | . | F-2 5 34 | F-4 6 2A SFF | F-3 7 2A SFF | D-5 8 30 | . . | . | C-3 3 24 | F-3 5 2E | . | . | F-5 8 2C | . C-2 1 38 | C-3 2 30 | C-3 3 20 | F-2 5 34 | . | . | A-5 8 2C | . . | . | C-3 3 24 | F-3 5 2E | F-4 6 1C SFF | . | G-5 8 2C | . C-2 1 38 | . | C-3 3 20 | F-2 5 34 | . | . | F-5 8 2C | . . | . | C-3 3 28 | F-3 5 2E | . | . | D-5 8 2C | . C-2 1 36 | C-3 2 30 | C-3 3 20 | F-2 5 34 | . | . | C-5 8 2C | . . | . | C-3 3 28 | F-3 5 2E | F-4 6 22 SFF | . | D-5 8 2C | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 28 | . | . | . | . | . . | . | C-3 3 24 | . | . | . | . | . } # P4 chorus C (lead hook 2) pattern 4 rows=16 { C-2 1 3A | . | . | C-2 5 34 | C-4 6 2A SFF | C-3 7 2A SFF | A-5 8 30 | . . | . | C-3 3 24 | C-3 5 2E | . | . | F-5 8 2C | . C-2 1 38 | C-3 2 30 | C-3 3 20 | C-2 5 34 | . | . | D-5 8 2C | . . | . | C-3 3 24 | C-3 5 2E | C-4 6 1C SFF | . | C-5 8 2C | . C-2 1 38 | . | C-3 3 20 | C-2 5 34 | . | . | A-4 8 2C | . . | . | C-3 3 28 | C-3 5 2E | . | . | C-5 8 2C | . C-2 1 36 | C-3 2 30 | C-3 3 20 | C-2 5 34 | . | . | D-5 8 2C | . . | . | A-3 4 28 | C-3 5 2E | C-4 6 22 SFF | . | F-5 8 2C | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 28 | . | . | . | . | . . | . | C-3 3 24 | . | . | . | . | . } # P5 Dm full (reprise + finale bar) pattern 5 rows=16 { C-2 1 3C | . | . | D-2 5 36 | D-4 6 2E S00 | D-3 7 2C S00 | D-6 8 28 | . . | . | C-3 3 24 | D-3 5 30 | . | . | A-5 8 2A | . C-2 1 3C | C-3 2 32 | C-3 3 20 | D-2 5 36 | . | . | F-5 8 2A | . . | . | C-3 3 24 | D-3 5 30 | D-4 6 1A S00 | . | D-5 8 2A | . C-2 1 3C | . | C-3 3 20 | D-2 5 36 | . | . | A-5 8 2A | . . | . | C-3 3 28 | D-3 5 30 | D-4 6 20 S00 | . | F-5 8 2A | . C-2 1 3A | C-3 2 32 | C-3 3 20 | D-2 5 36 | . | . | D-5 8 2A | . . | . | A-3 4 28 | D-3 5 30 | D-4 6 2A S00 | . | A-5 8 2A | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 1C | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 28 | . | . | . | . | . . | . | C-3 3 24 | . | . | . | . | . } # P6 break Dm (calm) pattern 6 rows=16 { C-2 1 35 | . | . | D-2 5 28 | D-4 6 2C S00 | D-3 7 28 S00 | . | C-4 9 24 . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | C-3 2 1A | C-3 3 1C | D-2 5 20 | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | D-4 6 22 S00 | . | . | . . | . | C-3 3 1E | . | . | . | . | . } # P7 break Dm (kick + riser + clap roll) pattern 7 rows=16 { . | . | . | D-2 5 24 | D-4 6 28 S00 | D-3 7 24 S00 | . | C-4 10 30 . | . | . | . | . | . | . | . C-2 1 34 | . | . | . | . | . | . | . . | . | . | . | . | . | . | . C-2 1 34 | . | . | . | . | . | . | . . | . | . | . | . | . | . | . C-2 1 34 | . | . | . | . | . | . | . . | C-3 2 0A | . | . | . | . | . | . C-2 1 32 | C-3 2 0E | . | D-2 5 20 | . | . | . | . . | C-3 2 12 | . | . | . | . | . | . . | C-3 2 16 | . | . | . | . | . | . . | C-3 2 1C | . | . | . | . | . | . C-2 1 30 | C-3 2 22 | . | . | . | . | . | . . | C-3 2 26 | . | . | . | . | . | . . | C-3 2 2C | . | . | . | . | . | . . | C-3 2 32 | . | off 5 20 | . | . | . | . } # P8 outro Dm (final chord rings) pattern 8 rows=16 { C-2 1 3A | . | . | D-2 5 30 | D-4 6 30 S00 | D-3 7 30 S00 | . | C-4 9 2C . | . | C-3 3 20 | D-3 5 2C | . | . | . | . C-2 1 30 | C-3 2 26 | C-3 3 18 | D-2 5 2C | . | . | . | . . | . | C-3 3 18 | D-3 5 2A | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | D-3 5 24 | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 18 | . | . | . | . | . . | . | C-3 3 14 | . | . | . | . | . . | . | C-3 3 14 | . | . | . | . | . . | . | C-3 3 10 | . | . | . | . | . . | . | C-3 3 0C | . | . | . | . | . . | . | C-3 3 0C | . | . | . | . | . . | . | C-3 3 08 | . | off 6 20 | off 7 20 | . | . . | . | . | off 5 14 | off 6 14 | off 7 14 | . | . } # ------------------------------------------------------------------ visuals uniform kickE clpE hatE stbE ldE glow scn cut tA hA hB hC zc fn textline(px, s, pp, py, sz) { n = strlen(s) cx = (px - pp) / sz cy = (py - v) / sz aq = floor(cx) gm = glyph(str(s, aq), fract(cx), fract(cy)) return gm * step(0, cx) * step(cx, n) * step(0, cy) * step(cy, 1) } fn scroller(px, s, py, sz, speed) { per = (strlen(s) + 14) * sz p0 = 1.7 * aspect - fract(time * speed / per) * per a1 = textline(px, s, p0, py, sz) b1 = textline(px, s, p0 + per, py, sz) return max(a1, b1) } fn segd(px, py, ax, ay, bx, by) { gx = bx - ax gy = by - ay dd = gx * gx + gy * gy + 0.000001 tq = clamp(((px - ax) * gx + (py - ay) * gy) / dd, 0, 1) return len(px - (ax + gx * tq), py - (ay + gy * tq)) } fn figure(px, py, cxx, cyy, sk, pha) { qx = (px - cxx) / sk qy = (py - cyy) / sk d1 = len(qx, qy - 0.62) - 0.09 d2 = segd(qx, qy, 0, 0.26, 0, 0.50) - 0.075 d3 = segd(qx, qy, -0.06, 0.47, -0.27, 0.58 + 0.20 * sin(pha)) - 0.045 d4 = segd(qx, qy, 0.06, 0.47, 0.27, 0.58 - 0.20 * sin(pha)) - 0.045 d5 = segd(qx, qy, -0.035, 0.24, -0.085 + 0.07 * sin(pha), 0.0) - 0.05 d6 = segd(qx, qy, 0.035, 0.24, 0.085 - 0.07 * sin(pha), 0.0) - 0.05 m1 = min(d1, d2) m1 = min(m1, d3) m1 = min(m1, d4) m1 = min(m1, d5) m1 = min(m1, d6) return m1 * sk } fn drawDancer(px, py, cxx, cyy, sk, pha, intens) { qx = (px - cxx) / sk qy = (py - cyy) / sk d1 = len(qx, qy - 0.62) - 0.09 d2 = segd(qx, qy, 0, 0.26, 0, 0.50) - 0.075 d3 = segd(qx, qy, -0.06, 0.47, -0.27, 0.58 + 0.20 * sin(pha)) - 0.045 d4 = segd(qx, qy, 0.06, 0.47, 0.27, 0.58 - 0.20 * sin(pha)) - 0.045 d5 = segd(qx, qy, -0.035, 0.24, -0.085 + 0.07 * sin(pha), 0.0) - 0.05 d6 = segd(qx, qy, 0.035, 0.24, 0.085 - 0.07 * sin(pha), 0.0) - 0.05 m1 = min(d1, d2) m1 = min(m1, d3) m1 = min(m1, d4) m1 = min(m1, d5) m1 = min(m1, d6) m1 = m1 * sk fillr = smooth(0.006, -0.006, m1) cxg = floor(qx * 8) cyg = floor(qy * 12) chk = fract((cxg + cyg) * 0.5) chk = step(0.5, chk) hot = 0.55 + 0.45 * glow colr = mix(0.98, 0.05, chk) * hot colg = mix(0.10, 0.88, chk) * hot colb = mix(0.60, 0.95, chk) * hot cmul(1 - 0.90 * fillr * intens) cadd(fillr * colr * intens, fillr * colg * intens, fillr * colb * intens) rim = fillr * (1 - fillr) * 4 cadd(rim * 0.20 * intens, rim * 0.85 * intens, rim * 0.40 * intens) rw = rim * step(0, px - cxx) * intens cadd(rw * 0.95, rw * 0.55, rw * 0.15) } fn beams(px, py, bxx, byy, ity) { pa = atan2(px - bxx, byy - py) dw = step(0.0, byy - py) repeat k 8 { aM = (k - 3.5) * 0.36 + 0.25 * sin(time * 0.31 + k * 1.97) wd = 0.045 + 0.020 * hash(k * 13.3) dp2 = abs(pa - aM) wdge = 1 - smooth(wd, wd * 1.6, dp2) core = pow(max(0, 1 - dp2 / wd), 2) fl = 0.35 + 0.65 * hash(k * 7.7 + floor(time * 5.5)) am = ity * dw * fl * 0.32 * (0.25 + 0.75 * min(1, kickE + 0.55 * clpE)) g1 = wdge * 0.20 + core * 0.80 cik = k % 4 r1c = 1.0 g1c = 1.0 b1c = 1.0 if (cik == 0) { r1c = 1.0; g1c = 0.15; b1c = 0.65 } if (cik == 1) { r1c = 0.00; g1c = 0.85; b1c = 1.0 } if (cik == 2) { r1c = 1.0; g1c = 0.85; b1c = 0.10 } cadd(g1 * am * r1c, g1 * am * g1c, g1 * am * b1c) } } fn orb(px, py, bxx, byy, rr, spin, uty) { dx = (px - bxx) / rr dy = (py - byy) / rr rd = len(dx, dy) insm = 1 - smooth(0.985, 1.005, rd) if (insm > 0.01) { nz = sqrt(max(1 - min(rd, 0.9995) ^ 2, 0.0004)) theta = atan2(nz, dx) / tau + spin phi = atan2(dy, nz) / pi + 0.5 f1 = fract(theta * 20) f2 = fract(phi * 14) fi = floor(theta * 20) fj = floor(phi * 14) cost = cos(theta * tau) sint = sin(theta * tau) sinp = sin(phi * pi) nx = cost * sinp ny = sinp nz2 = sint * sinp l1 = max(0, nx * 0.45 + ny * 0.75 + nz2 * 0.25) l2 = max(0, -nx * 0.40 + ny * 0.60 + nz2 * 0.30) l3 = max(0, nx * 0.20 - ny * 0.50 + nz2 * 0.70) spec = pow(l1, 7) * 0.18 + pow(l2, 12) * 0.09 + pow(l3, 18) * 0.05 edge = smooth(0.05, 0.12, min(f1, 1 - f1)) * smooth(0.05, 0.12, min(f2, 1 - f2)) base = 0.018 + 0.22 * l1 panel = base * mix(0.35, 1.0, edge) fh = hash(fi * 37.0 + fj * 11.0) pr = panel pg = panel pb = panel if (fh > 0.80) { pr = panel * 1.0; pg = panel * 0.25; pb = panel * 0.70 } if (fh < 0.18) { pr = panel * 0.10; pg = panel * 0.75; pb = panel * 1.0 } if (fh > 0.35 && fh < 0.50) { pr = panel * 1.0; pg = panel * 0.85; pb = panel * 0.15 } kk = insm * uty cadd(kk * pr + spec * kk, kk * pg + spec * kk * 0.9, kk * pb + spec * kk * 0.8) } halo = exp(-(rd - 1) * 12) * step(1, rd) * 0.06 * uty cadd(halo, halo * 0.95, halo * 1.0) } frame { kickE = exp(-trig(0) * 11) * step(0.3, vel(0)) clpE = exp(-trig(1) * 14) hatE = exp(-trig(2) * 42) stbE = exp(-trig(4) * 7) ldE = exp(-trig(6) * 4) glow = evtl(glEL) scn = evt(scEL) pv = $scns $scns = scn cut = step(0.5, abs(scn - pv)) tA = evtl(tAEL) hA = evtl(hAEL) hB = evtl(hBEL) hC = evtl(hCEL) zc = 1.0 select(scn) } # scene 0: title + mirror ball pixel open { rgb(0, 0, 0) beams(u, v, 0, 0.42, 0.55) orb(u, v, 0, 0.42, 0.42, time * 0.3, 0.70) ttc = textline(u, ttl, -1.42, 0.28, 0.18) * tA cadd(ttc * 1.1, ttc * 0.95, ttc * 0.55) n2 = strlen(crd) crc = textline(u, crd, -n2 * 0.0275, -0.18, 0.055) cadd(crc * 0.7, crc * 0.75, crc * 0.8) sc = scroller(u, scl, -0.72, 0.070, 1.2) cadd(sc * 0.70, sc * 0.92, sc * 0.82) } # scene 1: perspective disco hall pixel hall { rgb(0, 0, 0) camY = 0.55 ceilY = 1.45 roomW = 3.6 farZ = 6.0 tf = 1000 if (v < 0) { tf = camY / (-v + 0.0001) } tc = 1000 if (v > 0) { tc = (ceilY - camY) / (v + 0.0001) } tb = farZ ts = 1000 au = abs(u) if (au > 0.0001) { ts = (roomW * 0.5) / au } # floor if (tf < tc && tf < tb && tf < ts) { xw = u * tf zw = tf tile = 1.0 ix = floor(xw / tile) iz = floor(zw / tile) ck = step(0.5, fract((ix + iz) * 0.5)) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grout = smooth(0.0, 0.10, gr) c1r = 0.48 c1g = 0.03 c1b = 0.32 c2r = 0.00 c2g = 0.42 c2b = 0.50 tr = mix(c1r, c2r, ck) * grout tg = mix(c1g, c2g, ck) * grout tb2 = mix(c1b, c2b, ck) * grout pulse = step(0.90, hash(ix * 13.1 + iz * 7.7)) * (0.5 + 0.5 * sin(beat * 3.14 + ix + iz)) * 0.18 tr = tr + pulse tg = tg + pulse * 0.2 tb2 = tb2 + pulse * 0.4 rgb(tr, tg, tb2) } # ceiling grid if (tc < tf && tc < tb && tc < ts) { xw = u * tc zw = tc tile = 0.9 ix = floor(xw / tile) iz = floor(zw / tile) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grid = exp(-pow(gr * 22, 2)) lit = 0.35 + 0.65 * (0.5 + 0.5 * sin(beat * 3.14 + ix * 2.0 + iz * 1.5)) rgb(grid * 0.14 * lit, grid * 0.11 * lit, grid * 0.18 * lit) } # back wall if (tb < tf && tb < tc && tb < ts) { xw = u * tb yw = camY - v * tb sx = floor(xw * 0.7) sy = floor(yw * 2.5) fh = hash(sx * 13.1 + sy * 7.7 + floor(beat) * 3.1) lit = (0.35 + 0.65 * (0.5 + 0.5 * sin(beat * 3.14 + sx * 2.1 + sy))) * step(0.45, fh) ci = floor(fh * 3) if (ci == 0) { rgb(lit * 0.95, lit * 0.08, lit * 0.55) } if (ci == 1) { rgb(lit * 0.05, lit * 0.78, lit * 0.95) } if (ci == 2) { rgb(lit * 0.95, lit * 0.85, lit * 0.10) } } # side walls if (ts < tf && ts < tc && ts < tb) { zw = ts yw = camY - v * ts sx = floor(ts * 0.8) sy = floor(yw * 3.0) fh = hash(sx * 17.3 + sy * 11.7 + floor(beat) * 2.3) lit = (0.30 + 0.70 * (0.5 + 0.5 * sin(beat * 3.14 + sx * 1.5 + sy))) * step(0.50, fh) ci = floor(fh * 3) if (ci == 0) { rgb(lit * 0.90, lit * 0.10, lit * 0.50) } if (ci == 1) { rgb(lit * 0.05, lit * 0.70, lit * 0.95) } if (ci == 2) { rgb(lit * 0.95, lit * 0.78, lit * 0.10) } } # perspective columns repeat k 5 { zc = 1.2 + k * 1.0 - fract(time * 0.25) * 1.0 if (zc > 0.2) { vt = (ceilY - camY) / zc vb = -camY / zc rw = 0.17 / zc uc = (-roomW * 0.5 + 0.28) / zc ds = segd(u, v, uc, vt, uc, vb) - rw if (ds < 0.01) { hh = (v - vt) / (vb - vt + 0.0001) qx = (u - uc) / rw qy = hh ck = step(0.5, fract((floor(qx * 3) + floor(qy * 8)) * 0.5)) band = 1 - smooth(0.10, 0.25, abs(fract(qy * 8) - 0.5)) lit = (0.08 + 0.45 * band) * (0.5 + 0.5 * sin(beat * 3.14 + k)) * exp(-zc * 0.10) tr = mix(0.95, 0.00, ck) tg = mix(0.05, 0.85, ck) tb2 = mix(0.65, 0.95, ck) cadd(lit * tr, lit * tg, lit * tb2) } uc = (roomW * 0.5 - 0.28) / zc ds = segd(u, v, uc, vt, uc, vb) - rw if (ds < 0.01) { hh = (v - vt) / (vb - vt + 0.0001) qx = (u - uc) / rw qy = hh ck = step(0.5, fract((floor(qx * 3) + floor(qy * 8)) * 0.5)) band = 1 - smooth(0.10, 0.25, abs(fract(qy * 8) - 0.5)) lit = (0.15 + 0.85 * band) * (0.5 + 0.5 * sin(beat * 3.14 + k + 1.0)) * exp(-zc * 0.08) tr = mix(0.95, 0.00, ck) tg = mix(0.05, 0.85, ck) tb2 = mix(0.65, 0.95, ck) cadd(lit * tr, lit * tg, lit * tb2) } } } # mirror ball and beams orb(u, v, 0, 0.55, 0.22, time * 0.4, 0.55) beams(u, v, 0, 0.55, 0.55) # dancer reflection dx0 = 0.25 * sin(time * 0.8) pha = fract(beat) * tau if (v < 0) { rf = exp(v * 5.0) drawDancer(u, -v, dx0, -0.52, 0.85, pha, 0.35 * rf) } drawDancer(u, v, dx0, -0.52, 0.85, pha, 0.85) # scroller sc = scroller(u, scl, -0.85, 0.070, 1.2) cadd(sc * 0.70, sc * 0.92, sc * 0.82) # caption n1 = strlen(capA) cpa = textline(u, capA, -n1 * 0.070, 0.38, 0.14) * hA cadd(cpa * (0.9 + 0.35 * stbE), cpa * 0.55, cpa * 0.75) } # scene 2: chrome ring / vinyl with dancer inside pixel ring { rgb(0, 0, 0) camY = 0.6 if (v < 0) { td = camY / (-v + 0.0001) xw = u * td zw = td tile = 0.8 ix = floor(xw / tile) iz = floor(zw / tile) ck = step(0.5, fract((ix + iz) * 0.5)) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grout = smooth(0.0, 0.10, gr) c1r = 0.48 c1g = 0.03 c1b = 0.32 c2r = 0.00 c2g = 0.42 c2b = 0.50 tr = mix(c1r, c2r, ck) * grout tg = mix(c1g, c2g, ck) * grout tb2 = mix(c1b, c2b, ck) * grout pulse = step(0.90, hash(ix * 13.1 + iz * 7.7)) * (0.5 + 0.5 * sin(beat * 3.14 + ix + iz)) * 0.12 rgb(tr + pulse, tg + pulse * 0.2, tb2 + pulse * 0.4) } cy = -0.05 R = 0.55 th = 0.06 dx = u dy = v - cy r = len(dx, dy) dr = abs(r - R) - th a = atan2(dy, dx) if (dr < 0.02) { env = 0.14 + 0.32 * pow(0.5 + 0.5 * sin(a * 16 - time * 0.8), 2) grv = 0.5 + 0.5 * sin(r * 120 + a * 3) spec = pow(max(0, cos(a - 0.6) * 0.5 + 0.5), 4) * 0.35 metal = env + grv * 0.06 + spec cadd(metal * 0.75, metal * 0.68, metal * 0.76) } if (r < R - th) { rgb(0.006, 0.003, 0.010) } beams(u, v, 0, cy + 0.55, 0.7) fl = exp(-pow((v - cy - 0.55) * 10, 2)) * exp(-abs(u) * 2.5) * 0.2 * (0.5 + 0.7 * clpE) cadd(fl, fl * 0.9, fl * 0.6) dx0 = 0.03 * sin(time * 1.0) pha = fract(beat) * tau if (v < 0) { rf = exp(v * 5.0) drawDancer(u, -v, dx0, -0.45, 0.55, pha, 0.4 * rf) } drawDancer(u, v, dx0, -0.45, 0.55, pha, 1.0) sc = scroller(u, scl, -0.78, 0.075, 1.3) cadd(sc * 0.70, sc * 0.92, sc * 0.82) } # scene 3: close-up mirror ball pixel ball { rgb(0, 0, 0) beams(u, v, 0, 0.50, 0.55) orb(u, v, 0, 0.50, 0.55, time * 0.35, 0.70) if (v < -0.50) { dep = -0.50 - v wx = u * (2.5 + 8.0 * dep) fx = fract(wx) line = exp(-pow(min(fx, 1 - fx) * 14, 2)) * exp(-dep * 1.2) lpus = 0.5 + 0.5 * sin(beat * 3.14 + floor(wx)) rgb(line * 0.35 * (0.4 + 0.6 * lpus), line * 0.08, line * 0.12) } beams(u, -v, 0, 0.50, 0.25 * exp(v * 2.0) * step(-0.5, v)) } # scene 4: chrome stage + scrolling text pixel text { rgb(0, 0, 0) if (v < 0) { td = 0.5 / (-v + 0.0001) xw = u * td zw = td tile = 0.8 ix = floor(xw / tile) iz = floor(zw / tile) ck = step(0.5, fract((ix + iz) * 0.5)) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grout = smooth(0.0, 0.10, gr) tr = mix(0.95, 0.00, ck) * grout tg = mix(0.05, 0.85, ck) * grout tb2 = mix(0.65, 0.95, ck) * grout rgb(tr, tg, tb2) } cy = 0.20 R = 0.70 th = 0.04 dx = u dy = v - cy r = len(dx, dy) dr = abs(r - R) - th a = atan2(dy, dx) if (dr < 0.015 && v > cy - R) { env = 0.14 + 0.32 * pow(0.5 + 0.5 * sin(a * 16 - time * 0.4), 2) spec = pow(max(0, cos(a - 0.5) * 0.5 + 0.5), 4) * 0.35 metal = env + spec cadd(metal * 0.72, metal * 0.64, metal * 0.74) } sc = scroller(u, scl, -0.50, 0.11, 1.6) cadd(sc * 0.9, sc * 0.95, sc) n1 = strlen(capA) cpa = textline(u, capA, -n1 * 0.075, 0.25, 0.15) * hA cadd(cpa * (1.0 + 0.5 * stbE), cpa * 0.70, cpa * 0.90) fl = exp(-pow((v - 0.55) * 10, 2)) * exp(-abs(u - 0.35) * 3.0) * 0.18 cadd(fl, fl * 0.8, fl * 0.5) fl = exp(-pow((v - 0.55) * 10, 2)) * exp(-abs(u + 0.35) * 3.0) * 0.18 cadd(fl, fl * 0.8, fl * 0.5) } # scene 5: neon city skyline pixel city { rgb(0, 0, 0) # sky gradient sky = (v + 1) * 0.08 rr0 = mix(0.001, 0.012, sky) gg0 = mix(0.000, 0.005, sky) bb0 = mix(0.004, 0.018, sky) rgb(rr0, gg0, bb0) # street grid hz = -0.05 if (v < hz) { dep = hz - v wx = u * (2.0 + 7.0 * dep) fx = fract(wx) line = exp(-pow(min(fx, 1 - fx) * 20, 2)) * exp(-dep * 1.6) rgb(line * 0.35, line * 0.05, line * 0.20) } # buildings across the width cw = 0.32 un = (u + aspect + 0.5) / cw ui = floor(un) uu = fract(un) hgt = 0.05 + 0.60 * pow(hash(ui * 13.71 + 3.1), 1.3) insd = step(v, hgt - 0.02) * step(0.03, uu) * step(uu, 0.97) * step(-0.12, v) if (insd > 0.5) { rgb(0.01, 0.005, 0.015) wy = hgt - v wr = floor(wy * 22) wq = fract(wy * 22) wcol = floor(un * 5.5) if (wr > 0 && wr < 20 && wq > 0.35 && wq < 0.75) { widy = ui * 97.3 + wcol * 13.1 + wr * 7.9 lq = hash(widy + floor(beat * 0.5) * 11.3) if (lq > 0.55) { lt = (0.12 + 0.35 * (0.5 + 0.5 * sin(beat * 3.14 + widy * 0.31))) * (0.20 + 0.80 * step(0.78, lq)) cw2 = hash(widy * 3.77) if (cw2 > 0.66) { cadd(lt * 1.0, lt * 0.25, lt * 0.55) } else { if (cw2 > 0.33) { cadd(lt * 0.10, lt * 0.65, lt * 1.0) } else { cadd(lt * 0.95, lt * 0.75, lt * 0.15) } } } } } # rooftop neon if (abs(v - hgt) < 0.005 && uu > 0.05 && uu < 0.95 && v > -0.1) { nse = 0.5 + 0.5 * sin(beat * 6.28 + ui * 1.7) cik = ui % 3 if (cik == 0) { cadd(0.9 * nse, 0.15 * nse, 0.55 * nse) } if (cik == 1) { cadd(0.10 * nse, 0.70 * nse, 0.95 * nse) } if (cik == 2) { cadd(0.95 * nse, 0.80 * nse, 0.15 * nse) } } # street reflections of neon if (v < hz) { dep = hz - v fd = exp(-dep * 2.0) cxx = (ui + 0.5) * cw - aspect - 0.5 dx2 = abs(u - cxx) ww = 0.04 + dep * 0.12 sb = exp(-pow(dx2 / ww, 2)) * step(0.4, hash(ui * 9.17 + 2.2)) * (0.5 + 0.5 * sin(beat * 3.14 + ui * 1.3)) * fd * 0.20 cik2 = ui % 3 if (cik2 == 0) { cadd(sb * 0.9, sb * 0.25, sb * 0.55) } if (cik2 == 1) { cadd(sb * 0.10, sb * 0.60, sb * 0.95) } if (cik2 == 2) { cadd(sb * 0.95, sb * 0.68, sb * 0.15) } } # moon glow fz = exp(-pow((u + 0.6) * 3.0, 2) - pow((v - 0.55) * 4.0, 2)) * 0.30 cadd(fz * 0.9, fz * 0.7, fz * 0.85) # caption n3 = strlen(capC) cpc = textline(u, capC, -n3 * 0.070, 0.30, 0.14) * hC cadd(cpc * (0.85 + 0.50 * clpE), cpc * 0.65, cpc * 0.85) } # scene 6: bright finale wide pixel finale { u2 = u / zc v2 = v / zc rgb(0, 0, 0) camY = 0.55 ceilY = 1.45 roomW = 3.6 farZ = 6.0 tf = 1000 if (v2 < 0) { tf = camY / (-v2 + 0.0001) } tc = 1000 if (v2 > 0) { tc = (ceilY - camY) / (v2 + 0.0001) } tb = farZ ts = 1000 au = abs(u2) if (au > 0.0001) { ts = (roomW * 0.5) / au } if (tf < tc && tf < tb && tf < ts) { xw = u2 * tf zw = tf tile = 1.0 ix = floor(xw / tile) iz = floor(zw / tile) ck = step(0.5, fract((ix + iz) * 0.5)) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grout = smooth(0.0, 0.10, gr) c1r = 0.48 c1g = 0.03 c1b = 0.32 c2r = 0.00 c2g = 0.42 c2b = 0.50 tr = mix(c1r, c2r, ck) * grout tg = mix(c1g, c2g, ck) * grout tb2 = mix(c1b, c2b, ck) * grout pulse = step(0.88, hash(ix * 13.1 + iz * 7.7)) * (0.5 + 0.5 * sin(beat * 3.14 + ix + iz)) * 0.30 rgb(tr + pulse, tg + pulse * 0.2, tb2 + pulse * 0.4) } if (tc < tf && tc < tb && tc < ts) { xw = u2 * tc zw = tc tile = 0.9 ix = floor(xw / tile) iz = floor(zw / tile) fx = fract(xw) fz = fract(zw) gr = min(min(fx, 1 - fx), min(fz, 1 - fz)) grid = exp(-pow(gr * 22, 2)) lit = 0.40 + 0.60 * (0.5 + 0.5 * sin(beat * 3.14 + ix * 2.0 + iz * 1.5)) rgb(grid * 0.22 * lit, grid * 0.18 * lit, grid * 0.28 * lit) } if (tb < tf && tb < tc && tb < ts) { xw = u2 * tb yw = camY - v2 * tb sx = floor(xw * 0.7) sy = floor(yw * 2.5) fh = hash(sx * 13.1 + sy * 7.7 + floor(beat) * 3.1) lit = (0.40 + 0.60 * (0.5 + 0.5 * sin(beat * 3.14 + sx * 2.1 + sy))) * step(0.40, fh) ci = floor(fh * 3) if (ci == 0) { rgb(lit * 0.95, lit * 0.08, lit * 0.55) } if (ci == 1) { rgb(lit * 0.05, lit * 0.78, lit * 0.95) } if (ci == 2) { rgb(lit * 0.95, lit * 0.85, lit * 0.10) } } if (ts < tf && ts < tc && ts < tb) { zw = ts yw = camY - v2 * ts sx = floor(ts * 0.8) sy = floor(yw * 3.0) fh = hash(sx * 17.3 + sy * 11.7 + floor(beat) * 2.3) lit = (0.35 + 0.65 * (0.5 + 0.5 * sin(beat * 3.14 + sx * 1.5 + sy))) * step(0.45, fh) ci = floor(fh * 3) if (ci == 0) { rgb(lit * 0.90, lit * 0.10, lit * 0.50) } if (ci == 1) { rgb(lit * 0.05, lit * 0.70, lit * 0.95) } if (ci == 2) { rgb(lit * 0.95, lit * 0.78, lit * 0.10) } } repeat k 5 { zc = 1.2 + k * 1.0 - fract(time * 0.25) * 1.0 if (zc > 0.2) { vt = (ceilY - camY) / zc vb = -camY / zc rw = 0.17 / zc uc = (-roomW * 0.5 + 0.28) / zc ds = segd(u2, v2, uc, vt, uc, vb) - rw if (ds < 0.01) { hh = (v2 - vt) / (vb - vt + 0.0001) qx = (u2 - uc) / rw qy = hh ck = step(0.5, fract((floor(qx * 3) + floor(qy * 8)) * 0.5)) band = 1 - smooth(0.10, 0.25, abs(fract(qy * 8) - 0.5)) lit = (0.10 + 0.50 * band) * (0.5 + 0.5 * sin(beat * 3.14 + k)) * exp(-zc * 0.10) tr = mix(0.95, 0.00, ck) tg = mix(0.05, 0.85, ck) tb2 = mix(0.65, 0.95, ck) cadd(lit * tr, lit * tg, lit * tb2) } uc = (roomW * 0.5 - 0.28) / zc ds = segd(u2, v2, uc, vt, uc, vb) - rw if (ds < 0.01) { hh = (v2 - vt) / (vb - vt + 0.0001) qx = (u2 - uc) / rw qy = hh ck = step(0.5, fract((floor(qx * 3) + floor(qy * 8)) * 0.5)) band = 1 - smooth(0.10, 0.25, abs(fract(qy * 8) - 0.5)) lit = (0.10 + 0.50 * band) * (0.5 + 0.5 * sin(beat * 3.14 + k + 1.0)) * exp(-zc * 0.10) tr = mix(0.95, 0.00, ck) tg = mix(0.05, 0.85, ck) tb2 = mix(0.65, 0.95, ck) cadd(lit * tr, lit * tg, lit * tb2) } } } orb(u2, v2, 0, 0.60, 0.28, time * 0.45, 0.70) beams(u2, v2, 0, 0.60, 0.50) dx0 = 0.35 * sin(time * 0.9) pha = fract(beat) * tau if (v2 < 0) { rf = exp(v2 * 5.0) drawDancer(u2, -v2, dx0, -0.50, 0.75, pha, 0.35 * rf) } drawDancer(u2, v2, dx0, -0.50, 0.75, pha, 0.85) repeat k 16 { cxx = -1.1 * aspect + hash(k * 3.1) * 2.2 * aspect + 0.08 * sin(time + k) cyy = 1.2 - fract(hash(k * 7.7) + time * (0.05 + 0.035 * hash(k * 1.3))) * 2.4 szz = 0.014 + 0.012 * hash(k * 5.3) dx3 = abs(u2 - cxx) dy3 = abs(v2 - cyy) sq = (1 - smooth(szz * 0.6, szz, dx3)) * (1 - smooth(szz * 0.7, szz * 1.15, dy3)) kk2 = sq * 0.25 cik3 = k % 3 if (cik3 == 0) { cadd(kk2, kk2 * 0.3, kk2 * 0.7) } if (cik3 == 1) { cadd(kk2 * 0.25, kk2 * 0.7, kk2) } if (cik3 == 2) { cadd(kk2, kk2 * 0.75, kk2 * 0.25) } } ttf = textline(u2, ttl, -1.65, 0.32, 0.22) * tA cadd(ttf * 1.25, ttf * 1.05, ttf * 0.65) nA = strlen(capA) ta1 = textline(u2, capA, -nA * 0.080, 0.40, 0.16) * hA cadd(ta1, ta1 * 0.8, ta1 * 0.4) nB = strlen(capB) tb1 = textline(u2, capB, -nB * 0.080, 0.40, 0.16) * hB cadd(tb1, tb1 * 0.8, tb1 * 0.4) nC2 = strlen(capC) tc2 = textline(u2, capC, -nC2 * 0.080, 0.40, 0.16) * hC cadd(tc2, tc2 * 0.8, tc2 * 0.4) sc = scroller(u2, scl, -0.90, 0.070, 1.6) cadd(sc * 0.70, sc * 0.92, sc * 0.82) } post { g1 = tap(0, 0) ga = r1 gb = r2 # bloom off rsh = tap(-1 - floor(kickE), 0) rr = mix(g1, rsh, 0.08) rgb(rr, ga, gb) du = (hash(x * w * 0.37 + y * h * 0.71 + frame * 7.3) - 0.5) * 0.03 cadd(du, du * 0.85, du * 0.7) d2 = len(u, v) cmul(max(0.65, 1 - 0.30 * d2 * d2)) cmul(1 - 0.04 * step(0.5, fract(y * h * 0.5))) cadd(cut * 0.04, cut * 0.03, cut * 0.03) }