Hello,
I want to make a LED blink by a script using send midi controlchange.
Can you show me how to do a loop to blink the LED. I have done some test but millumin was lagging.
Thanks.
Hello @limoges,
As stated in my last message, there are snippets in the help center.
You can do so by using setInterval JavaScript function (never use an infinite while loop) :
setInterval
while
function update() { value = (counter%2 == 0 ? 12 : 0 ) Millumin.sendMIDI(null, "CC 46 @ "+value) counter++ if( 60 <= counter ) // stops after 60 seconds { clearTimeout(timeout) } } counter = 0 timeout = setInterval(update, 1000)
Best. Philippe
Thanks
Comments
Hello @limoges,
As stated in my last message, there are snippets in the help center.
You can do so by using
setIntervalJavaScript function (never use an infinitewhileloop) :function update() { value = (counter%2 == 0 ? 12 : 0 ) Millumin.sendMIDI(null, "CC 46 @ "+value) counter++ if( 60 <= counter ) // stops after 60 seconds { clearTimeout(timeout) } } counter = 0 timeout = setInterval(update, 1000)Best. Philippe
Thanks