Work · Experiment
Code to Video.
A process is easier to follow one idea at a time. This is how I split one into nine beats, and the tool I built to check the beats and draw the clip.
Read what the clip says
- Code to Video. How a story file becomes a clip.
- Four steps, no timeline. This clip was written, not edited. Here is how it was made.
- Write: say it as data. A title, some beats and the lines to say. Words only, no design.
- Check: catch problems early. A line too long? A beat missing? Every problem is listed at once.
- The fix loop. Change the words and check again. Nothing is drawn until it passes.
- Stills: look before you render. One picture per beat. Eyes catch what a check cannot: the tone.
- Render: let the code draw it. Every frame and every sound is made from the story. Then an MP4.
- One story, many looks. The story holds no design. The style is chosen at render. Change the look, keep the words. Change the words, keep the look.
- Key takeaway. Write the story. Let code draw it. Change the words, not the timeline.
- FocusBreaking a process into beats
- ToolsNode, canvas, ffmpeg, Claude Code
- My partThe learning design, the visual design and the review. The code was written with Claude.
- ResultA 57-second clip in nine beats, from a 32-line script, drawn in three styles
The problem
A process is hard to follow when it all arrives at once. One long screen and one long voiceover leave the learner holding every step at the same time.
Video adds a second problem. Every caption sits on a timeline, so changing one sentence means moving everything after it. The words get fixed early, and the clip is out of date the first time the process changes.
So I wanted a way to break a process into pieces a learner can hold, and to change those pieces as easily as editing a document.
The approach
Plan the beats first
A beat is one idea on one screen: a short heading and two lines. I plan the clip as a list of beats before anything is drawn, and each beat has a job.
- Title. What the clip is about.
- Overview. All four steps at once, before any detail, so the learner knows what's coming.
- Step 1: Write. Say it as data: a title, some beats and the lines to say.
- Step 2: Check. Catch problems early, and list every one at once.
- A worked mistake. The fix loop shows an error being caught and fixed on screen.
- Step 3: Stills. One picture per beat, to check the tone before rendering.
- Step 4: Render. The code draws every frame and sound from the script.
- The big idea. One card for the idea behind all four steps: the words and the look are kept apart.
- Takeaway. The one thing to remember, said last.
The order is deliberate. The overview comes first so each step has somewhere to fit. The mistake comes straight after the check, while the rules are still fresh. The big idea waits until the learner has seen all four steps.
Write the beats as a script
The beats go in a small text file. It holds the words. It has no colours, positions or timings in it.
{ "type": "stage", "stage": "check",
"say": [
"CHECK: CATCH PROBLEMS EARLY",
"A line too long? A beat missing?",
"Every problem is listed at once."
] }
The decisions
Limits that keep it learnable
The tool checks every beat against a few hard limits before it draws anything. They're my learning design rules written as code, so I can't break them by accident.
- 36 characters a line, 30 for a heading. Short enough to read at a glance. The longest line in this script is 35.
- No more than 4 items in a step, or 4 points on a card. Few enough to hold in your head at once.
- No more than 5 steps. A process with more needs two clips.
- Time to read. Each beat stays on screen for as long as its words take to read, at about 17 characters a second, plus a short pause.
Visuals that show where you are
Each part of the design has a job.
- A rail that stays put. The rail along the bottom shows all four steps for the whole clip, so the learner can see where they are and what's left.
- Grey first, then green. Each step starts grey and turns green when it's done.
- One green thing per screen. Only the part being explained is bright.
- Real numbers. The check shows the script's actual longest line and the tool's actual limits.
The clip uses my own brand: pale grey-green, one bright green, two typefaces and the dot grid. The brand already works the same way, grey first and then colour.
One script, three looks
The script holds no design, so changing the look means changing one word in the command: the name of the style.
node explain.mjs --story code-to-video.story.json --pack ash-green node explain.mjs --story code-to-video.story.json --pack ash-16bit node explain.mjs --story code-to-video.story.json --pack ash-ps1
All three versions teach the same way. Each opens with the overview, gives each idea its own beat and shows what happens at each step.
I got that wrong the first time. The first 3D version had life bars, a timer and gems to collect, like the games it borrowed from. They looked right and explained nothing, so I took them out. Each set now shows the step itself.
A new style takes a while to build. Once it exists, any script can use it.
Look before you render
The check catches a line that's too long. A beat that feels flat, or two beats that say the same thing, get straight past it. So the tool draws one still per beat, and I read them as a storyboard before anything is rendered. Anything I spot there is still quick to fix.
The content picks the layout
The sample is a process, but the tool has seven layouts. I choose by what the learner needs to do with the content:
- Journey: stages someone moves through. The sample is one of these.
- Lever: a set of options, and what each one does to a number.
- Scenario: what people say in a conversation.
- Glossary: a set of terms to learn.
- Versus: two or three things compared.
- Calculator: a sum worked out step by step.
- Framework: a model built one piece at a time.
The result
The clips on this page are the sample: nine beats, 57 seconds, from a 32-line script. On my own PC the brand style took 26 seconds to render, the 16-bit style 75 and the 3D style 194.
To change a clip, I edit the words and render again. The tool checks the limits and works out the timing again each time.
Taking it further
Everything on this page is code alone: the tool draws each frame onto a flat canvas, which is why it's quick. I've also connected it to Blender, so the same lesson can be shot as a film with real light, a real camera and things that physically happen. That's on its own page: Flat to film.
What I'd change
The sample has no voice. The tool can time each beat to a narration track, so a narrated clip is next.