mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
66 lines
No EOL
1.9 KiB
HTML
66 lines
No EOL
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>PINGPONG DELAY</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
|
|
<script type="text/javascript" src="./deps/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../build/Tone.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>
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
<link rel="stylesheet" type="text/css" href="./style/prism.css">
|
|
|
|
<script type="text/javascript">
|
|
// jshint ignore: start
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<style type="text/css">
|
|
[nx="button"]{
|
|
margin: auto;
|
|
position: relative;
|
|
display: block;
|
|
}
|
|
</style>
|
|
<div id="Explanation">
|
|
Ping Pong Delay
|
|
<br>
|
|
<br>
|
|
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.
|
|
</div>
|
|
<div id="Content">
|
|
<div id="LoadingBar"></div>
|
|
<div id="Rack"></div>
|
|
<div id="Code"></div>
|
|
</div>
|
|
<script id="ToneCode" type="text/javascript">
|
|
//the feedback delay
|
|
var feedbackDelay = new Tone.PingPongDelay({
|
|
"delayTime" : "8n",
|
|
"feedback" : 0.6,
|
|
"wet" : 0.5
|
|
}).toMaster();
|
|
|
|
//play a snare sound through it
|
|
var player = new Tone.Player("./audio/505/snare.mp3")
|
|
.connect(feedbackDelay);
|
|
</script>
|
|
<script type="text/javascript">
|
|
Interface.Loading("LoadingBar");
|
|
Interface.Rack("Rack", "PingPongDelay");
|
|
Interface.Momentary("Rack", function(on){
|
|
if (on){
|
|
player.start();
|
|
}
|
|
});
|
|
Interface.Slider("Rack", feedbackDelay, "feedback", 0, 0.95);
|
|
Interface.Slider("Rack", feedbackDelay, "delayTime", 0.1, 0.5);
|
|
Interface.Code("Code", "ToneCode");
|
|
</script>
|
|
</body>
|
|
</html> |