Last active
July 10, 2017 23:55
-
-
Save softpunch/a2c1a9126d11768397825892f42e1e2c to your computer and use it in GitHub Desktop.
Make Signals Work (Modulation, Range, Translation, Application, Interpolation)
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
// make a signal do what you want it to do | |
// | |
// LFO manipulation | |
// (assume the signal ranges from -1 to 1) | |
// make the value range 0-1 (no negative numbers, aka unsigned) | |
var destination = (signal + 1) / 2; | |
// adjust another number/value using the LFO signal | |
var destination = initialVal + (signal); | |
// same as above, but with +/- 0.5 | |
var destination = initialVal + (signal/2); | |
// scaling methods | |
// squash or stretch a source signal to a destination range | |
var source = signal; | |
var sourceRange = sourceMax - sourceMin; | |
var destinationRange = destMax - destMin; | |
var destination = destMin + (destinationRange)(source - sourceMin) / (sourceRange); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment