ignore_event still triggers a voice?

darb1
darb1 Member Posts: 22 Member

Hi. I got a counter variable in my code that is supposed to be increased in the on note callback and decreased in the on release callback. In the on note callback I also use ignore_event($EVENT_ID) and then follow this up with my own play_note(...) function.

When I play a note it does counts up by 1.

When I release a note however, it counts down by 2.

My guess is that while the original event is ignored (as in doesn´t trigger playback) it still calls the release callback, together with my custom play_note function. Also, the mapping editor always shows the red line for the original event as well as my custom event. Kontakt then counts this as 2 voices in my case. Is there any way to clean this up?

Answers

  • EvilDragon
    EvilDragon Moderator Posts: 1,021 mod
    edited February 2022

    Ignore_event() doesn't play the event but it also doesn't KILL it - you can still access its event ID and so on.

    You can query $EVENT_PAR_STATUS and act upon it in release callback, for example you can make it only respond to events coming from outside (if $EVENT_PAR_STATUS is -1).

  • darb1
    darb1 Member Posts: 22 Member

    I searched the reference manual and there is no entry for $EVENT_PAR_STATUS.

  • EvilDragon
    EvilDragon Moderator Posts: 1,021 mod

    Oh, apologies! It's of course $EVENT_PAR_SOURCE.

  • darb1
    darb1 Member Posts: 22 Member

    Thank you very much!

Back To Top