ash green

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.

57 seconds, nine beats, made from a 32-line script. It has sound effects but no speech.
Read what the clip says
  1. Code to Video. How a story file becomes a clip.
  2. Four steps, no timeline. This clip was written, not edited. Here is how it was made.
  3. Write: say it as data. A title, some beats and the lines to say. Words only, no design.
  4. Check: catch problems early. A line too long? A beat missing? Every problem is listed at once.
  5. The fix loop. Change the words and check again. Nothing is drawn until it passes.
  6. Stills: look before you render. One picture per beat. Eyes catch what a check cannot: the tone.
  7. Render: let the code draw it. Every frame and every sound is made from the story. Then an MP4.
  8. 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.
  9. Key takeaway. Write the story. Let code draw it. Change the words, not the timeline.

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.

  1. Title. What the clip is about.
  2. Overview. All four steps at once, before any detail, so the learner knows what's coming.
  3. Step 1: Write. Say it as data: a title, some beats and the lines to say.
  4. Step 2: Check. Catch problems early, and list every one at once.
  5. A worked mistake. The fix loop shows an error being caught and fixed on screen.
  6. Step 3: Stills. One picture per beat, to check the tone before rendering.
  7. Step 4: Render. The code draws every frame and sound from the script.
  8. The big idea. One card for the idea behind all four steps: the words and the look are kept apart.
  9. 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."
  ] }
A frame from the clip. On the left, the heading Catch problems early and the two lines from the script. On the right, a check report with three ticked rows: the longest line is 35 of 36 characters, all 9 beats are in order, and nothing is over the limit. A rail along the bottom shows the four steps, with Check lit in green.
One beat of the script and the frame it became. The script supplies the words and the style supplies the rest.

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.

Visuals that show where you are

Each part of the design has a job.

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
The same script as a 16-bit role-playing game. I walk the village as a pixel character. Each step is a building, with a small scene above it that shows what happens there: the file being written, the three checks, the stills being reviewed, the frames being counted. The script is unchanged.
The same script as a late-90s 3D world. Each step has its own set: a board the story file writes itself onto, a column of blocks that measures the longest line, a gallery of stills and a projector that counts the frames.

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:

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.