Tone.js/examples/pingPongDelay.html

59 lines
1.7 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
2014-09-04 04:06:01 +00:00
<html>
<head>
<meta charset="utf-8">
2019-01-09 01:21:29 +00:00
<title>Ping Pong Delay</title>
2014-09-06 19:35:31 +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">
2015-02-13 21:24:52 +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>
<script src="./js/tonejs-ui.js"></script>
<style type="text/css">
tone-trigger, tone-meter {
margin-bottom: 10px;
}
tone-meter {
background-color: black;
height: 100px;
width: 100%;
}
</style>
2014-09-04 04:06:01 +00:00
</head>
<body>
2019-01-09 01:21:29 +00:00
<tone-example>
<tone-loader></tone-loader>
<tone-explanation label="Ping Pong Delay">
2015-06-27 21:25:01 +00:00
A Ping Pong Delay is a stereo feedback delay where the delay bounces back and forth between the left and right channels. Hit the button to trigger a snare sample into the effect.
2015-06-27 22:02:55 +00:00
<br><br>
2019-01-09 01:21:29 +00:00
<a href="https://tonejs.github.io/docs/PingPongDelay">Tone.PingPongDelay</a> docs.
</tone-explanation>
<tone-content>
<tone-meter stereo></tone-meter>
<tone-trigger></tone-trigger>
<tone-ping-pong-delay></tone-ping-pong-delay>
</tone-content>
</tone-example>
<script type="text/javascript">
2015-02-13 21:24:52 +00:00
//the feedback delay
var feedbackDelay = new Tone.PingPongDelay({
"delayTime" : "8n",
"feedback" : 0.6,
"wet" : 0.5
}).toMaster();
2014-09-04 04:06:01 +00:00
2015-02-13 21:24:52 +00:00
//play a snare sound through it
var player = new Tone.Player("./audio/505/snare.[mp3|ogg]").connect(feedbackDelay);
2015-06-27 21:25:01 +00:00
2019-01-09 01:21:29 +00:00
//bind the interface
document.querySelector("tone-trigger").bind(player);
document.querySelector("tone-ping-pong-delay").bind(feedbackDelay);
document.querySelector("tone-meter").bind(feedbackDelay);
2014-09-04 04:06:01 +00:00
</script>
</body>
</html>