Fix index bug

This commit is contained in:
Luke Murphy 2020-01-31 17:28:38 +01:00
parent c6aebd1166
commit ceefcce269
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -200,7 +200,7 @@ class GeneratedShape {
var duration = 0.8; var duration = 0.8;
var time = 0; var time = 0;
var velocity = 0.5; var velocity = 0.5;
var index = random(0, notes.length + 1); var index = floor(random(0, notes.length));
this.synth.play(notes[index], velocity, time, duration); this.synth.play(notes[index], velocity, time, duration);
} }