wish to run a for loop indexing musical notes. runs through forloop without playing notes as expected. have spent a few days reading docs, stack overflow, youtube coding train and still cannot get it to work as expected please help
let notes=["A4","B4","C4","D4"]
function setup() {
monoSynth = new p5.MonoSynth();
setTimeout(playStuff,1000)
}
function playStuff(){
let i=0
for (i=0;i<notes.length;i++){
monoSynth.play(notes[i], 5, 3, 1 / 6);
print(i)
}//for i
}//playStuff
function draw() {
playStuff()
noLoop()
}//draw
This demo will play a note every second, one time through the array, using a timer. If you want it to loop repeatedly, delete the noLoop() and insert counter = 0;