Journal/release · motion · effectsEntry 09 / 10
What's new in vidmake 0.2
Repeat, value expressions that return strings and colors, rich text, attach, stack layout, effects and masks, particles, audio-reactive values, lint codes, --draft renders and vidmake update.

▸ blog-new-effects1280×720 · 30 fps · 0:04.0Rendered by vidmake
A day after the first release, we asked the agents that had been building videos with vidmake a simple question: what did you have to hack around? The answers were consistent. Twelve near-identical layers to draw twelve dots. Hand-computed y coordinates that broke when a headline wrapped. Counters that needed thousands separators. No way to put a cursor at the end of typed text, or make anything move with the music.
vidmake 0.2 answers that list. It also ships prebuilt binaries for Linux, macOS and Windows with one-line installers, and a vidmake update command. Everything below is additive: projects written for 0.1 validate and render unchanged.
Every demo on this page is rendered by vidmake from the JSON under it.
#Repeat
repeat stamps out copies of a layer. Each copy gets an id of <id>.<i> and two expression variables: i, the copy's index, and n, the count. Copies can sit on top of each other or be placed by a layout: radial, grid, row or column.
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [{ "id": "repeat", "description": "One tick layer repeated 72 times around a circle; i and n drive the wave and the color", "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": { "type": "radial", "center": [0.5, 0.5], "radius": 0.8, "stops": ["#fbf9f4", "#f4f1ea"] }, "layers": [ { "id": "tick", "type": "rect", "width": 6, "height": 46, "anchor": "bottom", "repeat": { "count": 72, "layout": "radial", "radius": 230, "rotate": true, "delay": "12ms" }, "scaleY": "=1 + 1.1 * (0.5 + 0.5 * sin(t * tau / 2 - i * tau / n * 3))", "fill": "=lerp('#161412', '#c92a26', 0.5 + 0.5 * sin(t * tau / 2 - i * tau / n * 3))", "enter": { "type": "scale", "duration": "0.4s" } }, { "id": "dot", "type": "ellipse", "width": 8, "fill": "#16141255", "repeat": { "count": 36, "layout": "radial", "radius": 160 }, "opacity": "=0.3 + 0.7 * (i % 3 == 0)" }, { "id": "count", "type": "text", "text": "72", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 140, "letterSpacing": -6, "fill": "#161412", "y": "47%", "enter": "fadeUp" }, { "id": "label", "type": "text", "text": "copies of one layer", "font": "JetBrains Mono", "fontSize": 14, "letterSpacing": 1.7, "uppercase": true, "fill": "#8a857a", "y": "59%", "start": "0.2s", "enter": "fadeUp" } ] }]}That ring is one rect. rotate: true turns each copy to face outward, delay starts copy i at i × 12ms so the ring builds around the circle, and the wave is a single expression in which i / n is the copy's position around the ring. Repeat works on groups too, and every child of a repeated group sees the same i, which is how the next demo builds three stat tiles from one group. See repeat.
#Values that are strings and colors
In 0.1, expressions returned numbers. In 0.2 they can return strings and colors, and color fields such as fill, stroke and shadow.color accept expressions:
| function | example | result |
|---|---|---|
pick(i, [...]) | pick(i, ['#161412', '#1f5fb0']) | the item at i, cycling |
hsl(), rgb() | hsl(i * 30, 80, 60) | a color |
lerp(c1, c2, t) | lerp('#8a857a', '#c92a26', p) | a blend of two colors |
fmt(x) | fmt(1250000) | "1,250,000" |
pad(x, width) | pad(3, 2) | "03" |
+ | 'v' + 2 | "v2" |
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [{ "id": "values", "description": "A repeated group of stat tiles: pick() chooses labels and colors, fmt() and pad() format the counters", "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": "#f4f1ea", "layers": [ { "id": "heading", "type": "text", "text": "This week in the render farm", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 54, "letterSpacing": -2.5, "fill": "#161412", "y": "17%", "enter": "fadeUp" }, { "id": "tile", "type": "group", "width": 340, "height": 300, "x": "50%", "y": "56%", "repeat": { "count": 3, "layout": "row", "spacing": 370, "delay": "0.12s" }, "enter": "fadeUp", "children": [ { "id": "card", "type": "rect", "cornerRadius": 4, "fill": "#fbf9f4", "stroke": "#161412", "strokeWidth": 1.5 }, { "id": "bar", "type": "rect", "anchor": "left", "x": 32, "y": 40, "height": 4, "width": { "from": 0, "to": 60, "duration": "0.8s", "ease": "easeOutCubic" }, "fill": "=pick(i, ['#161412', '#1f5fb0', '#c92a26'])" }, { "id": "label", "type": "text", "text": "${pad(i + 1, 2)} · ${pick(i, ['frames rendered', 'layers inspected', 'warnings left'])}", "font": "JetBrains Mono", "fontSize": 13, "letterSpacing": 1.6, "uppercase": true, "fill": "#8a857a", "anchor": "left", "x": 32, "y": 76 }, { "id": "value", "type": "text", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 60, "letterSpacing": -1, "anchor": "left", "x": 30, "y": 170, "text": "${fmt(round(pick(i, [1250000, 48210, 312]) * easeOutCubic(clamp(t / 2, 0, 1))))}", "fill": "=lerp('#8a857a', pick(i, ['#161412', '#1f5fb0', '#c92a26']), clamp(t / 2, 0, 1))" }, { "id": "delta", "type": "text", "text": "${pick(i, ['+18%', '+4.2%', '−63%'])} this week", "font": "Schibsted Grotesk", "fontSize": 18, "fill": "#4a4640", "anchor": "left", "x": 32, "y": 250, "start": "1.6s", "enter": "fade" } ] } ] }]}Each tile's label, number, accent and color come from pick(i, ...). The value counts up with fmt(round(...)), and the number's color blends from gray to its accent with lerp. One detail matters for counters: text from ${...} is now evaluated at the whole frame even when the composition has motion blur, so numbers stay sharp instead of smearing across sub-frames. There is also a per-layer "motionBlur": false for anything else that should stay crisp. See expressions.
#Rich text and attach
text can now be an array of spans. Plain strings use the layer's fill, and { "text": ..., "fill": ... } spans set their own, which is all a syntax highlighter needs. "whiteSpace": "pre" keeps indentation.
Note
Since 0.2.1, spans also take
fontWeight,italicandfont, so a bold keyword or an italic comment no longer needs its own layer.
attach pins a layer to a sibling. Attached to a text layer, it sits right after the last visible character, so it follows a typewriter:
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono-Italic.ttf" } ], "compositions": [{ "id": "code", "description": "Rich text for syntax colors, a typewriter, a cursor attached to the last character, then the layer it describes", "width": 1280, "height": 720, "fps": 30, "duration": "5.5s", "background": { "type": "linear", "angle": 160, "stops": ["#f4f1ea", "#e9e4d8"] }, "layers": [ { "id": "window", "type": "rect", "width": 900, "height": 250, "y": 245, "cornerRadius": 4, "fill": "#fbf9f4", "stroke": "#161412", "strokeWidth": 1.5, "enter": "fadeUp" }, { "id": "light", "type": "ellipse", "width": 12, "x": 236, "y": 146, "fill": "=pick(i, ['#161412', '#8a857a', '#d8d1c1'])", "repeat": { "count": 3, "layout": "row", "spacing": 22 }, "enter": "fadeUp" }, { "id": "file", "type": "text", "text": "title.json", "font": "JetBrains Mono", "fontSize": 13, "letterSpacing": 1.6, "uppercase": true, "fill": "#8a857a", "y": 146, "enter": "fadeUp" }, { "id": "code", "type": "text", "font": "JetBrains Mono", "fontSize": 26, "lineHeight": 1.6, "align": "left", "whiteSpace": "pre", "anchor": "top-left", "x": 236, "y": 176, "fill": "#8a857a", "text": [ "{ ", { "text": "\"type\"", "fill": "#4a4640" }, ": ", { "text": "\"text\"", "fill": "#161412", "fontWeight": 700 }, ",\n", " ", { "text": "\"text\"", "fill": "#4a4640" }, ": ", { "text": "\"Launch day\"", "fill": "#161412", "fontWeight": 700 }, ",\n", " ", { "text": "\"fontSize\"", "fill": "#4a4640" }, ": ", { "text": "120", "fill": "#161412", "italic": true }, ",\n", " ", { "text": "\"enter\"", "fill": "#4a4640" }, ": ", { "text": "\"pop\"", "fill": "#161412", "fontWeight": 700 }, " }", { "text": " // that's the whole layer", "italic": true } ], "start": "0.4s", "enter": { "type": "typewriter", "duration": "3s", "ease": "linear" } }, { "id": "cursor", "type": "rect", "width": 3, "height": 34, "fill": "#c92a26", "attach": "code", "x": 5, "start": "0.4s", "opacity": "=fract(t * 1.25) < 0.55 ? 1 : 0.15" }, { "id": "preview", "type": "text", "text": "Launch day", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 120, "letterSpacing": -5, "fill": "#161412", "enter": "pop", "y": 545, "start": "3.5s" } ] }]}The cursor's only position is "attach": "code", "x": 5: five pixels to the right of wherever the typing has reached. Attached to a path or line, a layer rides the drawn tip, which the data videos post uses for a marker on a line chart. See text and attach.
#Stack layout
A group with layout stacks its children like a CSS flexbox column or row, measuring each child every frame. Nothing needs a hand-computed y, and when a headline wraps to another line, everything below it moves down:
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk-Italic.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [{ "id": "layout", "description": "A column layout re-measured every frame: when the headline wraps to more lines, everything below moves down", "width": 1280, "height": 720, "fps": 30, "duration": "6s", "background": { "type": "linear", "angle": 120, "stops": ["#f4f1ea", "#e9e4d8"] }, "layers": [ { "id": "card", "type": "group", "width": 1000, "height": 600, "anchor": "left", "x": 120, "y": "50%", "layout": { "direction": "column", "gap": 26, "align": "start", "justify": "center" }, "children": [ { "id": "kicker", "type": "text", "text": "Stack layout", "font": "JetBrains Mono", "fontSize": 15, "letterSpacing": 1.8, "uppercase": true, "fill": "#8a857a", "enter": "fadeUp" }, { "id": "h1", "type": "text", "text": "One line.", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 68, "letterSpacing": -3, "align": "left", "fill": "#161412", "duration": "2s", "enter": "fadeUp", "exit": "fade" }, { "id": "h2", "type": "text", "text": "Now the headline wraps onto a second line.", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 68, "letterSpacing": -3, "lineHeight": 0.95, "align": "left", "maxWidth": 800, "fill": "#161412", "start": "2s", "duration": "2s", "enter": "fadeUp", "exit": "fade" }, { "id": "h3", "type": "text", "text": "And three: nothing below it was given a y coordinate.", "font": "Schibsted Grotesk", "italic": true, "fontSize": 68, "letterSpacing": -3, "lineHeight": 0.95, "align": "left", "maxWidth": 640, "fill": "#161412", "start": "4s", "enter": "fadeUp" }, { "id": "sub", "type": "text", "text": "Each child is measured every frame.", "font": "Schibsted Grotesk", "fontSize": 24, "fill": "#4a4640", "start": "0.2s", "enter": "fadeUp" }, { "id": "chips", "type": "group", "width": 600, "height": 48, "start": "0.35s", "enter": "fadeUp", "layout": { "direction": "row", "gap": 12, "justify": "start" }, "children": [ { "id": "chip", "type": "text", "repeat": 3, "text": "${pick(i, ['column', 'row', 'gap: 26'])}", "font": "JetBrains Mono", "fontSize": 17, "fill": "#161412", "background": "#fbf9f4", "padding": 12, "cornerRadius": 3 } ] } ] }, { "id": "rule", "type": "rect", "anchor": "left", "x": 96, "y": "50%", "width": 2, "height": 600, "fill": "#c92a26" } ] }]}The three headlines are separate layers with consecutive time windows. A child outside its time window takes no space, so each headline gets the slot only while it's on screen. That rule is useful, and it has a consequence worth knowing: a child that enters later makes the stack re-flow when it appears. If that's not what you want, keep the child in the stack the whole time and animate its opacity instead. The kinetic typography post shows the pattern. See groups.
#Effects and masks
Five additions, all animatable, all usable on groups:
glow: an additive blurred halo, in the layer's own colors or a fixed one.grain: film grain on a layer, or on the whole frame with the composition'sgrain.chromaticAberration: an RGB split in pixels.rotateX,rotateYandperspective: a 3D tilt around the anchor.maskandmaskMode: a track matte. The mask is a full layer definition, positioned and timed like a sibling, that isn't drawn itself.
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [{ "id": "effects", "description": "A gradient seen through a text matte, tilted in 3D, with glow, chromatic aberration and film grain", "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": "#131210", "grain": 0.06, "layers": [ { "id": "plate", "type": "group", "rotateY": "=sin(t * tau / 4) * 22", "rotateX": "=6 + cos(t * tau / 4) * 6", "children": [ { "id": "ring", "type": "arc", "width": 520, "stroke": "#efebe2", "strokeWidth": 3, "startAngle": "=t * 90", "endAngle": "=t * 90 + 300", "glow": { "radius": 18, "strength": 2 } }, { "id": "fill", "type": "rect", "fill": { "type": "linear", "angle": "=t * 90", "stops": [[0.3, "#efebe2"], [0.5, "#f05a4e"], [0.7, "#6aa6e8"]] }, "chromaticAberration": "=3 + 5 * pow(0.5 + 0.5 * sin(t * tau), 4)", "mask": { "id": "word", "type": "text", "text": "0.2", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 420, "letterSpacing": -20, "scale": { "from": 1.25, "to": 1, "duration": "1s", "ease": "easeOutCubic" } } }, { "id": "caption", "type": "text", "text": "glow · grain · chromaticAberration · rotateX/Y · mask", "font": "JetBrains Mono", "fontSize": 16, "letterSpacing": 1, "fill": "#8f8a7f", "y": "88%" } ] } ] }]}Here a full-frame gradient rect is masked by the text 0.2, so the gradient shows only through the letters. The matte has its own scale tween, the gradient's angle rotates with time, and the whole group tilts. See effects and masks.
#Particles
The new particles layer is a seeded emitter. Like everything else in vidmake, particle positions are computed from time and a seed rather than simulated frame by frame, so any frame renders on its own and a render is reproducible.
{ "fonts": [{ "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }], "compositions": [{ "id": "particles", "description": "Two seeded emitters: embers rising from the bottom edge and a burst of stars behind the title", "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": { "type": "radial", "center": [0.5, 1], "radius": 1.1, "stops": ["#1d1b18", "#131210"] }, "layers": [ { "id": "embers", "type": "particles", "x": "50%", "y": 712, "width": 1280, "start": "-3s", "emitter": { "rate": 60, "lifetime": "3.5s", "speed": 210, "speedRandom": 0.6, "angle": 0, "spread": 24, "gravity": -12, "drag": 0.1, "size": 9, "endSize": 2, "colors": ["#efebe2", "#8f8a7f", "#f05a4e"] }, "glow": { "radius": 8, "strength": 1.2 } }, { "id": "burst", "type": "particles", "x": "50%", "y": "46%", "start": "0.8s", "duration": "3.2s", "emitter": { "burst": 140, "rate": 0, "lifetime": "2.4s", "speed": 900, "speedRandom": 0.85, "gravity": 220, "drag": 1.6, "size": 18, "endSize": 4, "shape": "star", "spin": 300, "seed": 7, "colors": ["#efebe2", "#6aa6e8", "#f05a4e", "#8f8a7f"] } }, { "id": "title", "type": "text", "text": "Same seed, same sparks.", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 80, "letterSpacing": -3.5, "fill": "#efebe2", "y": "46%", "start": "0.8s", "enter": "pop", "shadow": { "color": "#131210cc", "blur": 30 } }, { "id": "sub", "type": "text", "text": "Particles are a pure function of time, like everything else.", "font": "Schibsted Grotesk", "fontSize": 22, "fill": "#8f8a7f", "y": "60%", "start": "1.2s", "enter": "fadeUp" } ] }]}Two tips from building this one. First, the embers layer starts at "-3s", so it has been emitting for three seconds when the video begins and the frame is already full at frame 0. Second, the linter checks the emitter's box, not where the particles fly. An emitter placed just below the frame would be reported as off-canvas even though its particles are visible:
warning: layer `embers` is entirely off-canvas at frame 60 (bbox [0,740,1280,740]) [offCanvas]The fix is either to move the emitter onto the canvas, as this demo does with "y": 712, or to say the placement is intended with "lint": { "ignore": ["offCanvas"] }. See particles.
#Audio-reactive values
Four new expression variables come from the composition's soundtrack: amp (loudness, 0 to 1), bass (the low end, 0 to 1), beat (1 on each detected beat, decaying within about 0.3 seconds) and beats (the number of beats so far). They are computed from everything audible in the composition (audio layers and video sound, after volume and fades), and only when an expression actually uses them.
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [{ "id": "beat", "description": "beat drives a ripple and a pulse, beats picks the color, bass sets the bar width (sound on)", "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": "#f4f1ea", "layers": [ { "id": "music", "type": "audio", "src": "assets/music.mp3" }, { "id": "ripple", "type": "ellipse", "width": "=240 + 900 * pow(1 - beat, 2)", "height": "=240 + 900 * pow(1 - beat, 2)", "fill": null, "stroke": "=pick(beats, ['#161412', '#c92a26', '#1f5fb0'])", "strokeWidth": "=1 + 6 * beat", "opacity": "=beat", "lint": { "ignore": ["invisible"] } }, { "id": "word", "type": "text", "text": "on the beat", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 140, "letterSpacing": -6, "scale": "=1 + 0.1 * beat", "fill": "=lerp('#161412', pick(beats, ['#161412', '#c92a26', '#1f5fb0']), beat)" }, { "id": "bass", "type": "rect", "y": "68%", "height": 6, "width": "=24 + 560 * bass", "fill": "#161412" }, { "id": "count", "type": "text", "text": "beats ${pad(beats, 2)} bass ${bass:2}", "font": "JetBrains Mono", "fontSize": 15, "letterSpacing": 1.8, "uppercase": true, "fill": "#8a857a", "y": "76%" } ] }]}The ripple's size is 240 + 900 * pow(1 - beat, 2), so it starts small on each beat and expands as beat decays. pick(beats, [...]) advances the color on every beat. Audio-reactive visuals goes deeper, and the reference is in audio-reactive.
#Tooling
#Lint codes
The layout and timing warnings from validate now end with a code: offCanvas, textOverflow, invisible, zeroDuration or afterEnd. Intended warnings, such as rays that fly off-screen or a blinking cursor that is invisible half the time, can be silenced per layer, and a group's setting covers its children:
{ "id": "cursor", "type": "rect", "attach": "typed", "opacity": "=fract(t * 1.6) < 0.5 ? 1 : 0", "lint": { "ignore": ["invisible"] } }"lint": false silences everything for that layer. A clean validate now means something, which matters for agents that treat any warning as a reason to look again. See lint.
#Draft renders
vidmake render --draft renders a full-length preview at half size, without motion blur, using the fastest encoder preset. Here is the 4-second title card from our introduction, rendered both ways on the same laptop (only the final done event of each is shown):
$ vidmake render blog-intro-first.json -o out/first.mp4 --json{"event":"done","output":"out/first.mp4","codec":"h264","frames":120,"width":1280,"height":720,"fps":30.0,"duration":4.0,"elapsed":2.462749207,"renderFps":48.726033352855325,"draft":false}$ vidmake render blog-intro-first.json -o out/first-draft.mp4 --json --draft{"event":"done","output":"out/first-draft.mp4","codec":"h264","frames":120,"width":640,"height":360,"fps":30.0,"duration":4.0,"elapsed":0.458601718,"renderFps":261.6649595717389,"draft":true}The draft finished about five times sooner. It's the right render for checking pacing and audio sync; the full render is for the file you ship. Progress events (--json) now also carry percent and eta.
#Schema, update, installers
vidmake schemaprints a JSON Schema for project files. Point an editor at it, or validate generated JSON against it before calling the CLI at all. The site serves it at /schema.json.vidmake updateinstalls the newest release by reinstalling withcargo install(so it needs a Rust toolchain), andvidmake update --checkonly reports whether there is one. vidmake also checks for a new release at most once a day: on a terminal it asks, otherwise it prints a singlenote:line to stderr and leaves stdout and--jsonoutput untouched.VIDMAKE_NO_UPDATE_CHECK=1turns the check off, and it's skipped whenCIis set.- Every push to
mainnow builds Linux (x86_64 and arm64), macOS (Intel and Apple Silicon) and Windows binaries, andinstall.shandinstall.ps1put the right one on yourPATH. See installation.
#Upgrading
Run vidmake update, or re-run the installer. Then run vidmake validate --all on your projects. Nothing that worked in 0.1 should break, but the new lint may tell you about things that were already wrong.
If you drive vidmake from an agent, re-read vidmake docs once after updating. The reference now covers repeat, attach, effects and lint, and an agent that knows repeat exists will stop writing twelve copies of the same layer. The complete list of features in one project is examples/features.json, in the examples folder of the release archive.
Keep reading

Four reels, thirty seconds each
A Swiss poster, a piece of generative op-art, a data poem and a risograph collage. Each is a single vidmake JSON file, written, checked and rendered by an agent, using nothing but the four stock assets.
Read
What's new in vidmake 0.5
Markers name the beats of a video, decoration draws underlines, strike-throughs and highlights from the glyphs, design tokens and named easings bring a brand's system into a project, and WOFF2 fonts, synthetic italics, skewX, themed SVG icons, repeat origins and wipe edges close the gaps an agent hit making a 20-second ad.

What's new in vidmake 0.2.1
vidmake analyze shows the beats and loudness curves that audio-reactive expressions will see, rich-text spans take fontWeight, italic and font, drawMode: "total" draws many strokes with one pen, and source builds report the right version.