Tremolo

Modulates the clip's amplitude with a low-frequency oscillator (LFO), creating a rhythmic volume wobble. Classic uses include vintage electric-piano tremolo, radio-signal flutter, and pulsing ambient textures.

Usage

import { Sound, AudioFilters } from '@motion-script/core';

// Via AudioFilters builder — 5 Hz pulse at 60% depth
const clip = new Sound({ src: './piano.mp3', filters: AudioFilters.tremolo({ rate: 5, depth: 0.6 }) });

// Via raw object
const clip = new Sound({
  src: './piano.mp3',
  filters: [{ type: 'tremolo', rate: 5, depth: 0.6 }],
});

Props

PropTypeDefaultDescription
type'tremolo'Filter identifier
ratenumberModulation rate in Hz. How fast the volume pulses
depthnumberModulation depth, 01. 0 = no effect, 1 = volume dips fully to silence on each cycle

Animating

Ramp up the tremolo rate and depth dynamically:

import { Sound, AudioFilters, tween, lerpNumber } from '@motion-script/core';

const clip = new Sound({ src: './pad.mp3', filters: AudioFilters.tremolo({ rate: 1, depth: 0 }) });
clip.start();

// Intensify the wobble over 4 seconds
yield* tween(4, (t) => {
  clip.set({ filters: AudioFilters.tremolo({ rate: lerpNumber(1, 8, t), depth: lerpNumber(0, 0.9, t) }) });
});

Notes

  • The LFO shape is a sine wave: the amplitude rises and falls smoothly on each cycle.
  • At very low rates (< 1 Hz) the effect acts as a slow volume swell rather than a noticeable wobble.
  • At rates above ~20 Hz the modulation enters the audio-frequency range and the effect sounds like amplitude modulation (AM) distortion rather than tremolo.
  • Both rate and depth are fully animatable.