Tone.js/examples/noiseEffect.html

40 lines
736 B
HTML
Raw Normal View History

2014-04-06 00:47:59 +00:00
<html>
<head>
<title>Effect Example</title>
2014-04-06 00:47:59 +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">
//extend effect
var NoiseEffect = function(){
//call the super class
Tone.Effect.call(this);
2014-04-06 00:47:59 +00:00
//components
this.noise = new Tone.Noise("brown");
2014-04-06 00:47:59 +00:00
//connections
this.connectEffect(this.noise);
}
//extend effect
Tone.extend(NoiseEffect, Tone.Effect);
2014-04-06 00:47:59 +00:00
//make a new one
var noiseEffect = new NoiseEffect();
noiseEffect.toMaster();
2014-04-06 00:47:59 +00:00
//INTERFACE//
2014-04-06 00:47:59 +00:00
var range = document.querySelector("input");
2014-04-06 00:47:59 +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>