audio

@audio/synth-sfx1.1.4

Game/UI sound effects generator

Game/UI sound effects generator — ZZFX / ChipTone class parameterized synthesis

Status
calibrated
Updated
Family
synth, 20 packages under it
Plugin
sfx, generator, whole signal, 1 parameter
Category
synthesis
Licence
MIT
Dependencies
1 package, all permissive: MIT
Downloads
2,129 last month
Tests
94 in audiojs/synth's CI, passed at f613513,

Listen

audio.from(0.6).sfx()

Parameters

  • generator
  • whole signal
preset
pickup, laser, explosion, powerup, hit, jump, blip, coin

ZZFX-class parameterized SFX, 8 deterministic presets

import sfx, { PRESETS } from '@audio/synth-sfx'

Game/UI sound-effect generator (ZZFX/sfxr class): one parameterized pipeline — shaped oscillator → frequency slide/vibrato/arpeggio → ADSR-ish envelope → optional lowpass/bitcrush — behind 8 named presets covering the sfxr archetypes (pickup, laser, explosion, powerup, hit, jump, blip, coin). Every field is overridable; noise is seeded, so renders are reproducible.

sfx('laser')                          // named preset
sfx('coin', { seed: 42 })             // preset + override
sfx({ freq: 500, shape: 'square' })   // full custom parameter object
Param Default
preset 'blip' Preset name or full parameter object (positional)
freq preset Base frequency, Hz
shape preset 'sine' | 'square' | 'saw' | 'triangle' | 'noise'
slide 0 Octaves/second exponential pitch slide
vibrato / vibratoDepth 0 / 0.1 Hz / depth
arp / arpAt 0 / 0.05 Frequency multiplier stepped at arpAt seconds
attack / sustain / release 0.005 / 0.08 / 0.12 Seconds
lowpass 0 One-pole lowpass cutoff, Hz (0 = off)
crush 0 0..1 bitcrush amount
amp 0.8 Peak amplitude
seed — Noise PRNG seed
fs 44100 Sample rate

Use when: deterministic game/UI SFX without shipping audio assets.


Part of @audio/synth — the synth family umbrella.

MIT © audiojs