The foreach loop sends the note -on message (// Note On: 144, 64, 90 - message[0] = 144then I have a singleshot timer which repeatedly calls a routine that turns the notes off one at a time according to the ticks variable in the singleShot timer.
Added after 1 8 minutes:
I see what you mean now about the notes starting at the same time with the singleShot. With the SLEEP in place, it buffers the notes so that they play separately. I didn't take that into account. Your help in replacing this SLEEP function is appreciated. I've tried double timers staggered by the ticks variable but the starting problem remains. I found that you can't put a timer into a slot to call a slot, or at least I couldn't make it work. Is that possible? If it were possible to cascade the timers it would work I think.
Bookmarks