pulseTrain
An on/off rhythm: 1 for the first part of each cycle, 0 for the rest.
pulseTrain(
t: Expr,
opts: {period: Expr | number; duty: Expr | number; soften?: number},
): Expr
Import motion from shaders/std and use motion.pulseTrain.
period is seconds per cycle and duty is the on fraction, 0..1. soften eases both edges over that fraction of the cycle. Leave it at 0 for a hard blink.
Parameters
| Name | Type | Notes |
|---|---|---|
t | Expr | |
opts | {period: Expr | number; duty: Expr | number; soften?: number} |
Example
const blink = motion.pulseTrain(animatedTime(params), {period: 1.5, duty: 0.3, soften: 0.05})