toxonic, thank you for the solution, it does exactly what I've asked for in my post. But I should have been more precise in describing what I'm aiming for. I forgot to mention that I need something which will "hold" the previous true/false state until I press next key(s), which gives opposite result. Since your example gives true/false state depending on the note off message, it simply doesn't work for me.
Do you remember old cheap Casio keyboards and their "fingered" function? Instead of playing chords with three or more fingers, they offered a possibility to play them with just one or two fingers. One note gives major chord, two notes gives minor etc. When you release the key, it keeps playing the last chord until you press something else.
I'm building a patch which will be controlled by the theremin's pitch antenna, that means, theremin will glide in two or three octaves range, triggering the "right" notes only. Something like autoharp strummed with theremin. I tried it and it sounds promising, and that's why I am so persistant. If I do not succeed in "fingered" style, I will turn to classic "multi fingered" approach.
thank you all for your help
sinewave