Make blink a LED with a script

edited December 2025 in MAIN

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.

Comments

  • 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) :

    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

Sign In or Register to comment.