midi command and output basics ?

Trying to get midi out working . Wiki says that the ‘midi command’ is the common way to send a midi message out of touch. Can someone post a rudimentary example of this ? I’m still not clear on ways to execute scripts etc. How about something basic like an LFO CHOP modulating from 0-127 and this being formatted as midiCC and output a virtual midi port?

regards, c.o’d