---
title: "pulsing"
description: "A knob that switches on and off in a rhythm, for any slot that takes a prop."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "motion"
categorySlug: "motion"
categoryTitle: "Motion & timing"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/motion.ts#L211"
---

# pulsing

A knob that switches on and off in a rhythm, for any slot that takes a prop.

```ts
pulsing(opts: {period: number; duty: number; soften?: number; clock?: SignalClock}): Scalar
```

Import `motion` from `shaders/std` and use `motion.pulsing`.

`period` is seconds per cycle, `duty` the on fraction, `soften` the edge ease, as in `pulseTrain`. Follows the page clock unless `clock: 'node'` is set.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{period: number; duty: number; soften?: number; clock?: SignalClock}` |  |

## Example

```ts
effect: effects.color.saturate(motion.pulsing({period: 2, duty: 0.5, soften: 0.1})) // color, then gray, then color
```

> **Tip.** Inside `map:` it always follows the layer's clock, so declare `animatedTime: {speed: 'speed'}` there.

## See also

- [`pulseTrain`](/docs/primitives/motion/pulsetrain) — An on/off rhythm: 1 for the first part of each cycle, 0 for the rest.
- [`oscillating`](/docs/primitives/motion/oscillating) — A knob that sweeps between `min` and `max` on its own, for any slot that takes a prop.