I cant get this playhead to animate in a while loop.
The sounds I want it to play are randomly selected from an array and I want to draw a line to show how far one is from ending each time it's triggered. I need the animation to work in the loop since I'm using that to pause the timers that control my samples.
Here's the relevant section of code.
while(Ads[i].isPlaying()){
countDown();
}
void countDown(){
// draw a line to show where in the song playback is currently located
strokeWeight(10);
int posx = int(map(Ads[i].position(), 0, Ads[i].length(), 0, width));
stroke(0,200,0);
line(posx, 0, posx, height);
}
I can use
println(( Ads[i].length() - Ads[i].position()) /1000 );
to show the remaining time a sample has on the console but I can't draw that number or represent it in my sketch for some reason.