LIVE OSCILLOSCOPE
8000Hz LPF · 0st
Kategori:
Web Audio API · Canlı sinyal analiziBaşlatmak için bir pede dokunun
Web Audio Synth Pad Stüdyosu
16 farklı UI & Arcade ses önayarı, 8-adımlı ritim dizici ve sıfır ses dosyası gerektiren saf Web Audio sentez motoru.
Master FX & Sentez Parametreleri:
Frekans / Pitch Transpose:0 semitones
Lowpass Filter (Ton Sıcaklığı):8000 Hz
Echo / Delay:Kapalı
Yankı Geri Beslemesi:30%
Ana Ses Düzeyi (Volume):40%
Kod Formatı:
// Reuse one AudioContext so repeated UI sounds stay responsive.
const ctx = new (window.AudioContext || window.webkitAudioContext)();
function triggerSound(freq = 440, type = 'sine', decay = 0.25, sweep) {
if (ctx.state === 'suspended') ctx.resume();
const now = ctx.currentTime;
const osc = ctx.createOscillator();
const gain = ctx.createGain();
const filter = ctx.createBiquadFilter();
const finalFreq = freq * Math.pow(2, 0/12);
osc.type = type;
osc.frequency.setValueAtTime(finalFreq, now);
if (sweep) osc.frequency.exponentialRampToValueAtTime(sweep * Math.pow(2, 0/12), now + decay);
filter.type = 'lowpass';
filter.frequency.setValueAtTime(8000, now);
gain.gain.setValueAtTime(0.4, now);
gain.gain.exponentialRampToValueAtTime(0.0001, now + decay);
osc.connect(filter);
filter.connect(gain);
gain.connect(ctx.destination);
osc.start(now);
osc.stop(now + decay + 0.02);
osc.onended = () => { osc.disconnect(); filter.disconnect(); gain.disconnect(); };
}