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>
|
|
|
|
|
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">
|
2014-08-28 04:39:17 +00:00
|
|
|
|
2014-09-04 19:20:25 +00:00
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
2015-06-26 05:23:05 +00:00
|
|
|
<script type="text/javascript" src="./scripts/jquery.min.js"></script>
|
2015-12-05 18:20:53 +00:00
|
|
|
<script type="text/javascript" src="./scripts/draggabilly.js"></script>
|
2016-03-04 22:38:32 +00:00
|
|
|
<script type="text/javascript" src="./scripts/StartAudioContext.js"></script>
|
2015-02-13 20:23:30 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
2016-07-07 21:31:06 +00:00
|
|
|
<script type="text/javascript" src="https://tonejs.github.io/Logo/build/Logo.js"></script>
|
2015-02-13 20:23:30 +00:00
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.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="Content">
|
2015-06-26 05:23:05 +00:00
|
|
|
<div id="Title">Oscillator</div>
|
2015-06-08 14:41:45 +00:00
|
|
|
<div id="Explanation">
|
2016-03-29 23:27:14 +00:00
|
|
|
Click and drag the dot to hear the oscillator. The x-axis controls the frequency of the oscillator and the y-axis controls the volume.
|
2015-06-27 22:02:55 +00:00
|
|
|
<br><br>
|
2016-07-07 20:10:29 +00:00
|
|
|
<a href="https://tonejs.github.io/docs/#Oscillator">Tone.Oscillator</a> docs.
|
2015-06-08 14:41:45 +00:00
|
|
|
</div>
|
|
|
|
<div id="DragContainer"></div>
|
2015-02-13 20:23:30 +00:00
|
|
|
</div>
|
|
|
|
<script id="ToneCode" type="text/javascript">
|
2015-06-08 14:41:45 +00:00
|
|
|
var osc = new Tone.Oscillator({
|
|
|
|
"frequency" : 440,
|
|
|
|
"volume" : -10
|
|
|
|
}).toMaster();
|
2015-02-13 20:23:30 +00:00
|
|
|
</script>
|
|
|
|
<script id="GUI" type="text/javascript">
|
2015-06-08 14:41:45 +00:00
|
|
|
$(function(){
|
|
|
|
|
2016-12-21 04:03:36 +00:00
|
|
|
Interface.Dragger({
|
2015-12-05 18:20:53 +00:00
|
|
|
tone : osc,
|
2015-06-08 14:41:45 +00:00
|
|
|
x : {
|
|
|
|
param : "frequency",
|
2015-12-05 18:20:53 +00:00
|
|
|
min : 60,
|
2015-06-08 14:41:45 +00:00
|
|
|
max : 2000,
|
|
|
|
exp : 2
|
|
|
|
},
|
|
|
|
y : {
|
|
|
|
param : "volume",
|
|
|
|
min : -40,
|
|
|
|
max : 0
|
|
|
|
},
|
|
|
|
start : function(){
|
|
|
|
osc.start();
|
|
|
|
Tone.Master.volume.rampTo(0, 0.05);
|
|
|
|
},
|
|
|
|
end : function(){
|
|
|
|
//so it doesn't click
|
|
|
|
Tone.Master.volume.rampTo(-Infinity, 0.05);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
2014-08-28 04:39:17 +00:00
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|