Opus Motion ★ Star on GitHub

Music · token-tree

Token tree (what the model could have said)

A sentence is generated token by token on the beat along a bright chosen path while every node sprouts dim alternative branches with their tokens and probabilities that keep branching into the dark; the camera rides the tip, then pulls back in beat steps until the whole tree is in frame, the last token set in italic serif.

A free, MIT-licensed music visualizer from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Token tree (what the model could have said): three frames of the music visualizer, start, middle and end
Token tree (what the model could have said) — start, middle and end of the 10.0-second motion.

What Token tree (what the model could have said) is for

LLM explainers (“what the model could have said”), decision trees, branching-story or A/B moments; pairs with token-sampler-prompt.

  • llm
  • token
  • tree
  • branching
  • probability
  • sampling
  • ai
  • decision tree
  • explainer
  • beam search
  • beat
  • camera pull back
  • treatise

Details

Category
Music visualisers & audio graphics
Length
10.0 s (300 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
yes
Seamless loop
no
Text props
—
Colour props
background ink dim accent
Mood
editorial, night
Roles
subject

Use Token tree (what the model could have said) in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add token-tree --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render token-tree --props '{"background":"#0A0A0B","ink":"#EEE9DF","dim":"#5E5B57","accent":"#FF4D12"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export token-tree --as webm-alpha --props '{"background":"#0A0A0B","ink":"#EEE9DF","dim":"#5E5B57","accent":"#FF4D12"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="token-tree"
  props={{
    background: '#0A0A0B',
    ink: '#EEE9DF',
    dim: '#5E5B57',
    accent: '#FF4D12',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="token-tree"
  props='{"background":"#0A0A0B","ink":"#EEE9DF","dim":"#5E5B57","accent":"#FF4D12"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "token-tree",
      "props": {
        "background": "#0A0A0B",
        "ink": "#EEE9DF",
        "dim": "#5E5B57",
        "accent": "#FF4D12"
      }
    }
  ]
}

Token tree (what the model could have said) props

12 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
path[{"token":"The","p":0.62,"alts":[["A",0.21],["Our",0.07],["This",0.05]]},{"token":"nigh…the chosen tokens in order [{token, p, alts: [[alternative, p], …]}]
bpm120tempo used when `beats` has no beat list
offsetSec0.3time of the first beat in seconds (aligns the grid to your song)
beats{}beat data: {bpm, offsetSec, beatsPerBar} or a list of beat times (s), or a full analysis {beats, downbeats, sections, onsets:{kick,snare,hat:[[t,strength]]}}
beatsPerToken1beats between tokens
depth3how deep the dim alternatives keep branching (1–3)
background"#0A0A0B"frame colour or 'transparent'
ink"#EEE9DF"token text colour
dim"#5E5B57"branch / probability colour
accent"#FF4D12"chosen path colour
serifTokentrueset the final token in italic serif
seed4sub-branch variety

Notes & credits

Technique sources:

  • pdoom-video app/src/scenes/loom-tree.ts (MIT); original sentence and alternatives