# @description A room at 3am: Venetian blinds, rain on the glass, a figure waiting under a streetlight, one cigarette burning down. Twelve bars, no cuts. # @tags cinematic # @model DeepSeek V4.1 Flash # @collection Written by the models # @music 3 a.m. noir: felt kick, brushed snare, laid-back sampled ride, upright bass, FM Rhodes, muted trumpet through dotted delay and reverb, rain room-tone, vinyl ticks and tape hiss # @visual one continuous interior shot: venetian-blind bars crawl across the wall and wet floor, a rain-streaked window onto a neon skyline, a fedora silhouette under the streetlight from ~16 s, smoke lit only where it crosses the light; gate weave, bloom, chromatic fringing and grain in post # @duration 36 # nocturne.dmt - a room at 3am. Venetian blinds, rain on the glass, a figure waiting # under a streetlight, one cigarette burning down. 80 bpm, twelve bars, no cuts. title NOCTURNE song bpm=80 speed=6 rpb=4 channels=7 loop=0 volume=0.68 order 0 1 2 3 4 5 6 7 8 9 10 11 pan 0.50 0.42 0.58 0.50 0.36 0.64 0.50 # ------------------------------------------------------------------ samples sample ride "assets/ride.wav" # ------------------------------------------------------------------ instruments inst kick { f = 44 + 200 * exp(-t * 20) $p = $p + f / sr body = sin($p * tau) * exp(-t * 4.4) sub = sin($p * tau * 0.5) * exp(-t * 3.0) * 0.45 tap = lp(noise(), 1100) * exp(-t * 110) * 0.30 out(dist((body + sub) * 1.5 + tap, 1.15) * 0.54) } inst brush { # brushed snare: soft noise swish with a little skin tone e = env(0.028, 0.20, 0.0, 0.30) n = svf(noise(), 1700 + 1400 * vel, 0.35) s = n * 0.7 + r2 * 0.6 body = sin(tau * 196 * t) * exp(-t * 26) * 0.25 out((s + body) * e * 0.78) } inst ride { e = env(0.002, 0.55, 0.0, 0.30) s = lp(smp(ride, t * (1.0 - 0.05 * (1 - vel))), 6500) out(s * e * (0.35 + 0.65 * vel) * 0.52) } inst bass { # upright: plucked sine body, woody click, a little finger noise e = env(0.006, 0.42, 0.52, 0.28) b = sin(ph * tau) + sin(ph * tau * 2.004) * 0.30 + sin(ph * tau * 3.01) * 0.09 click = lp(noise(), 640) * exp(-t * 75) * 0.55 s = svf(b * 0.8, 150 + 620 * e + 260 * p0, 0.28) out(dist((s + click * 0.30) * e, 1.12) * 0.50) } inst rhodes nna=continue { e = env(0.005, 1.30, 0.28, 1.10) idx = 1.5 * exp(-t * 2.4) + 0.20 m = sin(ph * tau * 2.0) * idx s = sin(ph * tau + m) + sin(ph * tau * 3.005) * 0.10 trem = 0.86 + 0.14 * sin(t * 5.1 + 0.4) out(s * e * trem * 0.23) } inst trumpet nna=continue { # harmon-muted: narrow buzzy source through a resonant peak, breath on top e = env(0.055, 0.30, 0.74, 0.55) vib = 1 + 0.0055 * sin(t * 5.4 + 0.7) * smooth(0.10, 0.55, t) f = freq * vib buzz = bsaw(ph, freq) * 0.55 + bsqr(ph, 0.42, freq) * 0.22 breath = lp(noise(), 2300) * 0.055 s = svf(buzz + breath, 620 + 1500 * e + 500 * p0, 0.58) s = s + r2 * 0.55 out(hp(s, 210) * e * 0.60) } inst rain { # the room tone: rain on glass, gusts, a wet hiss that never leaves e = env(2.2, 3.0, 0.86, 7.0) n = noise() hi = hp(n, 1900) * 0.55 lo = lp(n, 420) * 0.55 g = 0.68 + 0.24 * sin(t * 0.21) + 0.12 * sin(t * 0.57 + 1.3) out((hi + lo) * e * g * 0.28) } # ------------------------------------------------------------------ channel fx chan 3 { # rhodes: short room v = verb(x, 0.80, 0.55) out(x + v * 0.42) } chan 4 { # trumpet: dotted-eighth echo into a long hall d = dly(x, 0.5625, 0.30) v = verb(x, 0.86, 0.42) out(x + d * 0.30 + v * 0.55) } # ------------------------------------------------------------------ master master { dl = dly(l, 0.8438, 0.28) dr = dly(r, 0.8438, 0.28) vl = verb(l + dr * 0.14, 0.84, 0.48) vr = verb(r + dl * 0.14, 0.84, 0.48) # vinyl ticks and a little tape hiss tks = step(0.99935, hash(floor(t * 9000))) * (hash(floor(t * 9000) + 3.1) - 0.2) * 0.55 hiss = hp(noise(), 5200) * 0.012 ol = hp(l + dl * 0.16 + vl * 0.20 + tks + hiss, 32) or = hp(r + dr * 0.16 + vr * 0.20 + tks * 0.8 + hiss, 32) out(dist(ol * 1.10, 1.25), dist(or * 1.10, 1.25)) } # ------------------------------------------------------------------ patterns # 16 rows = one bar = 3 s at 80 bpm. Seven channels: # 0 kick | 1 brush/ride | 2 bass | 3 rhodes | 4 trumpet | 5 rain | 6 spare # bars: 0 Dm 1 Dm 2 Bb 3 Gm 4 A7 5 Dm 6 Dm 7 Bb 8 Gm 9 A7 10 Dm 11 Dm pattern 0 rows=16 { ... . .. ... | ... . .. ... | D-2 4 22 ... | D-3 5 14 ... | ... . .. ... | F-2 7 34 ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | A-3 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 10 ... | ... . .. ... | ... . .. ... | A-4 6 0E ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 1 rows=16 { ... . .. ... | ... . .. ... | D-2 4 20 ... | D-4 5 14 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0A ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 14 ... | ... . .. ... | F-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | F-2 4 1C ... | A-4 5 10 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0A ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 18 ... | A-1 4 18 ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 2 rows=16 { C-4 1 1E ... | ... . .. ... | Bb1 4 22 ... | Bb3 5 14 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0C ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 18 ... | ... . .. ... | D-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0A ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1A ... | ... . .. ... | F-2 4 1C ... | F-4 5 10 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0C ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 1C ... | D-2 4 1A ... | ... . .. ... | F-4 6 14 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0A ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 3 rows=16 { C-4 1 20 ... | ... . .. ... | G-1 4 22 ... | G-3 5 14 ... | D-5 6 18 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1A ... | ... . .. ... | Bb3 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1C ... | ... . .. ... | D-2 4 1C ... | D-4 5 10 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1E ... | Bb1 4 18 ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 4 rows=16 { C-4 1 22 ... | ... . .. ... | A-1 4 24 ... | A-3 5 14 ... | C#5 6 1A ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0E ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1C ... | ... . .. ... | C#4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1E ... | ... . .. ... | C#2 4 1E ... | E-4 5 10 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0E ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1E ... | E-2 4 1A ... | G-4 5 0E ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 5 rows=16 { C-4 1 22 ... | ... . .. ... | D-2 4 22 ... | D-4 5 14 ... | A-4 6 16 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1A ... | ... . .. ... | F-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1E ... | ... . .. ... | A-1 4 1A ... | A-4 5 10 ... | D-5 6 1A ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1E ... | D-2 4 1C ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 6 rows=16 { C-4 1 22 ... | ... . .. ... | D-2 4 22 ... | D-4 5 14 ... | D-5 6 1A ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1A ... | ... . .. ... | F-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1E ... | ... . .. ... | F-2 4 1C ... | A-4 5 10 ... | C-5 6 16 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1E ... | A-1 4 18 ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 7 rows=16 { C-4 1 22 ... | ... . .. ... | Bb1 4 22 ... | Bb3 5 14 ... | Bb4 6 18 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 14 ... | C-4 2 1A ... | ... . .. ... | D-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1E ... | ... . .. ... | F-2 4 1C ... | F-4 5 10 ... | D-5 6 1A ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0D ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 16 ... | C-4 2 20 ... | D-2 4 1A ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0B ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 8 rows=16 { C-4 1 24 ... | ... . .. ... | G-1 4 22 ... | G-3 5 14 ... | F-5 6 1C ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0E ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1A ... | C-4 2 1E ... | ... . .. ... | Bb3 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0C ED1 | D-2 4 1A ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 20 ... | ... . .. ... | Bb1 4 1C ... | D-4 5 10 ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0E ED1 | ... . .. ... | ... . .. ... | D-5 6 18 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1A ... | C-4 2 20 ... | D-2 4 1A ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0C ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 9 rows=16 { C-4 1 26 ... | ... . .. ... | A-1 4 24 ... | A-3 5 14 ... | E-5 6 1E ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0F ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1E ... | C-4 2 22 ... | ... . .. ... | C#4 5 0F ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 16 ... | C-4 3 0C ED1 | C#2 4 1C ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 22 ... | ... . .. ... | E-2 4 1E ... | E-4 5 10 ... | C#5 6 1C ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0F ED1 | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1C ... | C-4 2 24 ... | G-2 4 1A ... | G-4 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 3 0C ED1 | ... . .. ... | ... . .. ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 14 ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 10 rows=16 { C-4 1 20 ... | ... . .. ... | D-2 4 20 ... | D-4 5 12 ... | D-5 6 1A ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | C-4 2 16 ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... C-4 1 1A ... | ... . .. ... | A-1 4 18 ... | F-4 5 0E ... | off 6 00 ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } pattern 11 rows=16 { ... . .. ... | ... . .. ... | D-2 4 1E ... | D-3 5 12 ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | F-3 5 0D ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | A-3 5 0E ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... | ... . .. ... } # ------------------------------------------------------------------ visuals # Everything is one pixel program: a wall, a rain-streaked window, a floor, # blind shadows and a plume of smoke, lit by whatever the song is doing. uniform barShift lit sweepX sweepA figF figX neonA openA smokeA ember kickE brushE trumE glow fn sdbox(px, py, bx, by) { dx = abs(px) - bx dy = abs(py) - by return len(max(dx, 0), max(dy, 0)) + min(max(dx, dy), 0) } fn slit(coord, soft) { f = fract(coord) a = smooth(0.36 - soft, 0.36 + soft, f) b = 1 - smooth(0.90 - soft, 0.90 + soft, f) return a * b } fn ellip(px, py, rx, ry) { return (len(px / rx, py / ry) - 1) * min(rx, ry) } fn sdseg(px, py, ax, ay, bx, by) { pax = px - ax pay = py - ay bax = bx - ax bay = by - ay kk = clamp((pax * bax + pay * bay) / (bax * bax + bay * bay + 0.000001), 0, 1) return len(pax - bax * kk, pay - bay * kk) } fn smin(a, b, k) { hh = clamp(0.5 + 0.5 * (b - a) / k, 0, 1) return mix(b, a, hh) - k * hh * (1 - hh) } frame { tt = time # the room comes up slowly, then dies at the end lit = 0.30 + 0.80 * smooth(1.5, 12.0, tt) lit = lit * (1 - 0.80 * smooth(31.4, 35.8, tt)) # blinds: open through the middle, closing on the last bar openA = 0.52 + 0.48 * smooth(2.5, 12.5, tt) openA = openA * (1 - 0.86 * smooth(30.8, 35.2, tt)) # slow crawl of the shadow bars, plus a car passing once barShift = tt * 0.085 + 0.34 * sin(tt * 0.105) + 0.02 * sin(tt * 1.3) sweepP = clamp((tt - 12.2) / 2.4, 0, 1) sweepX = mix(-2.4, 3.4, sweepP) sweepA = exp(-0.5 * pow((tt - 13.4) * 0.95, 2)) * 0.85 # the waiting figure: arrives 16s, gone by 32s figF = smooth(15.4, 18.6, tt) * (1 - smooth(29.6, 32.2, tt)) figX = 0.618 + 0.010 * sin(tt * 0.33) - 0.06 * smooth(30.0, 32.0, tt) # neon outside: flickers, surges at the climax neonA = 0.72 + 0.28 * hash(floor(tt * 9.0)) neonA = neonA * (1 - 0.75 * step(0.93, hash(floor(tt * 1.63) + 4.0))) neonA = neonA * (0.85 + 0.45 * smooth(22.0, 27.0, tt)) smokeA = 0.55 + 0.55 * smooth(3.0, 10.0, tt) kickE = exp(-trig(0) * 7.0) brushE = exp(-trig(1) * 8.0) * step(0.30, vel(1)) trumE = exp(-trig(4) * 1.6) ember = 0.40 + 0.60 * (0.5 + 0.5 * sin(tt * 1.55)) + 0.35 * kickE glow = 0.9 + 0.1 * brushE } pixel { # ---------------- room geometry (straight-on camera, a little 2.5D) wx0 = -1.44 wx1 = -0.14 wy0 = -0.34 wy1 = 0.94 vh = -0.36 wcx = (wx0 + wx1) * 0.5 wcy = (wy0 + wy1) * 0.5 whw = (wx1 - wx0) * 0.5 whh = (wy1 - wy0) * 0.5 dxw = sdbox(u - wcx, v - wcy, whw, whh) inwin = 1 - smooth(-0.003, 0.003, dxw) # ---------------- blind shadows bending away from the window qx = u + 0.40 bcoord = (v - 0.155 * qx - 0.048 * sin(u * 1.5) - 0.020 * qx * qx) * 6.8 + barShift ddist = len((u - wcx) * 0.78, (v - 0.24) * 1.00) bsoft = 0.0035 + 0.011 * ddist bm = slit(bcoord, bsoft) bmw = slit(bcoord + 0.02, 0.045 + 0.05 * ddist) hot = exp(-ddist * 1.30) decay = exp(-max(0.0, u - wx1) * 1.14 - max(0.0, wy0 - v) * 0.55) bgate = smooth(0.06, 0.44, openA) barl = bm * decay * lit * bgate * (0.42 + 0.92 * hot) bglow = bmw * decay * lit * bgate * 0.10 # ---------------- wall wn = fbm(u * 3.0 + 11.0, v * 3.0 + 3.0, 2) wf = hash(floor(u * 190.0) + floor(v * 190.0) * 17.0) wallv = 0.006 + 0.015 * wn + 0.004 * wf wallv = wallv * (0.80 + 0.30 * smooth(-0.6, 1.0, v)) wr = wallv * 1.16 + barl * 0.96 + bglow * 0.55 wg = wallv * 1.00 + barl * 0.62 + bglow * 0.25 wb = wallv * 0.92 + barl * 0.20 + bglow * 0.07 # a bruise of neon bleeding around the glass wgl = exp(-max(0.0, dxw) * 6.5) * (0.10 + 0.13 * neonA) wr = wr + wgl * 0.55 wg = wg + wgl * 0.16 wb = wb + wgl * 0.42 # a car's headlights sweep the room, cut by the same slats sw = exp(-pow((u - sweepX) * 2.3, 2)) * sweepA * (0.18 + 0.82 * bm) wr = wr + sw * 0.72 wg = wg + sw * 0.44 wb = wb + sw * 0.18 # a coat on a hook, waiting by the door cx0 = 1.14 cdd = sdbox(u - cx0, v - 0.00, 0.112 + 0.030 * smooth(0.16, -0.28, v), 0.280) cdd = smin(cdd, ellip(u - cx0, (v - 0.292) * 2.6, 0.150, 0.085), 0.035) cdd = smin(cdd, sdbox(u - cx0, v - 0.352, 0.062, 0.038), 0.025) cdd = min(cdd, sdbox(u - cx0 + 0.044, v - 0.448, 0.008, 0.052)) cmask = 1 - smooth(-0.004, 0.004, cdd) cedge = 1 / (1 + abs(cdd) * 115.0) fold = exp(-abs(u - cx0 - 0.012) * 80.0) * cmask wr = mix(wr, 0.004 + 0.012 * wn, cmask * 0.92) wg = mix(wg, 0.005 + 0.010 * wn, cmask * 0.92) wb = mix(wb, 0.008 + 0.012 * wn, cmask * 0.92) wr = wr + cedge * 0.40 * (0.20 + barl) wg = wg + cedge * 0.22 * (0.18 + barl) wb = wb + cedge * 0.09 * (0.18 + barl) wr = wr - fold * 0.010 # ---------------- floor: boards, wet sheen, light lying across it fd = vh - v + 0.020 fl = 1 - smooth(vh - 0.002, vh + 0.002, v) zz = 0.52 / fd fx = u * zz * 1.10 fz = zz seam1 = exp(-abs(fract(fx * 0.62) - 0.5) * 26.0) * exp(-fd * 3.2) seam2 = exp(-abs(fract(fz * 0.34) - 0.5) * 30.0) * exp(-fd * 2.6) grain = fbm(fx * 3.2, fz * 4.0, 1) fbase = 0.006 + 0.020 * grain + 0.014 * seam1 + 0.010 * seam2 refl = exp(-fd * 4.6) # wet reflection of the signs: three coloured columns with vertical streaks rfx = exp(-abs(u + 1.02) * 3.2) rfy = exp(-abs(u + 0.34) * 3.6) rfz = exp(-abs(u + 0.02) * 3.0) strk = 0.5 + 0.5 * sin(u * 41.0 + sin(v * 8.0 + time * 0.37) * 2.2) wsm = refl * (0.22 + 0.48 * strk) fbc = fz * 0.62 + fx * 0.10 + barShift * 0.30 fbar = slit(fbc, 0.020 + 0.030 * fd) * exp(-fd * 2.2) * lit * smooth(0.02, 0.18, fd) * (0.30 + 0.70 * exp(-max(0.0, u - wx1) * 0.9)) fr = fbase * 1.20 + fbar * 0.52 + wsm * (rfx * 1.15 + rfy * 0.08 + rfz * 0.14) * neonA fg = fbase * 1.00 + fbar * 0.30 + wsm * (rfx * 0.20 + rfy * 0.42 + rfz * 0.21) * neonA fb = fbase * 1.15 + fbar * 0.12 + wsm * (rfx * 0.62 + rfy * 1.05 + rfz * 0.26) * neonA fr = fr + refl * 0.010 + exp(-abs(u + 0.72) * 1.1) * refl * 0.16 * neonA fg = fg + refl * 0.008 + exp(-abs(u + 0.72) * 1.1) * refl * 0.05 * neonA fb = fb + refl * 0.016 + exp(-abs(u + 0.72) * 1.1) * refl * 0.14 * neonA r = mix(wr, fr, fl) g = mix(wg, fg, fl) b = mix(wb, fb, fl) # ---------------- outside the glass ox = (u - wx0) / (wx1 - wx0) oy = (v - wy0) / (wy1 - wy0) gw = fbm(ox * 4.0 + time * 0.055, oy * 4.0 - time * 0.030, 2) oxd = ox + (gw - 0.5) * 0.030 + 0.0035 * sin(oy * 47.0 + time * 2.3) oyd = oy + (gw - 0.5) * 0.010 # far buildings, lit windows, hard roof lines bs = floor(oxd * 5.0) bh = 0.36 + 0.34 * hash(bs * 3.17 + 5.0) sky = 1 - step(oyd, bh) bgu = fract(oxd * 48.0) bgv = fract(oyd * 24.0) bw = step(0.30, bgu) * step(bgu, 0.66) * step(0.26, bgv) * step(bgv, 0.62) blit = step(0.70, hash(floor(oxd * 48.0) * 1.7 + floor(oyd * 24.0) * 3.1 + bs * 7.0)) bwin = bw * blit * (1 - sky) # sky: deep indigo, a hot magenta bruise at the roofline hz = exp(-abs(oyd - 0.36) * 8.0) skyr = 0.028 + 0.055 * oyd + 0.12 * hz * neonA skyg = 0.034 + 0.050 * oyd + 0.035 * hz * neonA skyb = 0.090 + 0.100 * oyd + 0.10 * hz bldr = 0.010 + 0.005 * hash(bs) orr = mix(skyr, bldr, 1 - sky) + bwin * 0.95 * (0.55 + 0.45 * neonA) org = mix(skyg, bldr * 1.1, 1 - sky) + bwin * 0.58 * (0.55 + 0.45 * neonA) orb = mix(skyb, bldr * 1.5, 1 - sky) + bwin * 0.30 * (0.55 + 0.45 * neonA) # magenta sign, tall and left of the lamp s1 = sdbox(oxd - 0.205, oyd - 0.705, 0.056, 0.120) s1r = 1 / (1 + abs(s1) * 42.0) s1f = (1 - smooth(-0.004, 0.004, s1)) * 0.16 s1g = 0.55 / (1 + max(0.0, s1) * 5.0) # cyan sign, low and right s2 = sdbox(oxd - 0.855, oyd - 0.560, 0.036, 0.145) s2r = 1 / (1 + abs(s2) * 42.0) s2f = (1 - smooth(-0.004, 0.004, s2)) * 0.14 s2g = 0.50 / (1 + max(0.0, s2) * 6.0) orr = orr + (s1r * 1.55 + s1f + s1g) * neonA + (s2r * 0.16 + s2f * 0.10 + s2g * 0.55) * neonA org = org + (s1r * 0.34 + s1f * 0.12 + s1g * 0.16) * neonA + (s2r * 1.20 + s2f * 0.70 + s2g * 0.85) * neonA orb = orb + (s1r * 1.20 + s1f * 0.55 + s1g * 0.75) * neonA + (s2r * 1.55 + s2f * 0.90 + s2g * 1.00) * neonA # streetlight, the thing they are standing under lampx = oxd - 0.628 lampy = oyd - 0.452 lampd = len(lampx, lampy * 0.8) lampc = exp(-lampd * lampd * 5200.0) lampg = exp(-lampd * 3.2) * 1.25 pole = (1 - smooth(0.0025, 0.0045, abs(lampx))) * step(oyd, 0.420) orr = orr + lampc * 2.30 + lampg * 1.05 + pole * 0.020 org = org + lampc * 1.60 + lampg * 0.62 + pole * 0.016 orb = orb + lampc * 0.85 + lampg * 0.24 + pole * 0.012 # street below the roofline: wet asphalt catching everything str = 1 - step(oyd, 0.190) srf = exp(-abs(oyd - 0.190) * 20.0) orr = mix(orr, 0.020 + srf * 0.55 * neonA, str * 0.82) org = mix(org, 0.022 + srf * 0.18 * neonA, str * 0.82) orb = mix(orb, 0.034 + srf * 0.45, str * 0.82) # rain outside: fast diagonal streaks orr = orr + exp(-abs(oxd - 0.628) * 3.0) * exp(-abs(oyd - 0.190) * 12.0) * 0.25 org = org + exp(-abs(oxd - 0.628) * 3.0) * exp(-abs(oyd - 0.190) * 12.0) * 0.13 orb = orb + exp(-abs(oxd - 0.628) * 3.0) * exp(-abs(oyd - 0.190) * 12.0) * 0.05 rr1 = fract((oyd + oxd * 0.30) * 24.0 - time * 1.5) rstr = exp(-rr1 * 16.0) * step(0.84, hash(floor(oxd * 190.0) + floor(oy * 3.0) * 3.0)) orr = orr + rstr * 0.16 org = org + rstr * 0.18 orb = orb + rstr * 0.26 # ---------------- the figure behind the blinds fpx = ox - figX fpy = oy - 0.055 dh = len(fpx, fpy - 0.398) - 0.045 brx = rot(fpx, fpy - 0.452, 0.10) bry = r1 dbr = ellip(brx, bry * 5.2, 0.112, 0.076) dcr = sdbox(fpx, fpy - 0.505, 0.053, 0.036) dnk = sdbox(fpx, fpy - 0.344, 0.024, 0.050) dshl = sdseg(fpx, fpy, 0.0, 0.310, -0.104, 0.248) dshr = sdseg(fpx, fpy, 0.0, 0.310, 0.104, 0.248) dsh = min(dshl, dshr) - 0.030 dtr = sdseg(fpx + 0.016 * (fpy - 0.17) * 2.0, fpy, 0.0, 0.286, 0.0, 0.020) - 0.082 dco = sdbox(fpx + 0.026 * (fpy + 0.05) * 1.4, fpy + 0.010, 0.106, 0.092) dfg = smin(dh, dcr, 0.012) dfg = min(dfg, dbr) dfg = smin(dfg, dnk, 0.020) dfg = smin(dfg, dsh, 0.038) dfg = smin(dfg, dtr, 0.040) dfg = smin(dfg, dco, 0.050) figm = (1 - smooth(-0.005, 0.010, dfg)) * figF rim = exp(-abs(dfg) * 150.0) * figF orr = orr * (1 - 0.965 * figm) + rim * 0.34 org = org * (1 - 0.965 * figm) + rim * 0.20 orb = orb * (1 - 0.965 * figm) + rim * 0.10 # ---------------- blinds in front of everything outside bsc = oy * 9.0 + 0.018 * sin(ox * 6.0) + time * 0.016 bf = fract(bsc) g0 = 0.50 - 0.44 * openA g1 = 0.50 + 0.44 * openA ga = smooth(g0 - 0.004, g0 + 0.004, bf) gb = 1 - smooth(g1 - 0.004, g1 + 0.004, bf) gapm = ga * gb slatlit = exp(-abs(bf - g0) * 85.0) * 0.9 + exp(-abs(bf - g1) * 85.0) * 0.30 slr = 0.007 + slatlit * (0.20 + 0.34 * neonA) slg = 0.008 + slatlit * (0.09 + 0.20 * neonA) slb = 0.012 + slatlit * (0.14 + 0.40 * neonA) # wet glass: beads and a haze that slides down bqx = fract(ox * 36.0 + 0.015 * sin(time * 0.31)) bqy = fract(oy * 46.0 - time * 0.11) bq = len(bqx - 0.5, bqy - 0.5) bead = exp(-bq * bq * 30.0) * step(0.66, hash(floor(ox * 36.0) * 3.1 + floor(oy * 46.0) * 7.3)) glz = 0.92 + bead * 0.34 wr2 = mix(slr, orr * glz * gapm, 1.0) wg2 = mix(slg, org * glz * gapm, 1.0) wb2 = mix(slb, orb * glz * gapm, 1.0) # mullion mul = 1 - smooth(0.013, 0.019, abs(ox - 0.505)) wr2 = mix(wr2, 0.006, mul) wg2 = mix(wg2, 0.007, mul) wb2 = mix(wb2, 0.010, mul) # faint reflection of the room on the glass wgl2 = exp(-len(ox - 0.34, oy - 0.56) * 3.0) * 0.035 wr2 = wr2 + wgl2 wg2 = wg2 + wgl2 * 0.8 wb2 = wb2 + wgl2 * 0.7 r = mix(r, wr2, inwin) g = mix(g, wg2, inwin) b = mix(b, wb2, inwin) # window frame: dark timber with a lit edge band = step(0.0, dxw) * (1 - smooth(0.046, 0.054, dxw)) fedge = 1 / (1 + abs(dxw - 0.048) * 85.0) frr = 0.010 + 0.014 * wn + fedge * (0.09 + 0.45 * barl) frg = 0.008 + 0.011 * wn + fedge * (0.05 + 0.22 * barl) frb = 0.010 + 0.012 * wn + fedge * (0.04 + 0.09 * barl) r = mix(r, frr, band) g = mix(g, frg, band) b = mix(b, frb, band) # skirting board where the wall meets the floor sk = step(vh + 0.006, v) * (1 - smooth(vh + 0.040, vh + 0.046, v)) sklit = 1 / (1 + abs(v - (vh + 0.045)) * 220.0) r = mix(r, 0.008 + sklit * 0.16 * (0.4 + barl) + barl * 0.10, sk) g = mix(g, 0.007 + sklit * 0.09 * (0.4 + barl) + barl * 0.05, sk) b = mix(b, 0.009 + sklit * 0.03 * (0.4 + barl) + barl * 0.02, sk) # sill under the window, catching the bar light sil = (1 - smooth(whw + 0.008, whw + 0.030, abs(u - wcx))) * step(wy0 - 0.075, v) * step(v, wy0 - 0.022) r = mix(r, 0.016 + barl * 0.75, sil) g = mix(g, 0.012 + barl * 0.40, sil) b = mix(b, 0.011 + barl * 0.14, sil) # ---------------- smoke off a cigarette in the dark corner rise = max(0.0, v + 0.80) spine = 1.16 + 0.075 * sin(rise * 2.2 + time * 0.28) + 0.045 * sin(rise * 5.3 - time * 0.44) spx = (u - spine) / (0.030 + 0.52 * rise) sm1 = fbm(spx * 1.9 + time * 0.10, rise * 2.3 - time * 0.22, 2) sm2 = 0.5 + 0.5 * sin(spx * 9.0 - time * 1.1 + rise * 7.0) dens = smooth(0.40, 0.74, sm1 * 0.80 + sm2 * 0.20) dens = dens * exp(-spx * spx * 1.15) * smooth(0.0, 0.10, rise) * smokeA dens = dens * (1 - smooth(0.75, 1.35, rise)) smlit = 0.05 + barl * 2.6 + bglow * 0.35 r = r + dens * smlit * 1.35 g = g + dens * smlit * 0.82 b = b + dens * smlit * 0.38 # dust hanging in the shafts mfn = hash(floor(u * 130.0) + floor(v * 130.0) * 31.0) mote = step(0.9972, mfn) * (0.45 + 0.55 * sin(time * 1.7 + u * 37.0 + v * 21.0)) mglow = mote * (0.02 + barl * 1.7 + bglow * 0.3) r = r + mglow * 0.95 g = g + mglow * 0.60 b = b + mglow * 0.30 # the ember itself ed = len(u - 1.16, v + 0.80) ec = exp(-ed * ed * 2600.0) eg = exp(-ed * 20.0) * 0.30 r = r + ec * ember * 2.0 + eg * ember * 0.55 g = g + ec * ember * 0.66 + eg * ember * 0.16 b = b + ec * ember * 0.20 + eg * ember * 0.05 # ---------------- grade vg = len(u * 0.86, v * 0.92) cm = (1 - 0.40 * vg * vg) * glow rgb(r * cm, g * cm, b * cm) cadd(0.0012, 0.0010, 0.0032) } post { # film: gate weave, bloom, halation, chromatic fringing, grain wx = floor(0.7 * sin(time * 0.83) + 0.5) wy = floor(0.5 * sin(time * 0.61 + 2.0) + 0.5) cr = tap(wx, wy) cg = r1 cb = r2 br = 0 bg = 0 bb = 0 s0 = tap(wx - 2, wy) br = br + s0 bg = bg + r1 bb = bb + r2 s0 = tap(wx + 2, wy) br = br + s0 bg = bg + r1 bb = bb + r2 s0 = tap(wx, wy - 2) br = br + s0 bg = bg + r1 bb = bb + r2 s0 = tap(wx, wy + 2) br = br + s0 bg = bg + r1 bb = bb + r2 s0 = tap(wx - 4, wy - 4) br = br + s0 * 0.6 bg = bg + r1 * 0.6 bb = bb + r2 * 0.6 s0 = tap(wx + 4, wy + 4) br = br + s0 * 0.6 bg = bg + r1 * 0.6 bb = bb + r2 * 0.6 s0 = tap(wx + 7, wy) br = br + s0 * 0.5 bg = bg + r1 * 0.5 bb = bb + r2 * 0.5 s0 = tap(wx, wy - 7) br = br + s0 * 0.5 bg = bg + r1 * 0.5 bb = bb + r2 * 0.5 br = br * 0.0875 bg = bg * 0.0875 bb = bb * 0.0875 # chromatic fringing, only on the snare/brush hits fg = 0.55 * brushE ar = tap(wx - 1 - floor(3.0 * brushE), wy) ab = tap(wx + 1 + floor(3.0 * brushE), wy + 1) r = cr + br * 0.46 + (ar - cr) * fg g = cg + bg * 0.44 b = cb + bb * 0.46 + (ab - cb) * fg # warm highlights, cool shadows r = r * 1.035 + 0.0035 g = g * 1.000 + 0.0030 b = b * 0.955 + 0.0085 d = len(u, v) r = r * (1 - 0.32 * d * d) g = g * (1 - 0.32 * d * d) b = b * (1 - 0.28 * d * d) # grain and gate flicker gr = (hash(x * w * 0.41 + y * h * 0.73 + frame * 13.7) - 0.5) * 0.028 r = r + gr g = g + gr * 0.85 b = b + gr * 0.75 + (hash(x * w * 0.19 + y * h * 0.37 + frame * 5.3) - 0.5) * 0.012 rgb(max(r, 0.0), max(g, 0.0), max(b, 0.0)) }