mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
switched bit crusher for distortion
same idea much better performance
This commit is contained in:
parent
aee8885a5b
commit
b95313b4b2
2 changed files with 5 additions and 9 deletions
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue