I’m trying to make some audio signals with web audio API. And I want to add some bias to my audio signal in web/js. How can I bias up/down audio signal like this image?
image from https://www.csounds.com/tootsother/east/Bias/Bias.html
I made some oscillators and I couldn’t find clues in my searching ability.
const ac = new AudioContext();
const leftOsc = ac.createOscillator();
const leftGain = ac.createGain();
const rightOsc = ac.createOscillator();
const rightGain = ac.createGain();
const merger = ac.createChannelMerger(2);
leftOsc.connect(leftGain);
leftGain.connect(merger, 0, 0);
rightOsc.connect(rightGain);
rightGain.connect(merger, 0, 1);
leftOsc.type = 'sine';
leftOsc.frequency.value = 440;
leftGain.gain.value = 0.5;
leftOsc.start();
rightOsc.type = 'sine';
rightOsc.frequency.value = 440;
rightGain.gain.value = 0.5;
rightOsc.start();
merger.connect(ac.destination);