Tone.js/examples/noises.html

55 lines
1.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
2014-06-20 04:25:00 +00:00
<html>
<head>
<meta charset="utf-8">
2014-06-20 04:25:00 +00:00
<title>NOISES</title>
2014-09-06 19:35:31 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script type="text/javascript" src="../build/Tone.js"></script>
2015-02-12 03:39:28 +00:00
<script type="text/javascript" src="../build/Tone.Preset.js"></script>
<script type="text/javascript" src="./deps/jquery.min.js"></script>
<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>
2014-06-20 04:25:00 +00:00
2015-02-12 03:39:28 +00:00
<link rel="stylesheet" type="text/css" href="./style/examples.css">
<link rel="stylesheet" type="text/css" href="./style/prism.css">
2014-06-20 04:25:00 +00:00
<script type="text/javascript">
2015-02-12 03:39:28 +00:00
// jshint ignore: start
2014-06-20 04:25:00 +00:00
</script>
2014-09-04 04:06:01 +00:00
2015-02-12 03:39:28 +00:00
</head>
<body>
<div id="Explanation">
Noise
<br>
<br>
Tone has 3 different types of noise. Careful, it's loud!
</div>
<div id="Content">
<div id="Rack"></div>
<div id="CodeRack"></div>
</div>
<script id="ToneCode" type="text/javascript">
//make the noise and connect it to the output
var noise = new Tone.Noise().toMaster();
//so it's not too loud
noise.volume.value = -20;
</script>
<script id="GUI" type="text/javascript">
Interface.Rack("Rack", "Noise");
Interface.Toggle("Rack", function(on){
if (on){
noise.start();
} else {
noise.stop();
}
});
2015-02-13 20:23:30 +00:00
Interface.DropDown("Rack", noise, "type", ["white", "brown", "pink"]);
2015-02-12 03:39:28 +00:00
Interface.Code("CodeRack", "ToneCode");
</script>
2014-06-20 04:25:00 +00:00
</body>
</html>