Operate the timing between two note

hey there,
i’ve a question in sonic pi. is there any method i can use to operate the timing between two notes which is play from midi keyboard? thanks for any advice😃

Hi Kenny,

Could you explain a little more about what you mean by ‘operate the timing’?

Hi ethancrawford,
for instance,when i press “Do” on midi keyboard first, and second time i press “Re”. after that i hope i can store the “sleep time” ,which is between above two notes, into array.
btw,i need this because i want to make a music lock. as i play in a right tempo then the lock will open. in this case, i consider that i need to record the time between every to notes.
thanks.