Tone.js/examples/lfoEffects.html

140 lines
3.1 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>LFO Effects</title>
2015-06-27 22:10:18 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
2015-12-08 05:06:58 +00:00
<link rel="icon" type="image/png" sizes="174x174" href="./style/favicon.png">
<script src="../build/Tone.js"></script>
<script src="./scripts/jquery.min.js"></script>
<script src="./scripts/draggabilly.js"></script>
<script src="./scripts/StartAudioContext.js"></script>
<script src="./scripts/Interface.js"></script>
<script src="https://tonejs.github.io/Logo/build/Logo.js"></script>
<link rel="stylesheet" type="text/css" href="./style/examples.css">
<script>
// jshint ignore: start
</script>
</head>
<body>
<div id="Content">
2015-06-26 05:23:05 +00:00
<div id="Title">LFO Effects</div>
<div id="Explanation">
These effects use an <a href="https://tonejs.github.io/docs/#LFO">LFO</a> (Low Frequency Oscillator) to modulate the effect. Click and drag the dot to change the frequency and depth of the effect.
2015-06-27 22:02:55 +00:00
<br><br>
Docs on <a href="https://tonejs.github.io/docs/#AutoPanner">Tone.AutoPanner</a>,
<a href="https://tonejs.github.io/docs/#AutoFilter">Tone.AutoFilter</a>, and
<a href="https://tonejs.github.io/docs/#Tremolo">Tone.Tremolo</a>
</div>
<div id="DragContainer">
</div>
</div>
<script id="JSCode">
//AutoPanner - a penning modulation effect
var panner = new Tone.AutoPanner({
"frequency" : 4,
"depth" : 1
}).toMaster().start();
//AutoFilter - a filter modulation effect
var filter = new Tone.AutoFilter({
"frequency" : 2,
"depth" : 0.6
}).toMaster().start();
//Tremolo - an amplitude modulation effect
var tremolo = new Tone.Tremolo({
"frequency" : 0.6,
"depth" : 0.7
}).toMaster().start();
//the input oscillators
var osc0 = new Tone.Oscillator({
2015-06-26 05:23:05 +00:00
"volume" : -Infinity,
"type" : "square6",
"frequency" : "C4"
}).connect(panner).start();
var osc1 = new Tone.Oscillator({
2015-06-26 05:23:05 +00:00
"volume" : -Infinity,
"type" : "square6",
"frequency" : "E4"
}).connect(filter).start();
var osc2 = new Tone.Oscillator({
2015-06-26 05:23:05 +00:00
"volume" : -Infinity,
"type" : "square6",
"frequency" : "A4"
}).connect(tremolo).start();
2017-03-26 20:39:19 +00:00
// GUI //
Interface.Dragger({
tone : panner,
x : {
param : "frequency",
min : 0.1,
max : 8
},
y : {
param : "depth",
min : 0.5,
max : 1
},
start : function(){
osc0.volume.rampTo(0, 0.1);
},
end : function(){
osc0.volume.rampTo(-Infinity, 0.1);
}
});
Interface.Dragger({
tone : filter,
x : {
param : "frequency",
min : 0.1,
max : 8
},
y : {
param : "depth",
min : 0.5,
max : 1
},
start : function(){
osc1.volume.rampTo(0, 0.1);
},
end : function(){
osc1.volume.rampTo(-Infinity, 0.1);
}
});
Interface.Dragger({
tone : tremolo,
x : {
param : "frequency",
min : 0.1,
max : 8
},
y : {
param : "depth",
min : 0.5,
max : 1
},
start : function(){
osc2.volume.rampTo(0, 0.1);
},
end : function(){
osc2.volume.rampTo(-Infinity, 0.1);
}
});
</script>
2017-03-26 20:39:19 +00:00
</body>
</html>