06-19-2021, 05:28 PM
Hi all. I'm working on adding a distortion filter to OS, but I'm having some trouble getting distortion curves that sound cool. So I need your help.
Distortion curves take sound input in the range -1 to 1, and map it to some output based on the curve:
Some other examples of distortion curves I'm playing with:
These curves are described by a list of numbers, eg [-1, 0.5, 0, 0.5, 1] would be a straight line (and so wouldn't do anything ). The first number in the list controls where -1 is mapped to, the last number says where 1 is mapped to, and the middle number is where 0 is mapped to.
If you want to help invent some wave shaping curves, open a new OS tab, and before you do anything, run this code in the JS console (ctrl+shift+J to open the console). This code replaces the reverb effect, so you can test it by enabling reverb on an instrument. If you want to change the curve, don't rerun the whole chunk of JS, just the last line where the curve is defined. You can have an many or as few numbers in the list as you want. A good way of generating numbers for the curve is to use a Google Sheets.
If you invent anything cool, post the list of numbers here, and tell me what it sounds like. Your curve might end up in OS
Distortion curves take sound input in the range -1 to 1, and map it to some output based on the curve:
Some other examples of distortion curves I'm playing with:
These curves are described by a list of numbers, eg [-1, 0.5, 0, 0.5, 1] would be a straight line (and so wouldn't do anything ). The first number in the list controls where -1 is mapped to, the last number says where 1 is mapped to, and the middle number is where 0 is mapped to.
If you want to help invent some wave shaping curves, open a new OS tab, and before you do anything, run this code in the JS console (ctrl+shift+J to open the console). This code replaces the reverb effect, so you can test it by enabling reverb on an instrument. If you want to change the curve, don't rerun the whole chunk of JS, just the last line where the curve is defined. You can have an many or as few numbers in the list as you want. A good way of generating numbers for the curve is to use a Google Sheets.
Code:
audioSystem.convolver = audioSystem.audioContext.createWaveShaper();
audioSystem.convolver.oversample = '4x';
audioSystem.convolver.connect(audioSystem.destination);
audioSystem.convolver.curve = Float32Array.of(-1, -1, -1, 0, 1, 1, 1);
If you invent anything cool, post the list of numbers here, and tell me what it sounds like. Your curve might end up in OS