diff --git a/src/index.js b/src/index.js index 8f8f070..ebf8138 100644 --- a/src/index.js +++ b/src/index.js @@ -31,7 +31,8 @@ function AudioEngine (sounds) { // load sounds - this.soundPlayers = this.loadSounds(sounds); + this.soundPlayers = []; + this.loadSounds(sounds); // Tone.Buffer.on('load', this._soundsLoaded.bind(this)); // soundfont setup @@ -63,38 +64,43 @@ function AudioEngine (sounds) { } AudioEngine.prototype.loadSounds = function (sounds) { - var soundPlayers = []; - for (var i=0; i