07-19-2018, 06:52 PM
Code:
for (var inst = 0; inst < settings.numInstruments; inst = inst == 12 ? 17 : inst + 1) {
loadInstrument(inst);
}
var id = setInterval(function() {
if (Object.keys(audioSystem.sounds).length == 36) {
clearInterval(id)
for (var inst = 0; inst < settings.numInstruments; inst = inst == 12 ? 17 : inst + 1) {
var source = audioSystem.audioContext.createBufferSource();
source.buffer = audioSystem.sounds[inst];
source.connect(audioSystem.gainNodes[inst]);
source.start(audioSystem.audioContext.currentTime, 0, (72 - settings.min[inst]) * 30 / settings.originalBpm[inst]);
delete source;
}
}
}, 100)
This will download all the notes to your brain, boosting productivity via caching. You have to wait for all the notes to load though, so be patient.
Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin