Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions step-sequencer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ <h2>DTMF</h2>
);

// Expose attack time & release time
const sweepLength = 2;
function playSweep(time) {
const osc = new OscillatorNode(audioCtx, {
frequency: 380,
Expand All @@ -236,12 +235,12 @@ <h2>DTMF</h2>
sweepEnv.gain.linearRampToValueAtTime(1, time + attackTime);
sweepEnv.gain.linearRampToValueAtTime(
0,
time + sweepLength - releaseTime
time + attackTime + releaseTime
);

osc.connect(sweepEnv).connect(audioCtx.destination);
osc.start(time);
osc.stop(time + sweepLength);
osc.stop(time + attackTime + releaseTime);
}

// Expose frequency & frequency modulation
Expand Down