adding stepSequencer example (cleanup)

This commit is contained in:
Jason Sigal 2014-06-23 17:06:55 -04:00
parent d6bfa2cd1b
commit 55f35daee6

View file

@ -8,7 +8,7 @@
</head>
<body>
<div>Checkbox Step Sequencer. 1 bar loop. Each box is a 16th note.</div>
<div>One Measure Step Sequencer. Each box is a 16th note, so the 5th checkbox = 0:1:0</div>
<br>
<button>start</button>
<div id="transportTime">0:0:0</div>
@ -21,7 +21,7 @@
Tone.Transport.loop = true;
Tone.Transport.setLoopStart("0:0");
Tone.Transport.setLoopEnd("1:0");
Tone.Transport.setBpm(100);
Tone.Transport.setBpm(20);
var player = new Tone.Player("./audio/505/snare.mp3", function(){
$("#loading").remove();
@ -45,7 +45,7 @@
}
});
// Create 16 checkboxes with values 0-15.
// Create 16 checkboxes with values 0-16.
for (i = 0; i<16; i++) {
$("#checkboxes").append('<input type="checkbox" timelineEvent="" value="'+i+'" >');
}
@ -54,7 +54,7 @@
$('[type="checkbox"]').change(function() {
if (this.checked) {
// Convert this checkbox value into a 16th note in transport time. "5" = "0:1:1".
// Convert this checkbox value into a 16th note in transport time.
var tSig = Tone.Transport.getTimeSignature();
var tTime = "0:"+Math.floor(this.value/ tSig)+":"+this.value % tSig;