mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
eea83d1728
add Logo, updated qwerty hancock & nexusUI
68 lines
No EOL
1.7 KiB
HTML
68 lines
No EOL
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Oscillator</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
|
<script type="text/javascript" src="./scripts/jquery.min.js"></script>
|
|
<script type="text/javascript" src="./scripts/draggabilly.js"></script>
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
|
<script type="text/javascript" src="./scripts/Logo.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
|
|
<script type="text/javascript">
|
|
// jshint ignore: start
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="Content">
|
|
<div id="Title">Oscillator</div>
|
|
<div id="Explanation">
|
|
Click and drag the dot to hear the oscillator. The x-axis controls the freqency of the oscillator and the y-axis controls the volume.
|
|
<br><br>
|
|
<a href="http://tonejs.org/docs/#Oscillator">Tone.Oscillator</a> docs.
|
|
</div>
|
|
<div id="DragContainer"></div>
|
|
</div>
|
|
<script id="ToneCode" type="text/javascript">
|
|
var osc = new Tone.Oscillator({
|
|
"frequency" : 440,
|
|
"volume" : -10
|
|
}).toMaster();
|
|
</script>
|
|
<script id="GUI" type="text/javascript">
|
|
$(function(){
|
|
|
|
new Interface.Dragger({
|
|
tone : osc,
|
|
x : {
|
|
param : "frequency",
|
|
min : 60,
|
|
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);
|
|
}
|
|
});
|
|
})
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html> |