Last active
November 21, 2016 19:28
-
-
Save notepadwebdev/75eaa5f14153424d59c3135151f1f133 to your computer and use it in GitHub Desktop.
Animating speaker cone elements based on frequency bin volume data
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
// bin 3 : ~86 Hz | |
let percVol = this.dataArray[2] / 255; | |
TweenLite.to(this.wooferConeOuter, 0.001, {css:{scale: (1 + (percVol * 0.05)) }}); | |
// bin 8 : ~301 Hz | |
percVol = this.dataArray[7] / 255; | |
TweenLite.to(this.wooferConeMid, 0.001, {css:{scale: (1 + (percVol * 0.1)) }}); | |
// bin 17 : ~689 Hz | |
percVol = this.dataArray[16] / 255; | |
TweenLite.to(this.wooferConeInner, 0.001, {css:{scale: (1 + (percVol * 0.1)) }}); | |
// bin 221 : ~9,500 Hz | |
percVol = this.dataArray[220] / 255; | |
TweenLite.to(this.tweeterConeInner, 0.001, {css:{scale: (1 + (percVol * 0.09)) }}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment