Tone.js/examples/noises.html

52 lines
1.3 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
2014-06-20 04:25:00 +00:00
<html>
<head>
<meta charset="utf-8">
2019-01-09 01:21:29 +00:00
<title>Noise</title>
2014-06-20 04:25:00 +00:00
2019-01-09 01:21:29 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="image/png" sizes="174x174" href="./favicon.png">
2014-09-06 19:35:31 +00:00
2019-01-09 01:21:29 +00:00
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/webcomponents-bundle.js"></script>
<script src="../build/Tone.js"></script>
2019-01-09 01:21:29 +00:00
<script src="./js/tonejs-ui.js"></script>
2015-02-12 03:39:28 +00:00
</head>
<body>
2019-01-09 01:21:29 +00:00
<style>
tone-trigger, tone-oscilloscope {
margin-bottom: 10px;
}
tone-oscilloscope {
background-color: black;
height: 60px;
width: 100%;
2015-06-07 18:05:59 +00:00
}
</style>
2019-01-09 01:21:29 +00:00
<tone-example>
<tone-explanation label="Noise">
<a href="https://tonejs.github.io/docs/Noise">Tone.Noise</a>
2015-06-27 22:02:55 +00:00
has 3 different types of noise. Careful, it's loud!
2019-01-09 01:21:29 +00:00
</tone-explanation>
<tone-content>
<tone-oscilloscope></tone-oscilloscope>
<tone-trigger></tone-trigger>
<tone-noise></tone-noise>
</tone-content>
</tone-example>
<script type="text/javascript">
2015-02-12 03:39:28 +00:00
//make the noise and connect it to the output
2015-06-07 18:05:59 +00:00
var noise = new Tone.Noise({
2019-01-09 01:21:29 +00:00
"volume" : -10,
2015-06-07 18:05:59 +00:00
"type" : "brown"
}).toMaster();
2015-02-12 03:39:28 +00:00
2019-01-09 01:21:29 +00:00
//bind the inteface
document.querySelector("tone-oscilloscope").bind(noise);
document.querySelector("tone-trigger").bind(noise);
document.querySelector("tone-noise").bind(noise);
2015-02-12 03:39:28 +00:00
</script>
2014-06-20 04:25:00 +00:00
</body>
</html>