mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-14 21:29:34 +00:00
Twenty named starting points across four shelves — voice, repair, character, space — so an author who wants "Telephone" does not have to know it is two stacked filter pairs, a honk band, a de-mud band and a soft clip. A preset is DATA. Applying one writes ordinary nodes into `data-fx-chain`, the same nodes hand-building would produce, so there is no second code path beside the rack, nothing new in the render, and no failure mode the chain does not already have. Only the parameters a preset means are listed; the rest come from `normalizeAudioFxParams`, which keeps each entry readable as an intent. `fromPreset` joins `fromCarve` on the node — the id rather than a flag, because a chain can carry more than one preset and each has to find its own nodes. Applying appends (stacking Telephone onto a cleaned voice is a real thing to want), re-applying replaces that preset's own nodes IN PLACE so it keeps its position in the signal order, and hand-added effects are never touched. The repair shelf is named for what it does. None of it is noise reduction — that needs spectral work this effect set does not have — so "Quiet Between Phrases" says it closes the pauses and leaves room tone under speech, rather than implying a denoiser the author only discovers is absent after trusting it. The tests check the DATA, not just the machinery: every effect real, every parameter declared, every value inside its own range, every enum a real option, every chain round-tripping through the attribute, and every preset that lifts level bounded by a limiter that is actually last. Falsified against four mutations — a gain past its maximum, an enum the effect does not offer, an undeclared parameter, and a limiter moved off the end — each caught with the preset and parameter named. Core 1670 -> 1688. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@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