2014-04-06 00:47:59 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-04-16 00:05:11 +00:00
|
|
|
<title>Effect Example</title>
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
2014-04-06 00:47:59 +00:00
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<input type='range'>
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//extend effect
|
|
|
|
var NoiseEffect = function(){
|
|
|
|
//call the super class
|
|
|
|
Tone.Effect.call(this);
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//components
|
|
|
|
this.noise = new Tone.Noise("brown");
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//connections
|
|
|
|
this.connectEffect(this.noise);
|
|
|
|
}
|
|
|
|
//extend effect
|
|
|
|
Tone.extend(NoiseEffect, Tone.Effect);
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//make a new one
|
|
|
|
var noiseEffect = new NoiseEffect();
|
|
|
|
noiseEffect.toMaster();
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//INTERFACE//
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
var range = document.querySelector("input");
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
range.onchange = function(){
|
|
|
|
var val = range.value;
|
|
|
|
noiseEffect.setDry(val / 50 - 1);
|
|
|
|
}
|
2014-04-06 00:47:59 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|