Communitygithub.com

pixel-music-film

End-to-end director and code-rendering workflow for turning lyrics plus an original song audio file into a full-length 16:9 1080p60 HD-2D cinematic pixel-art music micro-film MP4 with anti-homogenization 7-archetype narrative storytelling, 5-dimension multi-camera blocking, flexible golden-first-seconds hooks, genre-adaptive multi-act color grading, high-density 3-plane set dressing, 100% non-repeating shots, AE-style camera choreography, and syllable-accurate A/V sync + organic Foley SFX. Use this skill whenever the user sends lyrics and/or an audio track asking to create, script, direct, or render a pixel-art music video or music micro-film.

What is pixel-music-film?

pixel-music-film is a Gemini CLI agent skill that end-to-end director and code-rendering workflow for turning lyrics plus an original song audio file into a full-length 16:9 1080p60 HD-2D cinematic pixel-art music micro-film MP4 with anti-homogenization 7-archetype narrative storytelling, 5-dimension multi-camera blocking, flexible golden-first-seconds hooks, genre-adaptive multi-act color grading, high-density 3-plane set dressing, 100% non-repeating shots, AE-style camera choreography, and syllable-accurate A/V sync + organic Foley SFX. Use this skill whenever the user sends lyrics and/or an audio track asking to create, script, direct, or render a pixel-art music video or music micro-film.

Works with~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/sipengc143-byte/pixel-music-film-skill/tree/HEAD/skills/pixel-music-film

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Pixel-Art Music Micro-Film Studio (pixel-music-film)

This skill turns lyrics + an original audio file into a broadcast-grade 1920×1080 (16:9) · 60fps · HD-2D Cinematic Pixel-Art Music Micro-Film MP4 (rendered purely in code on macOS via C++/Objective-C++ + Apple Metal GPU + CoreGraphics + AVFoundation, zero external image/video assets required).


