Fourier Sum
Sine harmonics are drawn one by one, merge into a square wave and a serif caption lands below. A free, MIT-licensed Remotion motion graphic.
$ pnpm dlx shadcn@latest add @remocn/fourier-sumUsage
// src/Root.tsx
import { Composition } from "remotion";
import { FourierSum } from "@/components/remocn/fourier-sum";
const FourierSumScene = () => (
<FourierSum harmonics={[1, 3, 5, 7, 9]} title="Many parts. One signal." />
);
export const RemotionRoot = () => (
<Composition
id="FourierSum"
component={FourierSumScene}
durationInFrames={175}
fps={30}
width={1280}
height={720}
/>
);Rows of sine waves draw in one by one. They then merge in order into a summed wave while a running "1× + 3× + 5×" caption builds, and the title fades in below. Pass harmonics (odd numbers give a square wave), title and periods. Ships dark and light via theme.
Props14
| Prop | Type | Default |
|---|---|---|
| harmonics | number[][1, 3, 5, 7, 9] Harmonic numbers to draw, one wave each. Odd numbers build a square wave. | |
| title | string"Many parts. One signal." Caption shown after the waves merge. | |
| periods | number2 How many wave periods fit across the width. | |
| stagger | number11 Frames between harmonics folding into the sum. | |
| waveFill | booleantrue Tinted area under the final wave. | |
| accent | string"#3B5BFD" Color of the row labels. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Newsreader" Typeface for the title. Load the font in your project first. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| grain | booleantrue Film grain over the scene. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
| theme | "dark" | "light""dark" Color scheme. Ships dark and light. | |
- harmonicsnumber[]
Harmonic numbers to draw, one wave each. Odd numbers build a square wave.
Default
[1, 3, 5, 7, 9] - titlestring
Caption shown after the waves merge.
Default
"Many parts. One signal." - periodsnumber
How many wave periods fit across the width.
Default
2 - staggernumber
Frames between harmonics folding into the sum.
Default
11 - waveFillboolean
Tinted area under the final wave.
Default
true - accentstring
Color of the row labels.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- fontFamilystring
Typeface for the title. Load the font in your project first.
Default
"Newsreader" - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - grainboolean
Film grain over the scene.
Default
true - speednumber
Playback speed multiplier for the whole timeline.
Default
1 - theme"dark" | "light"
Color scheme. Ships dark and light.
Default
"dark"