Display an image on the Macro page when a zone receives a MIDI note-on message

Hi

I’m looking for a method to display an image on the Macro page ONLY when a certain zone (or layer) receives a MIDI note-on message. In other words I want an image on the Macro page that is normally not visible but it becomes visible (for a very short time, like 100ms) when a zone (let’s say a sample that is mapped on C3) receives a midi note. So when I play a C3 that image should become visible for a split second.

Any suggestions?

In case I didn’t make myself clear enough: what I’m looking for is to have an image element (or a stack with two images) on the Macro Page and that image to behave very similar to Halion’s MIDI activity LED. That LED turns on when Halion receives a MIDI message (note-on, note-off and CCs). In my case I need the image to “turn on” (be visible) only when a certain Layer receives a note-on message.

led

You could try a short script like this:

defineParameter("led", nil, false)

function onNote(e)
    postEvent(e)
    led = true
    wait(100)
    led = false
end

You could add this as lua script in the layer you want to monitor this way. Connect the created script parameter to stack or animation.

But I haven’t tested this.

1 Like

Yesssss! It works perfectly! :partying_face: :partying_face:
Thank you so much! :hugs:

One more thing: is it possible somehow to make that “led” turn on only for certain notes, not the entire range? Let me explain a little better: at the moment, using your script, the led parameter gets the true value every time that layer receives a note-on message no matter which key is pressed. I would like to be able to limit this only to certain notes (not to a range of notes). So for example only when I press a C3, an F#3 or a D#4 the led should turn on (true value) and for any other note it should remain turned off (false value).

Yes, this should be possible. Just add an “if” statement in the onNote callback. Is it just those 3 notes?

defineParameter("led", nil, false) 

function onNote(e) 
    postEvent(e)
    if e.note == 60 or e.note == 66 or e.note == 75 then
         led = true
         wait(100)
         led = false
    end
end

If it’s more notes then it could be better to create a table and compare with that.

defineParameter("led", nil, false)

local notes = {[60] = true, [66] = true, [75] = true}

function onNote(e)
    postEvent(e)
    if notes[e.note] then
        led = true
        wait(100)
        led = false
    end
end
1 Like

Perfect! It works like a charm! :partying_face:
And it’s so easy. I was afraid I’d need a rather convoluted script to accomplish this.
Thank you so much! :hugs: :hugs:

Yes, just those 3 notes for now.