Core Production Standards (9 Non-Negotiable Pillars)

  1. Anti-Homogenization Narrative & Subtext Externalization (Zero Literal Cliché Loops):
    • Never fall into the "literal illustration trap" (showing someone staring at rain just because lyrics mention rain, or recycling the generic "bedroom -> window -> train -> beach" loop across songs). Every song must select one of the 7 Anti-Homogenization Film Narrative Architectures below based on its lyrics and musical genre, driven by a concrete event spine and the 4 Screenwriting Laws (Three-Chorus Escalation, Living Prop Physical Arc, Bridge Dramatic Vacuum/Twist, and Bookend Mirror Symmetry).
  2. 5-Dimension Multi-Camera Narrative & Spatial Blocking (Zero Flat Stage Framing):
    • Never film an entire scene from a single flat front/side master shot. Dissect dramatic moments using the 5 Multi-Camera Narrative Modes: ① 4-Angle Spatial Coverage (90° Top-Down Bird's-Eye + Over-The-Shoulder A/B Shot-Reverse-Shot + Extreme Macro Insert), ② Dynamic Multi-Cam Split-Screen (2–4 simultaneous beat-synced camera viewports in one frame), ③ Diegetic Media Cameras (CCTV Security Cam, MiniDV/Polaroid Viewfinder, Rearview Mirror / Puddle Reflection Cam), ④ Multi-Protagonist Eye-Level POV Switching (180cm human vs. 160cm tear-blurred human vs. 20cm floor-level pet/plush POV), and ⑤ 3-Cam High-Speed Action Relay (Launch Cam -> Projectile Tracker Cam -> Target Impact Cam).
  3. Golden First Seconds Hook (Flexible Song-Adaptive Opening):
    • Never start with a slow, empty black fade-in. The first 3–15 seconds must immediately hook the eye and ear using one (or a 2-part combo) of the 6 Golden-Opening Hook Archetypes below, selected dynamically by the song's BPM, intro instrumentation, and mood.
  4. Genre-Adaptive Multi-Act Color Grading:
    • Never lock every film into the same color palette. Select from the 8 Cinema Color Grading Archetypes below based on the musical genre, and evolve the palette across 3–4 distinct emotional color arcs within the song (e.g., Golden Summer -> Desaturated Rainy Slate -> Pitch-Black Silence -> Terracotta Dawn).
  5. High-Density 3-Plane Set Dressing (Zero Bare Backgrounds):
    • Every shot must have Foreground (60fps bokeh/vines/frames/dust motes/OTS shoulder silhouettes) + Midground (characters + rich architectural props: framed art, clocks, lamps, shelves, clutter, live instruments) + Background (multi-layer parallax skyline/clouds/trains/water reflections). Never render bare single-color walls or empty rooms.
  6. Rich Motion Design & 14 Pixel Transitions:
    • Drive every shot with AE-style exponential overshoot camera choreography (landPunch = exp(-localT * 9.5)), beat-synced micro-zoom pulses, subtle 2–4px optical chromatic aberration on beat peaks (chromaOffset = 0.0015..0.0035 in normalized UV), kinetic multi-layer animations, and 14 rotating dual-canvas pixel transitions (BayerDissolve, LightLeakFlash, WhipPanLeft/Right, IrisBox, FilmBurn, ClockWipe, VenetianBlinds, SplitHorizontal, DropCurtain, ZoomBurst, GlitchSlice, ShutterSnap, SpiralWipe).
  7. 100% Unique Shots Across the Full Song (Zero Visual Repetition):
    • Maintain a high shot count (70–90+ cuts for a 3–5 min song, averaging 2.5–4s per cut). Even when lyrics repeat (e.g., Chorus 1 / Chorus 2 / Final Double Chorus), never reuse the same scene function or backdrop—escalate every chorus to a brand-new location, time of day, and camera scale.
  8. Deep Character Acting & Physical Micro-Details:
    • Characters must feature 12fps stepped breathing, natural blinking, wind-blown hair/scarves/skirts, expressive interaction (head-tilt laughter, play-tossing props, rain-soaked hair, trembling shoulders, tearing letters), and physical wear on recurring story props (e.g., tear stains, frayed stitches, aging photos).
  9. Sample-Accurate BPM & Syllable-Level A/V Sync:
    • Never guess BPM or assume vocal lines are uniformly 1 bar per line. Measure the exact BPM via low-band kick autocorrelation AND slice/inspect vocal segments to lock every lyric subtitle, scene cut, and Foley cue to ±0.05s of the singer's actual vocal delivery.

Workflow Overview

Execute the pipeline in 5 strict phases. Never jump straight to full-length MP4 rendering without completing audio timing calibration, narrative architecture & multi-cam blocking design, and visual keyframe QA.

Phase 1: Audio Intake, True BPM & Syllable-Level Timing Audit

  1. Locate the audio file:
    • If the user passed a file path, use it directly.
    • If the user uploaded audio in chat, locate its local URI in the conversation transcript:
      grep -o '"uri":"[^"]*"' "<ArtifactDir>/.system_generated/logs/transcript.jsonl" | tail -n 5
      
  2. Decode & measure true BPM + phrase structure:
    • Run the bundled helper script to decode the song into 48 kHz 16-bit stereo WAV and print exact duration + 0.5s RMS phrase/section boundaries:
      python3 ~/.gemini/config/skills/pixel-music-film/scripts/analyze_audio.py "<input_audio>" "<project_dir>/assets/original_48k.wav"
      
    • Measure the exact studio BPM via low-band (<180 Hz) onset autocorrelation across the full track and find the exact Bar 0 downbeat offset in seconds.
    • CRITICAL VOCAL SYNC RULE: For rap, syncopated verses, rubato bridges, or echo cascades, slice verification .m4a clips around verse/chorus boundaries (afconvert / AVAssetExportSession) and verify the exact vocal entry/exit timestamps so non-uniform lines (e.g., a 1.5-bar rap line followed by 0.5-bar quick cuts) never cause cumulative subtitle or scene drift.

Phase 2: Screenplay Engine, Multi-Camera Blocking, Golden-Opening Hook & Adaptive Color Bible

A. Choose the Anti-Homogenization Narrative Architecture (7 Film Structures)

First, analyze the song's lyric perspective (1st-person confession, 3rd-person object/story, duet, or abstract mood) and musical genre. Reject literal "see-word-draw-word" clichés—externalize the emotional subtext into a concrete dramatic spine chosen from these 7 Narrative Architectures:

Narrative ArchitectureCore Storytelling & Visual MechanicsDramatic Twist / Climax PayoffBest Lyric & Genre Fit
1. Inanimate Witness POV (非人类/见证物第一视角传记)Camera and soul belong to a silent object or pet witnessing human lives from unique angles (desk-level, inside a backpack/shoebox, pawnshop shelf): e.g., a plush bear, a thrifted Walkman passed across 3 owners, a stray convenience-store cat, a battered acoustic guitar.The witness survives after the humans part ways, physically bearing the scars/stickers/tears as the sole living proof of their era.Object-anchored Storytelling Hip-Hop, Indie Folk, Nostalgic Narrative Pop.
2. "Memento" Reverse Chronology (全片逆向时间流/倒带叙事)Starts at 00:00 at the catastrophic aftermath (shattered glass on the floor, torn photo, empty rain platform) and runs time backward across the entire song: glass flies back together, tears flow upward into eyes, fights rewind into embraces.The final frame of the song rewinds to the very first sunny second the two strangers locked eyes before speaking—making the joy heartbreaking because we already saw the end.Heartbreak Ballads, Post-Rock, Piano/Strings Emotional Tracks, Slow-to-Mid Tempo.
3. Dual-Timeline Parallel Crosscut (双时空平行剪辑/同机位折叠)Alternates between Timeline A (5 years ago, vibrant summer) and Timeline B (present day, cold winter/rain) using identical camera framing and locations (same café booth, same corner bench, same train door) linked by whip-pans or split-screens.During the Bridge climax, the temporal wall dissolves: the past joyful self and present solitary self pass each other or lock eyes within the exact same frame.Duets, Then-vs-Now R&B / Pop, Long-Distance or Memory-Contrast Songs.
4. Rashomon Unreliable Narrator & Twist (罗生门悬疑反转剧)Acts I–II depict a seemingly warm two-person romance (subtle visual clues planted: only one shadow on the ground, one coffee cup on the table).At the Bridge drop, the camera pulls back to reveal the opposite seat was empty the entire time (or played through an old DV camcorder viewfinder/dream); earlier scenes rapid-flash back showing the protagonist alone.Bittersweet/Dark Pop, Classical Crossover, Plot-Driven Emotional Ballads, Trip-Hop.
5. Surreal High-Concept Odyssey (奇幻高概念/超现实心理迷宫)Breaks completely out of realistic apartments and turns internal psychological states into Satoshi Kon / Inception-style surreal visual spectacles: sinking through a mattress into an underwater subway car with glowing pixel whales, or running across folding city streets and giant spinning vinyl records.Gravity, architecture, and scale shatter and reassemble on the final chorus drop as the protagonist breaks out of the mental labyrinth into open sky.Synthwave, EDM, Alt-Pop, Abstract/Poetic Stream-of-Consciousness Lyrics, High-BPM Tracks.
6. Continuous Forward Odyssey (单向闯关公路/昼夜纪行)A relentless point-A-to-point-B forward physical journey that never backtracks, with sky lighting evolving seamlessly from midnight -> blue hour -> dawn -> noon (e.g., midnight desert gas station -> storm tunnel -> coastal bridge -> cliffside lighthouse release).Arriving at the final destination at sunrise to release/bury the past MacGuffin prop and accelerate forward into the open horizon.City Pop, Rock / Indie Band, Funk, Freedom / Coming-of-Age / Moving-On Anthems.
7. Ensemble Urban Tapestry (同一时刻的城市群像交响)Instead of one couple, cross-cuts across 4–5 distinct strangers at 2:00 AM in the same city (24h laundromat reader, night-shift taxi driver, convenience store clerk, rooftop trumpeter, late-night coder).On the final grand chorus, a single shared city-wide event (a sudden meteor shower, a power-grid flicker, or the first dawn elevated train) makes all 5 strangers look up at the same sky in unison.Humanistic Folk, Lo-Fi Jazz Hip-Hop, Urban Groove, Universal Empathy Lyrics.

B. Enforce the 4 Golden Screenwriting Laws Across Every Script

  1. The Three-Chorus Escalation Rule (三次副歌三级跳铁律):
    • When chorus lyrics repeat 2–3 times, the dramatic context must transform every single time:
      • Chorus 1 (Thesis / Warmth or Illusion): Establish the core bond, dream, or initial equilibrium.
      • Chorus 2 (Antithesis / Dramatic Irony): Pair the exact same chorus lyrics with the opposite visual reality (e.g., tender lyrics sung over a silent rainy breakup, a sealed dark box, or an empty room) to create maximum emotional counterpoint.
      • Chorus 3 (Synthesis / Transcendence & Payoff): Time-jump, truth reveal, or multi-location montage explosion that pays off every planted setup.
  2. The Living MacGuffin Prop Arc (核心道具物理折旧弧光):
    • Anchor the story around 1–2 recurring props whose physical appearance evolves visibly across acts (e.g., pristine mint plush -> tear-stained & frayed stitch; crisp concert ticket -> crumpled & taped; full-battery cassette player -> flashing low-battery red -> fresh batteries inserted).
  3. The Bridge Dramatic Vacuum & Reversal (桥段戏剧真空与破局):
    • At the song's 2/3 Bridge or pre-climax drop, engineer a breathtaking dramatic cliff: a 0.7–1.5s pitch-black audio/visual vacuum, a bullet-time gravity freeze, a rapid reverse-tape memory flash, or the main plot-twist reveal before slamming into the final chorus.
  4. Bookend Mirror Symmetry (首尾镜头镜像闭环):
    • The final shot of the film must mirror the composition of the opening shot with transformed meaning (e.g., opening on a dark cracked shoebox lid -> ending with the lid wide open in golden dawn sunlight; opening entering a rainy record shop alone -> ending stepping out into a clear sunrise street).

C. Design the 5-Dimension Multi-Camera Blocking (5 大电影级多机位立体叙事调度)

Never shoot a scene as a flat 2D stage play. Across every act, weave these 5 Multi-Camera Modes into the shot list:

Multi-Camera ModeCamera Setup & Spatial GeometryNarrative & Visual Impact
1. 4-Angle Spatial Coverage (同场空间四机位立体解剖)Break one key dialogue/conflict scene into 4 tightly cut cameras: Cam A (90° Top-Down Bird's-Eye) showing table/room distance -> Cam B (OTS Over-The-Shoulder Boy->Girl) with dark foreground shoulder silhouette -> Cam C (180° Reverse OTS Girl->Boy) -> Cam D (Extreme Macro Insert) on trembling fingers, overflowing coffee, or tapping feet under the table.Turns a flat room into a walkable 3D film set with intense psychological tension.
2. Dynamic Multi-Cam Split-Screen (同帧多机位动态画格并置)Render 2 to 4 simultaneous camera viewports inside a single 480×270 frame separated by crisp borders (e.g., Left Panel: wide rainy street intersection; Top-Right Panel: Cam A close-up of dialing phone in booth; Bottom-Right Panel: Cam B close-up of vibrating phone in pocket a block away), popping in on snare hits and merging full-screen on the downbeat.Triples visual density and shows simultaneous cause-and-reaction across space.
3. Diegetic Media & Reflection Cams (剧中实体介质与反射机位)Alternate between the objective cinema camera and in-world optical devices: High-Angle B&W CCTV Security Cam (with scanlines, timestamp REC 03:14:22, fish-eye corners), Handheld MiniDV / Polaroid Viewfinder Cam (crosshair, battery icon, breathing sway), or Car Rearview Mirror / Rain Puddle / Sunglasses Reflection Cam (main frame looks forward while the mirror inset shows someone receding behind).Creates layered "observer vs. observed" and "present vs. recorded memory" depth.
4. Multi-Protagonist Eye-Level POV (多角色视线高度主观机位)Cut between distinct character eye heights in the same room: 180cm Standing Downward POV -> 160cm Tear-Refracted Upward POV -> 20cm Floor-Level Pet/Plush Toy Low-Angle POV (seeing only pacing shoes, dropped keys on floorboards, and giant elongated shadows arguing on the wall).Lets camera altitude and framing tell the emotional power dynamic without a single word.
5. 3-Cam High-Speed Action Relay (同一动作跨三机位高速接力)Split a single kinetic physical action across 3 cameras in 1.5–2.5s: Cam 1 (Side Medium Launch) wrist release -> Cam 2 (Projectile Tracker Cam) locked right behind the flying dart/plush/paper-plane with 60fps speed lines and rushing background -> Cam 3 (Target Front Impact Cam) bullseye collision with exponential overshoot shake.Injects pure kinetic excitement into every physical action beat.

D. Choose the Golden-First-Seconds Hook Archetype (First 3–15s)

Select the opening hook dynamically based on the song's intro texture and BPM (or combine two archetypes, e.g., 4s Macro Pull-Back + 6s High-Speed One-Take Dive):

ArchetypeVisual & Camera MechanicsSynchronized Foley & Audio DesignBest Musical Fit
1. Continuous High-Speed One-Take Dive (高速一镜到底空间穿梭)Zero cuts; exponential Z-axis camera dive flying continuously through 4–5 parallax layers (e.g., night sky -> past neon signs -> straight through an open apartment window -> spring-stop inches from spinning turntable or protagonist's eye).High-altitude wind rush + Doppler-shifted neon/traffic pass-bys + instant low-pass filter snap entering the window (exterior roar -> warm room acoustics) + sub-bass landing drop.City Pop, Lo-Fi Jazz, R&B, Synthwave, Mid-Tempo Groove (75–105 BPM).
2. Extreme Macro-to-World Zoom Reveal (极限微距一镜暴风拉远)Starts at 00:00 locked inside a 50× ultra-macro detail (diamond needle in a vinyl groove, neon reflection inside a pupil, or a suspended raindrop), then executes an exponential Hyper Zoom-Out to reveal the entire high-density panorama on the chord/beat drop.Hyper-amplified near-field ASMR micro-Foley (needle friction, heartbeat, water surface hum) -> wide stereo frequency riser exploding into full room/city ambiance on zoom-out.Piano/guitar intros, emotional ballads, Post-Rock, atmospheric storytelling (65–95 BPM).
3. Bullet-Time Freeze & Beat-Drop Shatter (子弹时间悬停 + 节拍破冰)Opens in mid-air time-freeze (spilled coffee droplets, scattered Polaroids, raindrops, or thrown props suspended at 5% drift) while the camera orbits/glides at high speed; on the first heavy kick downbeat, gravity slams back to 100% speed.Vacuum sub-bass + Reverse Reverb suck-in (all room noise sucked dry during freeze) -> razor-sharp physical impact/shatter SFX on the exact 0.01s downbeat transient.Boom-Bap Hip-Hop, Trap, Rock, or songs with a suspenseful pre-drop intro (80–140 BPM).
4. Tactile Diegetic Ignition Chain (实体介质机械点火链)Continuous high-speed Whip-Follow camera tracking a physical chain reaction: cassette/vinyl load -> gears locking -> glowing cable trace -> twin VU needles pinning red -> CRT monitor degaussing flash as the camera dives into the screen.Crisp tactile mechanical chain: button Click -> motor spin-up Whirrr -> relay Hum -> CRT Degauss Thump + vinyl crackle bed.Retro Electronic, Vaporwave, Y2K, Tape/Vinyl Sample Hip-Hop (85–125 BPM).
5. Continuous Match-Cut Morphing Glide (同物异景连续匹配变形)Constant-velocity camera whip-pan or central rotation where a locked geometric shape seamlessly morphs across eras/locations (spinning dartboard -> bicycle wheel -> Ferris wheel -> vinyl record -> bedroom ceiling fan).Continuous pitch-morphing whooshes layered with 0.8s signature environmental snapshots (night market -> ocean breeze -> fairground music box -> vinyl crackle).Time-spanning nostalgia, romance, melodic indie/pop (65–115 BPM).
6. High-Density Kinetic Collage Fast-Cut (高密视觉拼贴快切秀)Rapid 0.8–1.6s cuts across 6–8 dense vignette shots with shutter flashes, speed lines, live spectrum overlays, and rotating pixel transitions.Camera shutter bursts, tape rewinds, bass drops, and rhythmic transient hits on every cut.High-BPM upbeat tracks, dense rap intros, or mystery hook montages (110+ BPM).

E. Choose the Genre-Adaptive Color Grading Palette & Multi-Act Arc

Select the core visual aesthetic from the 8 Cinema Color Grading Archetypes, and design a 3–4 Act Color Evolution across the song's duration:

Color ArchetypeCore Hex Palette & Contrast SignatureLighting, Atmosphere & Post-FX MotifsBest Musical Genre / Mood
1. Wong Kar-Wai Emerald & Tungsten (王家卫式迷离翡翠与钨丝金)Deep Emerald (#0D2B24..#1E5E4A), Tungsten Amber (#E89C28), Neon Blood Red (#B82028), Wet Umber (#1A120E).Heavy vignette, venetian-blind shadow stripes, smoky volumetric lamp cones, warm retro clocks & patterned wallpaper.Neo-Soul, Slow R&B, Late-Night Jazz Hip-Hop, Urban Melancholy.
2. Makoto Shinkai Cobalt & Sea-Salt (新海诚式高透钴蓝与盛夏盐白)Radiant Cobalt Sky (#1E68D0..#78C8FF), Cumulonimbus Ivory (#FFFDF7), Signal Emerald (#18B878), Vermilion Accent (#E84838).High clarity (minimal vignette), towering multi-crown Bayer clouds, sparkling sea speculars, crisp blue-tinted shadows.J-Pop, J-Rock, Indie Band, Youthful Summer Folk, Math Rock.
3. Hiroshi Nagai Sunset & Pool Mint (永井博式日落紫金与泳池薄荷)Miami Dusk Violet-Pink (#3B1D60..#D94E8F..#FF9A52), Pool Turquoise (#14C2D4), Chrome Cream (#FFF2D6).Palm silhouettes, horizontal anamorphic lens flares, specular chrome highlights, long golden-hour sunset shadows.City Pop, Funk, Disco, Nu-Disco, Breezy Groove.
4. Cyberpunk Neon Rain & Asphalt (赛博霓虹青品撞色与潮湿沥青)Abyssal Violet-Black (#0B0716), Electric Cyan (#00F0FF), Laser Magenta (#FF1E7A), Sodium Amber (#FFB800).100% wet ground mirror reflections, CRT scanlines, volumetric laser fog beams, beat-synced RGB chromatic split.Synthwave, Phonk, Electronic, Dark Trap, Cyber-Rock.
5. Kodak Golden -> Slate -> Dawn Narrative (柯达暖金记忆与冷灰雨夜叙事)Act I Warm Amber (#FFAE38 + Mint #58E89C) -> Act II Cold Rainy Slate (#25364E) -> Act III Terracotta Dawn (#FF8C42).Dramatic cross-act temperature shift (warmth: +0.20 -> -0.18 -> +0.24), living Polaroid flashbacks, dust-mote sunbeams.Storytelling Hip-Hop, Bittersweet Breakup/Memory Songs, Indie Ballads.
6. Nordic Fjord Slate & Mist Silver (北欧冰川青灰与雾感银白)Glacial Blue-Grey (#18222D..#4A6072), Pale Mist Silver (#CFD8DC), Lone Crimson Anchor (#D94B38).Drifting fog/snow particles, soft diffused overcast sky light, vast environmental scale vs. small characters.Post-Rock, Shoegaze, Ambient, Classical Strings, Melancholic Solo.
7. Mojave Rust Gold & Scorched Ochre (大漠废土锈金与烈日焦褐)Scorched Umber (#211108), Rust Orange (#C84B18), Blazing Chrome Yellow (#FFA822), Dust Sand (#F2D8A7).Heat-shimmer dust particles, diagonal god-rays, high-contrast backlit silhouettes, highway signs & vintage gauges.Rock, Grunge, Folk Rock, Country, Epic Anthems.
8. Wes Anderson Pastel & Parchment (复古童话粉彩与午后羊皮纸)Warm Parchment (#F4E8D1), Sage Mint (#62B69F), Dusty Rose (#E88D8A), Mustard Gold (#E5B242), Walnut (#4A3222).Symmetrical dollhouse/storybook framing, warm afternoon sun shafts, tactile woodgrain, fabric & miniature diorama depth.Acoustic Folk, Bossa Nova, Lullaby, Sweet Indie Pop.

Phase 3: Build the HD-2D Pixel Engine, Multi-Cam Viewport Helpers & Organic Foley Mixer

Read references/hd2d_engine_spec.md for the exact proven architecture, shader code, and pitfalls to avoid. Key non-negotiable rules:

  • Two-Pass HD-2D Rendering:
    • Pass 1 (480×270 logical pixel canvas + separate HDR emissive buffer): Pure C++ rasterizer with 4×4 Ordered Bayer Dithering, 12fps stepped character/cloth/water animation, 60fps camera/parallax/particles, crisp 5×7 bitmap pixel font for in-world signs, directional conical light beams (fillDitherLightCone), 12 high-density motion-graphics & set-dressing helpers, and Multi-Camera Framing Helpers (OTS foreground blurred shoulder silhouettes, 90° top-down room layouts, 2–4 panel dynamic split-screen compositing, CCTV scanline/timestamp HUD overlay, MiniDV/Polaroid viewfinder overlay, and rearview mirror inset frames).
    • CRITICAL FOREGROUND EMISSIVE OCCLUSION RULE: Inside PixelCanvas::setPx, whenever an opaque pixel (c.a == 255) is drawn, immediately zero emissive[i..i+3] = 0 before any optional addGlow() call. This guarantees opaque foreground silhouettes and characters cleanly occlude background sun/neon bloom without white bleed-through!
    • Pass 2 (1920×1080 Apple Metal GPU compositor): Multi-tier separable Gaussian bloom & horizontal anamorphic flare driven strictly by the emissive buffer, subtle normalized-UV optical chromatic aberration (u.chromaOffset = 0.0015..0.0035, never > 0.01), plus crisp 1920×1080 CoreGraphics voice-coded subtitles & kinetic title cards.
  • CRITICAL SHARPNESS RULE:
    • Keep locked shots on 100% pure filter::nearest (4×4 exact integer pixel blocks).
    • On dynamic AE-overshoot camera shots (camZoom, camPanX, camPanY), use exact half-texel-centered Sharp-Bilinear (p = uv * pixSize - 0.5 ... (fl + aa + 0.5) / pixSize). Omitting -0.5 / +0.5 blurs the entire film!
  • Audio & Organic Foley Mix:
    • Parse original_48k.wav by scanning RIFF chunks until "data" (never assume a fixed 44-byte WAV header).
    • Synthesize organic Foley cues locked to exact visual frames (including high-impact Golden-Opening spatial Foley: Doppler pass-bys, camera shutter bursts, mechanical ignition chains, vinyl needle drops, rain/surf beds, heartbeats), apply stereo Schroeder reverb ONLY to the Foley bus, keep the original music stem clean (~0.92x), mix Foley at ~0.32–0.36x, and pass through a soft-knee limiter (peak ≤ -0.5 dBFS).

Phase 4: Mandatory Visual & Audio Sync QA Gate

Before encoding the full 1080p60 MP4:

  1. Compile with clang++ -std=c++20 -O3 -fobjc-arc -ObjC++ and run --previews to export 24–30 keyframes (1080p PNG) spanning every act/transition + a 6×5 Contact Sheet PNG.
  2. Inspect the Contact Sheet and key full-res frames using read_file, auditing against every item in references/storyboard_qa_checklist.md (pixel edge sharpness, foreground emissive occlusion, normalized chromatic aberration, narrative escalation across choruses, 5-dimension multi-camera blocking variety, 3-plane room/street density, zero repeated scenes, character acting detail, subtitle/HUD clearance).
  3. Fix every visual or sync flaw, recompile, and re-verify before moving to Phase 5.

Phase 5: Full-Length 1080p60 MP4 Master Render & Post-Decode Verification

  1. Run --render <workspace>/<Title>_Full_<dur>_1080p60.mp4:
    • 1920×1080 (16:9), 60.00 fps, Rec.709 color tags, H.264 High Profile 22–24 Mbps (prevents Bayer dithering & 4×4 pixel muddiness), AAC 320 kbps / 48 kHz Stereo, faststart (shouldOptimizeForNetworkUse = YES).
    • Use Apple's deadlock-free dual-queue AVAssetWriter pattern (documented in references/hd2d_engine_spec.md).
    • If any temporary sample clips were created during testing, delete them once the full master MP4 is requested and verified.
  2. Immediately verify the finished .mp4:
    • Confirm video & audio track timeRange durations match within ≤ 0.01s, video track is 1920×1080 @ 60.00 fps (~20–24 Mbps), audio track is ~314–320 kbps.
    • Extract 4–6 decoded frames straight from the .mp4 via AVAssetImageGenerator and inspect them via read_file to guarantee razor-sharp decoded pixels and zero emissive bleed or corruption.
  3. Deliver clickable file:// links to the final MP4, the preview contact sheet, and key source files.

Related Skills