Tone.js/examples/noises.html

78 lines
1.8 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-06-26 05:23:05 +00:00
<script type="text/javascript" src="./scripts/jquery.min.js"></script>
2015-06-07 18:05:59 +00:00
<script type="text/javascript" src="../../Notone.js/build/Notone.GUI.js"></script>
2015-02-12 03:39:28 +00:00
<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">
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>
2015-06-07 18:05:59 +00:00
<style type="text/css">
.Dragger#Noise {
left: 50%;
}
</style>
2015-02-12 03:39:28 +00:00
<div id="Content">
2015-06-26 05:23:05 +00:00
<div id="Title">Noise</div>
2015-06-07 18:05:59 +00:00
<div id="Explanation">
2015-06-27 22:02:55 +00:00
<a href="http://tonejs.org/docs/#Noise">Tone.Noise</a>
has 3 different types of noise. Careful, it's loud!
2015-06-07 18:05:59 +00:00
</div>
<div id="DragContainer"></div>
2015-02-12 03:39:28 +00:00
</div>
<script id="ToneCode" type="text/javascript">
//make the noise and connect it to the output
2015-06-07 18:05:59 +00:00
var noise = new Tone.Noise({
"volume" : -20,
"type" : "brown"
}).toMaster();
2015-02-12 03:39:28 +00:00
</script>
<script id="GUI" type="text/javascript">
2015-06-07 18:05:59 +00:00
$(function(){
Notone.config({
"search" : false,
"expandInDrawer" : true,
"hideDrawer" : Interface.isMobile,
"drawer" : true,
"container" : "body"
});
var noiseGUI = Notone.add(noise, "Noise");
2015-06-26 05:23:05 +00:00
new Interface.Dragger({
gui : noiseGUI,
2015-06-07 18:05:59 +00:00
y : {
param : "volume",
min : -40,
max : 0
},
x : {
param : "type",
options : ["white", "brown", "pink"]
},
start : function(){
noise.start();
Tone.Master.volume.rampTo(0, 0.05);
},
end : function(){
//so it doesn't click
Tone.Master.volume.rampTo(-Infinity, 0.05);
}
});
})
2015-02-12 03:39:28 +00:00
</script>
2014-06-20 04:25:00 +00:00
</body>
</html>