Skip to content

Instantly share code, notes, and snippets.

@beefchimi
Last active November 6, 2017 21:00
Show Gist options
  • Save beefchimi/eb9c68d489a071730ef36e894e375c9c to your computer and use it in GitHub Desktop.
Save beefchimi/eb9c68d489a071730ef36e894e375c9c to your computer and use it in GitHub Desktop.
Reverse conditional for setGain method
_setGain(reverse, duration) {
this.gainNode.gain.setValueAtTime(1, this.context.currentTime);
if (reverse) {
this.gainNode.gain.exponentialRampToValueAtTime(0.5, this.context.currentTime + duration);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment