Skip to content

Instantly share code, notes, and snippets.

@tcdw
Created March 10, 2019 15:47
Show Gist options
  • Save tcdw/28c1979991213b0a97ecb2dc87369bfd to your computer and use it in GitHub Desktop.
Save tcdw/28c1979991213b0a97ecb2dc87369bfd to your computer and use it in GitHub Desktop.
echo ripper
function convertEchoVolume(masterL, masterR, echoL, echoR) {
const mL = masterL > 127 ? 256 - masterL : masterL;
const mR = masterR > 127 ? 256 - masterR : masterR;
const eL = echoL > 127 ? 256 - echoL : echoL;
const eR = echoR > 127 ? 256 - echoR : echoR;
return {
echoL: eL * 128 / mL,
echoR: eR * 128 / mR
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment