Daily Task Tool LogoDaily Task Tool

Retro SFX Generator

Back

Presets

Oscillator & Waveform

Start Freq:1200 Hz
End Freq (Sweep):100 Hz
Sound Duration:0.25 s

Volume Envelope (ADSR)

Attack Time:0 s
Decay Time:0.18 s
Sustain Level:10%
Release Time:0.05 s

Modulation & Filter

Filter Cutoff:8000 Hz
Filter Sweep:-4000 Hz
Vibrato Depth:0 Hz
Vibrato Speed:0 Hz

Oscilloscope Visualizer

Playback

Master Volume:50%

Export Asset

Developer Usage

Modify sliders to customize sound parameters or load predefined 8-bit retro sound presets. Use the Download WAV button to get clean PCM audio assets for games or video projects. Use the Copy Web Audio JS button to copy a zero-dependency JavaScript function that synthesizes this sound natively in the browser without loading heavy audio assets.

function playRetroSFX() {
  const AudioContext = window.AudioContext || window.webkitAudioContext;
  const ctx = new AudioContext();
  const now = ctx.currentTime;
  const volume = 0.5;
  
  const decayEnd = 0 + 0.18;
  const releaseStart = Math.max(decayEnd, 0.25 - 0.05);
  const totalDuration = releaseStart + 0.05;

  // ADSR Gain Envelope Node
  const gainNode = ctx.createGain();
  gainNode.gain.setValueAtTime(0, now);
  gainNode.gain.linearRampToValueAtTime(volume, now + 0);
  gainNode.gain.linearRampToValueAtTime(volume * 0.1, now + 0 + 0.18);
  gainNode.gain.setValueAtTime(volume * 0.1, now + releaseStart);
  gainNode.gain.linearRampToValueAtTime(0, now + totalDuration);

  // Source Node
  let sourceNode;
  const osc = ctx.createOscillator();
  osc.type = "square";
  osc.frequency.setValueAtTime(1200, now);
  osc.frequency.linearRampToValueAtTime(100, now + 0.25);
  
  if (0 > 0 && 0 > 0) {
    const lfo = ctx.createOscillator();
    const lfoGain = ctx.createGain();
    lfo.frequency.setValueAtTime(0, now);
    lfoGain.gain.setValueAtTime(0, now);
    lfo.connect(lfoGain);
    lfoGain.connect(osc.frequency);
    lfo.start(now);
    lfo.stop(now + totalDuration);
  }
  sourceNode = osc;

  // Low Pass Filter Node
  const filterNode = ctx.createBiquadFilter();
  filterNode.type = "lowpass";
  filterNode.Q.setValueAtTime(1.0, now);
  filterNode.frequency.setValueAtTime(8000, now);
  filterNode.frequency.linearRampToValueAtTime(
    Math.max(100, 8000 + -4000),
    now + 0.25
  );

  // Connect & Play
  sourceNode.connect(filterNode);
  filterNode.connect(gainNode);
  gainNode.connect(ctx.destination);

  sourceNode.start(now);
  sourceNode.stop(now + totalDuration);
}