2014-10-22 22:49:42 +00:00
|
|
|
<!DOCTYPE html>
|
2014-06-23 17:29:22 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-10-22 22:49:42 +00:00
|
|
|
<meta charset="utf-8">
|
2014-06-23 17:29:22 +00:00
|
|
|
<title>Oscillator</title>
|
|
|
|
|
2014-09-06 19:35:31 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
2014-08-28 04:39:17 +00:00
|
|
|
|
2014-09-04 19:20:25 +00:00
|
|
|
<script type="text/javascript" src="./deps/jquery.min.js"></script>
|
|
|
|
<script type="text/javascript" src="./deps/jquery-ui.js"></script>
|
|
|
|
<script type="text/javascript" src="./deps/jquery.ui.touch-punch.js"></script>
|
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
2014-08-28 04:39:17 +00:00
|
|
|
<script type="text/javascript" src="./Widgets.js"></script>
|
|
|
|
<script type="text/javascript" src="./ExampleList.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/widgets.css">
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/jquery-ui.css">
|
2014-06-23 17:29:22 +00:00
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
2014-08-28 04:39:17 +00:00
|
|
|
<div id="Container">
|
|
|
|
<div id="Explanation">
|
|
|
|
Oscillator
|
|
|
|
<br>
|
|
|
|
<br>
|
2014-08-28 04:45:59 +00:00
|
|
|
An oscillator with an LFO attached to the detune control.
|
2014-08-28 04:39:17 +00:00
|
|
|
</div>
|
|
|
|
<div id="Content">
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-06-23 17:29:22 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
2014-08-28 04:39:17 +00:00
|
|
|
/* global Tone, GUI*/
|
|
|
|
|
|
|
|
var osc = new Tone.Oscillator(440, "sine");
|
|
|
|
|
2014-08-28 04:45:59 +00:00
|
|
|
var vibrato = new Tone.LFO(6, -25, 25);
|
2014-08-28 04:39:17 +00:00
|
|
|
vibrato.start();
|
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
//connect it to the output
|
|
|
|
osc.toMaster();
|
2014-09-02 16:10:10 +00:00
|
|
|
osc.setVolume(-10);
|
2014-08-28 04:45:59 +00:00
|
|
|
vibrato.connect(osc.detune);
|
2014-08-28 04:39:17 +00:00
|
|
|
|
|
|
|
// GUI //
|
2014-06-23 17:29:22 +00:00
|
|
|
|
2014-08-28 04:39:17 +00:00
|
|
|
$(function(){
|
|
|
|
var content = $("#Content");
|
|
|
|
new GUI.TopBar(Tone);
|
|
|
|
new GUI.Checkbox(content, function(on){
|
|
|
|
if (on){
|
|
|
|
osc.start();
|
|
|
|
} else {
|
|
|
|
osc.stop();
|
|
|
|
}
|
|
|
|
}, "start", "stop");
|
|
|
|
new GUI.Oscillator(content, osc, "oscillator");
|
|
|
|
new GUI.Oscillator(content, vibrato.oscillator, "vibrato osc");
|
2014-06-23 17:29:22 +00:00
|
|
|
});
|
2014-08-28 04:39:17 +00:00
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
|
|
|
|
</script>
|
2014-08-28 04:39:17 +00:00
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
#Content {
|
|
|
|
text-align: left;
|
2014-08-28 04:45:59 +00:00
|
|
|
height: 110px;
|
2014-09-02 16:10:10 +00:00
|
|
|
width: 240px;
|
2014-08-28 04:39:17 +00:00
|
|
|
}
|
|
|
|
.Checkbox {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.Oscillator {
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
|
|
|
</style>
|
2014-06-23 17:29:22 +00:00
|
|
|
</body>
|
|
|
|
</html>
|