mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 07:05:28 +00:00
`BANDS` has named the ranges since the copy layer landed — rumble, weight, mud, middle, presence, edge, air — and nothing showed them. The rack spoke entirely in Hz, which mean nothing to somebody who has not been taught them, and the words that would teach them sat unread in core. Every spectral module now shows where it acts on one ruler. Two things at once, deliberately: the bar says where this module works relative to everything else, and the caption names the range and what lives there. A bar alone is decoration; a caption alone does not teach the shape. Log-spaced, because hearing is. Rumble is 20–80 Hz — three tenths of one percent of the range linearly and about a fifth of it by ear — so laid out linearly the bottom six bands collapse into a sliver and the ruler teaches nothing. A test asserts the bottom segment is over a tenth of the bar, which a linear layout fails. Segments outside what the module can reach are dimmed rather than hidden: a filter that only works in the bottom three bands should not look like it could move anywhere, and it should still be legible against the whole range. `audioBandAt` clamps past both ends rather than returning nothing — 15 Hz is still rumble to anybody who can hear it, and the alternative is a filter parked at the edge of its range having no name at all. Boundaries belong to the band they open, or a filter at exactly 250 Hz reads as Weight while the ruler beside it highlights Mud. Nothing under an effect with no range to place: there is nothing spectral about a limiter, and a bar under one would be a decoration claiming to be information. core 1754 passing (112 files), studio 3690 passing / 18 todo.
@hyperframes/core
Types, parsers, generators, compiler, linter, runtime, and frame adapters for the Hyperframes video framework.
Install
npm install @hyperframes/core
Most users don't need to install core directly — the CLI, producer, and studio packages depend on it internally.
What's inside
| Module | Description |
|---|---|
| Types | TimelineElement, CompositionSpec, Asset, canvas dimensions, defaults |
| Parsers | parseHtml — extract timeline elements from HTML; parseGsapScript — parse GSAP animations |
| Generators | generateHyperframesHtml — produce valid Hyperframes HTML from a composition spec |
| Compiler | compileTimingAttrs — resolve data-start / data-duration into absolute times |
| Linter | lintHyperframeHtml — validate Hyperframes HTML (missing attributes, overlapping tracks, etc.) |
| Runtime | IIFE script injected into the browser — manages seek, media playback, and the window.__hf protocol |
| Frame Adapters | Pluggable animation drivers (GSAP, Lottie, CSS, or custom) |
Frame Adapters
A frame adapter tells the engine how to seek your animation to a specific frame:
import { createGSAPFrameAdapter } from "@hyperframes/core";
const adapter = createGSAPFrameAdapter({
getTimeline: () => gsap.timeline(),
compositionId: "my-video",
});
Implement FrameAdapter for custom animation runtimes:
import type { FrameAdapter } from "@hyperframes/core";
const myAdapter: FrameAdapter = {
id: "my-adapter",
getDurationFrames: () => 300,
seekFrame: (frame) => {
/* seek your animation */
},
};
Parsing and generating HTML
import { parseHtml, generateHyperframesHtml } from "@hyperframes/core";
const { elements, metadata } = parseHtml(htmlString);
const html = generateHyperframesHtml(spec);
Linting
import { lintHyperframeHtml } from "@hyperframes/core/lint";
const result = lintHyperframeHtml(htmlString);
// result.findings: { severity, message, elementId }[]
Documentation
Full documentation: hyperframes.heygen.com/packages/core
Related packages
@hyperframes/engine— rendering engine that drives the browser@hyperframes/producer— full render pipeline (capture + encode)hyperframes— CLI