mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
4ece9ac81d
fixes #240
53 lines
1.5 KiB
HTML
53 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>PINGPONG DELAY</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link rel="icon" type="image/png" sizes="174x174" href="./style/favicon.png">
|
|
|
|
<script src="../build/Tone.js"></script>
|
|
<script src="./scripts/jquery.min.js"></script>
|
|
<script src="./scripts/draggabilly.js"></script>
|
|
<script src="./scripts/StartAudioContext.js"></script>
|
|
<script src="./scripts/Interface.js"></script>
|
|
<script src="https://tonejs.github.io/Logo/build/Logo.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
|
|
<script>
|
|
// jshint ignore: start
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="Content">
|
|
<div id="Title">Ping Pong Delay</div>
|
|
<div id="Explanation">
|
|
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.
|
|
<br><br>
|
|
<a href="https://tonejs.github.io/docs/#PingPongDelay">Tone.PingPongDelay</a> docs.
|
|
</div>
|
|
</div>
|
|
<script>
|
|
//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|ogg]").connect(feedbackDelay);
|
|
|
|
Interface.Loader();
|
|
|
|
Interface.Button({
|
|
text : "trigger",
|
|
start : function(){
|
|
player.start();
|
|
},
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|