Published
Edited
Feb 16, 2018
Fork of Kick Drum
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
triggerSnareDrum = (now) => {
const noiseEnvelope = context.createGain();
noiseEnvelope.gain.setValueAtTime(1, now);
noiseEnvelope.gain.exponentialRampToValueAtTime(0.01, now + 0.2);
noiseEnvelope.connect(context.destination);
const noiseFilter = context.createBiquadFilter();
noiseFilter.type = 'highpass';
noiseFilter.frequency.value = 1000;
noiseFilter.connect(noiseEnvelope);
const noise = context.createBufferSource();
noise.buffer = noiseBuffer();
noise.connect(noiseFilter);
noise.start(now)
noise.stop(now + 0.2);

const oscillatorEnvelope = context.createGain()
oscillatorEnvelope.gain.setValueAtTime(0.7, now);
oscillatorEnvelope.gain.exponentialRampToValueAtTime(0.01, now + 0.1);
oscillatorEnvelope.connect(context.destination)

const oscillator = context.createOscillator()
oscillator.type = 'triangle'
oscillator.frequency.setValueAtTime(100, now);
oscillator.connect(oscillatorEnvelope)
oscillator.start(now)
oscillator.stop(now + 0.2);
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more