Last active
October 22, 2017 23:49
-
-
Save beefchimi/f8451d6407118e4ca379a86c247b5fff to your computer and use it in GitHub Desktop.
Speed method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
speed(speed = 1) { | |
// Ramp up faster when increasing speed, slower if decreasing | |
const duration = (speed > 1) ? durationRamp.up : durationRamp.down; | |
for (let i = 0; i < this.trackCount; i++) { | |
this.sources[`source${i}`].playbackRate.exponentialRampToValueAtTime( | |
speed, | |
this.context.currentTime + duration | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment