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
|
|
|
|
2014-09-11 15:47:51 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
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>
|
|
|
|
<script type="text/javascript" src="../../Notone.js/build/Notone.GUI.js"></script>
|
2015-02-24 03:14:51 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Interface.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-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({
|
|
|
|
"modulationIndex" : 12.22
|
|
|
|
}).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(){
|
|
|
|
Notone.config({
|
|
|
|
"search" : false,
|
|
|
|
"expandInDrawer" : true,
|
|
|
|
"hideDrawer" : Interface.isMobile,
|
|
|
|
"drawer" : true,
|
|
|
|
"container" : "body"
|
|
|
|
});
|
|
|
|
|
|
|
|
var fmGUI = Notone.add(synth, "SimpleFM");
|
|
|
|
|
|
|
|
new Interface.Slider({
|
|
|
|
gui : fmGUI,
|
|
|
|
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>
|