1.0.0 • Published 9 years ago

make-distortion-curve v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

make-distortion-curve

NPM

cuz im tired of copy pasting the only distortion curve i have ever known.

install

npm install make-distortion-curve

use it

var audioCtx = new (window.AudioContext || window.webkitAudioContext)()
var distortion = audioCtx.createWaveShaper()

var makeDistortionCurve = require('make-distortion-curve')
distortion.curve = makeDistortionCurve(400)

code hoisted from http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion and https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createWaveShaper