This file contains hidden or 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
| export function mapNumber(v, fn, fx, tn, tx, constrain = true){ | |
| if(fx == fn) | |
| return v < fn ? tn : tx; | |
| v = (v - fn) / (fx - fn); | |
| if(constrain) | |
| v = Math.min(1, Math.max(0, v)); | |
This file contains hidden or 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
| /** | |
| * @protected {number} lastFrequency => In hertz, initialized as 0 | |
| * @protected {number} sampleRate => Audio output sample rate (e.g.: 8000 for 8KHz, 16000 for 16KHz, 44100 for 44.1KHz, 48000 for 48KHz and so on) | |
| * @protected {number} frame => Current accumulative sample index | |
| * @protected {number} offset => Accumulative phase, initialized as 0 | |
| * | |
| * @param {number} frequency in hertz | |
| * | |
| * @returns {number} sample (-1 <= sample <= 1) | |
| */ |
This file contains hidden or 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
| /*Box sizing (the nuclear option) */ | |
| *, *:before, *:after { | |
| -ms-box-sizing: border-box; | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing:border-box; | |
| box-sizing: border-box; | |
| } | |
| /* Fix font rendering defaults */ | |
| html, button { |