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="../build/Tone.js"></script>
|
2015-02-13 20:23:30 +00:00
|
|
|
<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>
|
2014-06-23 17:29:22 +00:00
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
2015-02-13 20:23:30 +00:00
|
|
|
<div id="Explanation">
|
|
|
|
Oscillator
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
An oscillator with an LFO attached to the detune control.
|
2014-08-28 04:39:17 +00:00
|
|
|
</div>
|
2015-02-13 20:23:30 +00:00
|
|
|
<div id="Content">
|
|
|
|
<div id="Rack"></div>
|
|
|
|
<div id="Code"></div>
|
|
|
|
</div>
|
|
|
|
<script id="ToneCode" type="text/javascript">
|
|
|
|
var osc = new Tone.Oscillator(440, "sine").toMaster();
|
|
|
|
osc.volume.value = -10;
|
2014-06-23 17:29:22 +00:00
|
|
|
|
2015-02-13 20:23:30 +00:00
|
|
|
var vibrato = new Tone.LFO(6, -25, 25)
|
|
|
|
.connect(osc.detune)
|
|
|
|
.start();
|
|
|
|
</script>
|
|
|
|
<script id="GUI" type="text/javascript">
|
|
|
|
Interface.Rack("Rack", "Oscillator");
|
|
|
|
Interface.Toggle("Rack", function(on){
|
|
|
|
if (on){
|
|
|
|
osc.start();
|
|
|
|
} else {
|
|
|
|
osc.stop();
|
|
|
|
}
|
2014-06-23 17:29:22 +00:00
|
|
|
});
|
2015-02-13 20:23:30 +00:00
|
|
|
Interface.DropDown("Rack", osc, "type", ["sine", "square", "triangle", "sawtooth"], "Oscillator Type");
|
|
|
|
Interface.DropDown("Rack", vibrato, "type", ["sine", "square", "triangle", "sawtooth"], "LFO Type");
|
|
|
|
Interface.Code("Code", "ToneCode");
|
2014-08-28 04:39:17 +00:00
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|