2014-10-22 22:49:42 +00:00
|
|
|
<!DOCTYPE html>
|
2014-09-03 18:54:46 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-10-22 22:49:42 +00:00
|
|
|
<meta charset="utf-8">
|
2015-06-27 21:25:01 +00:00
|
|
|
<title>SimpleFM</title>
|
2014-09-03 18:54:46 +00:00
|
|
|
|
2015-06-27 22:10:18 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
2015-12-08 05:06:58 +00:00
|
|
|
<link rel="icon" type="image/png" sizes="174x174" href="./style/favicon.png">
|
2015-06-27 21:25:01 +00:00
|
|
|
|
2014-09-04 19:20:25 +00:00
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
2015-06-27 21:25:01 +00:00
|
|
|
<script type="text/javascript" src="./scripts/jquery.min.js"></script>
|
2015-12-05 18:20:53 +00:00
|
|
|
<script type="text/javascript" src="./scripts/draggabilly.js"></script>
|
2015-02-24 03:14:51 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
2015-12-05 18:20:53 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Logo.js"></script>
|
2015-06-27 21:25:01 +00:00
|
|
|
<script type="text/javascript" src="./scripts/qwerty-hancock.js"></script>
|
2014-09-03 18:54:46 +00:00
|
|
|
|
2015-12-05 18:20:53 +00:00
|
|
|
|
2015-02-24 03:14:51 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// jshint ignore: start
|
|
|
|
</script>
|
|
|
|
|
2014-09-03 18:54:46 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2015-02-24 03:14:51 +00:00
|
|
|
<div id="Content">
|
2015-06-27 21:25:01 +00:00
|
|
|
<div id="Title">FMSynth</div>
|
|
|
|
<div id="Explanation">
|
2015-06-27 22:02:55 +00:00
|
|
|
<a href="http://tonejs.org/docs/#SimpleFM">Tone.SimpleFM</a>
|
|
|
|
is composed of two
|
|
|
|
<a href="http://tonejs.org/docs/#SimpleSynth">Tone.SimpleSynths</a>
|
|
|
|
where one Tone.SimpleSynth modulates the frequency of a second Tone.SimpleSynth.
|
2014-09-03 18:54:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-06-27 21:25:01 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var synth = new Tone.SimpleFM({
|
2015-12-05 18:20:53 +00:00
|
|
|
"modulationIndex" : 12.22,
|
|
|
|
"carrier" : {
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.2
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"modulator" : {
|
|
|
|
"oscillator" : {
|
|
|
|
"type" : "square"
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.2,
|
|
|
|
"decay" : 0.01
|
|
|
|
}
|
|
|
|
}
|
2015-06-27 21:25:01 +00:00
|
|
|
}).toMaster();
|
2015-02-24 03:14:51 +00:00
|
|
|
</script>
|
2014-09-03 18:54:46 +00:00
|
|
|
|
2015-06-27 21:25:01 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
$(function(){
|
2015-12-05 18:20:53 +00:00
|
|
|
|
2015-06-27 21:25:01 +00:00
|
|
|
new Interface.Slider({
|
2015-12-05 18:20:53 +00:00
|
|
|
tone : synth,
|
2015-06-27 21:25:01 +00:00
|
|
|
param : "modulationIndex",
|
|
|
|
name : "mod index",
|
|
|
|
max : 100
|
|
|
|
});
|
2014-09-03 18:54:46 +00:00
|
|
|
|
2015-06-27 21:25:01 +00:00
|
|
|
$("<div>", {
|
|
|
|
"id" : "Keyboard"
|
|
|
|
}).appendTo("#Content");
|
|
|
|
|
|
|
|
var keyboard = new QwertyHancock({
|
|
|
|
id: "Keyboard",
|
|
|
|
width: $("#Content").width(),
|
|
|
|
height: 150,
|
|
|
|
octaves: Interface.isMobile ? 1.26 : 3,
|
|
|
|
startNote: "C3",
|
|
|
|
whiteKeyColour: "white",
|
|
|
|
blackKeyColour: "#ECECEC",
|
|
|
|
activeColour : "#FFFC0C"
|
|
|
|
});
|
|
|
|
|
|
|
|
keyboard.keyDown = function (note) {
|
|
|
|
synth.triggerAttack(note);
|
|
|
|
};
|
|
|
|
|
|
|
|
keyboard.keyUp = function (note) {
|
|
|
|
synth.triggerRelease();
|
|
|
|
};
|
|
|
|
});
|
2014-09-03 18:54:46 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|