mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
c109efe191
simplified oscillators
75 lines
No EOL
1.7 KiB
HTML
75 lines
No EOL
1.7 KiB
HTML
<html>
|
|
<head>
|
|
<title>Oscillator</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
|
|
|
<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="../Tone.js"></script>
|
|
<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">
|
|
|
|
</head>
|
|
<body>
|
|
<div id="Container">
|
|
<div id="Explanation">
|
|
Oscillator
|
|
<br>
|
|
<br>
|
|
An oscillator with an LFO attached to the detune control.
|
|
</div>
|
|
<div id="Content">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
|
|
/* global Tone, GUI*/
|
|
|
|
var osc = new Tone.Oscillator(440, "sine");
|
|
|
|
var vibrato = new Tone.LFO(6, -25, 25);
|
|
vibrato.start();
|
|
|
|
//connect it to the output
|
|
osc.toMaster();
|
|
osc.setVolume(-6);
|
|
vibrato.connect(osc.detune);
|
|
|
|
// GUI //
|
|
|
|
$(function(){
|
|
var content = $("#Content");
|
|
new GUI.StartButton(Tone.startMobile);
|
|
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");
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
#Content {
|
|
text-align: left;
|
|
height: 110px;
|
|
}
|
|
.Checkbox {
|
|
width: 100%;
|
|
}
|
|
.Oscillator {
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|
|
</body>
|
|
</html> |