Sense of agency experiment (time delays)

URL of experiment:

Description of the problem:
Hello everyone! I need some help for my experiment. I want to create a task to evaluate the sense of agency of participants. How ? Participants have to estimate the time interval between pressing one of the 4 circles presented to them on the screen and the sound (beep). In concrete terms, the participant is placed in front of a screen and asked to choose from 4 circles presented on the screen. The 4 circles are arranged in different positions: one at the bottom, one at the top, one on the right and one on the left of the screen. To select them, the participant must click on one of the 4 corresponding arrows on the keyboard. This is the voluntary condition. In the involuntary condition, the participant has no choice, and must press the space key on the keyboard (after receiving a command). After pressing one of the 4 arrows, or after pressing the space bar in the other condition, a sound appears after 100, 400 or 700 ms. They must then estimate the time interval between their press and the sound (100, 400 or 700 ms). The condition (voluntary or involuntary) is counterbalanced from one participant to the next.

How do you make the sound come after 100, 400 or 700 ms? And how can we ensure that there are 10 trials for each interval (100, 400 & 700 ms)?
Thanks in advance for your time !