switched bit crusher for distortion

same idea much better performance
This commit is contained in:
Yotam Mann 2014-11-01 15:03:43 -04:00
parent aee8885a5b
commit b95313b4b2
2 changed files with 5 additions and 9 deletions

View file

@ -25,7 +25,7 @@
Each of the dots' positions controls two parameters of an effects. <br>
<span id="red">Lowpass Filter</span>: x = frequency, y = Q <br>
<span id="green">Filter LFO</span>: x = rate, y = depth<br>
<span id="blue">Bitcrusher</span>: x = bits, y = amount<br>
<span id="blue">Distortion</span>: x = amount, y = mix<br>
</div>
<div id="Content">
<div id="Loading">LOADING...</div>
@ -44,8 +44,7 @@
player.loop = true;
//bit crusher
var bitCrushBits = 8;
var crusher = new Tone.BitCrusher(bitCrushBits);
var crusher = new Tone.Distortion(0.7);
player.connect(crusher);
//a lowpass filter
@ -100,11 +99,8 @@
filterLFO.setFrequency(filterFeq);
//bit crusher
var crusherMix = crusher.interpolate(values[2].y, 0, 1);
var bits = Math.round(crusher.interpolate(values[2].x, 8, 3));
if (bits !== bitCrushBits){
crusher.setBits(bits);
bitCrushBits = bits;
}
var distortion = crusher.interpolate(values[2].x, 0.2, 1.5);
crusher.setDistortion(distortion);
crusher.setDry(crusherMix);
}, 100);
});

View file

@ -43,7 +43,7 @@
//DRUMS//
//hats
var crusher = new Tone.BitCrusher(5);
var crusher = new Tone.Distortion(10);
crusher.setWet(0.4);
var hats = new Tone.Sampler({
"url" : "./audio/505/hh.mp3",