This is an excerpt from the CAL Language programming guide that deals specifically with the SENDmidi command. The number that sets the port number is the first "-1" in the examples I gave you before
Hope this helps.
(sendMIDI <port> <channel> <kind> <data1> [[<data2>]….])
You can send a MIDI event during a CAL program with this function.
Use ‘port’ as the port number (0 .. 15) you want to send over. If ‘port’ is set to -1, the function will send the message through all ports. The ‘channel’ variable is the channel number (0 .. 15) and -1 will set the function to send over all channels. The ‘kind’ constant is one of the recognised event types such as “NOTE” or “CONTROL” just like with the “insert” function. Use ‘data1’ and ‘data2’ for the information to be sent. Not all event kinds use both data bytes, and you must use the proper formatting of the data bytes for the event in question. ‘data2’ is only valid for “NOTE”, “CONTROL” , and “KEYAFT”. Remember, MIDI data bytes must be between 0 and 127 except for type “SYSX” (system exclusive message).