working with WebAudio API and trying to get distortion going! Issue is, I'm not sure how to get into the "curve" param of WaveShaper.
Simply put, 'oscidis' is a WaveShaper node created earlier in the program. Oscidisv is a value I have set to 0 statically, for now.:
var wsCurve = new Float32Array();
if ((oscidisv >= -1) && (oscidisv < 1)) {
var k = 2 * oscidisv / (1 - oscidisv);
console.log
for (var i = 0; i < 16; i+=1) {
// LINEAR INTERPOLATION: x := (c - a) * (z - y) / (b - a) + y
// a = 0, b = 2048, z = 1, y = -1, c = i
var x = (i - 0) * (1 - (-1)) / (16 - 0) + (-1);
wsCurve[i] = (1 + k) * x / (1+ k * Math.abs(x));
}
}
oscidis.curve.value = wsCurve;
The issue - I'm not hearing any difference in sound regardless of what I put here )-=. I don't notice any real distortion even with the distortion at max (1). Do you guys know anything about a more noticeable distortion waveshaping function? Or if I'm doing this right at all in the WebAudio API?