Mechanism for delayed execution of a code block

Actually it’s a musical training game I’m (re)writing. So I don’t need any kind of high precision accuracy, but I do want to do something like play each note in a triad with some slight random temporal deviation (~.1s), and then play the whole thing a couple of seconds later but arpeggiated this time.

So whereas most people here will require the notes of a chord to sound simultaneously, my requirement is actually the opposite, I want to introduce slight delays so that the brain has a better chance of picking out the constituent notes.

I will also be updating visuals as each note plays. etc.

It’s not the end of the world if a particular timer gets delayed.

I was trying to do this using setTimeStamp Using setTimeStamp to arpeggiate a chord but I wasn’t able to get it to work.