xxxxxxxxxx
25
const kit = new Tone.Players({
"kick": "samples/505/kick.mp3",
"snare": "samples/snare.mp3"
});
kit.toDestination();
Tone.Transport.scheduleRepeat(playRhythm1, 1/3 );
Tone.Transport.scheduleRepeat(playRhythm2, 1/2);
// Exercise: add accents to each loop
function playRhythm1(time){
kit.player("kick").start(time);
}
function playRhythm2(time){
kit.player("snare").start(time);
}
Tone.loaded().then(function(){
console.log("loaded");
Tone.Transport.start();
}
)