@midi said:
I need to output “note on velocity 0”
to the software
the software refuse to recognize
any note off messages
I just tested as follows (sending a nonzero midinote number of course):

... and found that (at least in Linux, using the ALSA MIDI protocol) [midiout] transmits the bytes exactly as given, without transforming note-on to note-off.
I don't know about Mac or Windows MIDI behavior.
But... when I set up a MIDI responder in SuperCollider (because SC distinguishes between noteOn and noteOff, unlike Pd where velocity is the only thing that distinguishes them), I found that SC changes in note-on message with velocity = 0 to a note-off message.
When I set, in SC, MIDIIn.noteOnZeroAsNoteOff = false;
, then the zero-velocity message was received as note-on.
Now, that's not a guarantee that it will do this on all platforms. But, I don't find anything in Pd's sources that changes the status byte in this case. So if that's definitely always happening in your environment, then it must be either PortMIDI in Pd, or the receiving software is doing it.
hjh