for (var i = 0; i < 500; i++) {
send('midi:SessionKiano','/note', 1, 72, 1)
}
Is there a way to execute the send function for a number of times at a given delay?
I believe that my tablet's cpu is the kind of cpu that runs faster only when the user does something with it (browsing the web, navigating through files, etc), which is why — sometimes — the midi message is sent less than 500 times (or it fails to be received that many times).
Is there a way add some space between the repeats?
This doesn't work:
for (var i = 0; i < 500; i++) {
setTimeout(function(){
send('midi:SessionKiano','/note', 1, 72, 1)
}, 50)
}
// result: the midi message is sent only once
In applescript, I would write:
repeat 500 times
say 'hi' -- here should've been the send() function line
delay 0.05
end repeat
Thank you!