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.
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.
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