I'm having difficulties coding my program, I'd be grateful if someone could take a look for me.
There's a gremlin in the PlayPhrase() method - I think?
What I'm trying to do is interlace 2 streams or phrases of notes - so my bot can play 2 notes at the same time.
I've been attempting to do this by using the millis() method to synchronize them - but I'm not too familiar with it.
if (millis() - previousMillis == lengths[PlayNoteCounter] + gaps[PlayNoteCounter])
This is a problem. There is an assumption that millis will return consecutive values, thus an exact match will occur. But, millis does not return consecutive values.
That code should be written as:
if (millis() - previousMillis [glow]>[/glow]= lengths[PlayNoteCounter] + gaps[PlayNoteCounter])