mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
67 lines
No EOL
1.7 KiB
HTML
67 lines
No EOL
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>AUTOPANNER</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
|
|
<script type="text/javascript" src="./deps/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
|
<script type="text/javascript" src="./deps/nexusUI.js"></script>
|
|
<script type="text/javascript" src="./deps/prism.js"></script>
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
<link rel="stylesheet" type="text/css" href="./style/prism.css">
|
|
|
|
<script type="text/javascript">
|
|
// jshint ignore: start
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="Explanation">
|
|
Auto Panner
|
|
<br>
|
|
<br>
|
|
An Auto Panner is a left/right panner with an LFO controlling
|
|
the amount of pan. The effect is much more pronounced with headphones.
|
|
</div>
|
|
<div id="Content">
|
|
<div id="Rack"></div>
|
|
<div id="Code"></div>
|
|
</div>
|
|
<script id="JSCode" type="text/javascript">
|
|
//the panner
|
|
var panner = new Tone.AutoPanner({
|
|
"frequency" : 4,
|
|
"amount" : 1
|
|
}).toMaster();
|
|
|
|
//the input signal
|
|
var osc = new Tone.Oscillator({
|
|
"volume" : -6,
|
|
"type" : "triangle"
|
|
}).connect(panner);
|
|
</script>
|
|
<script id="gui" type="text/javascript">
|
|
|
|
Interface.Rack("Rack", "AutoPanner");
|
|
|
|
Interface.Toggle("Rack", function(on){
|
|
if (on){
|
|
panner.start();
|
|
osc.start();
|
|
} else {
|
|
panner.stop();
|
|
osc.stop();
|
|
}
|
|
})
|
|
Interface.HorizontalSlider("Rack", panner, "amount");
|
|
Interface.HorizontalSlider("Rack", panner, "frequency", 0.4, 10);
|
|
Interface.Code("Code", "JSCode");
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |