You can also do this in scriptlet which means you can just put it the MIDI path. This simple script assumes PC 1 to PC8 and outputs CC#81 - CC#88 On followed by Off 100mS later.
On ProgramChangeEvent(m : ProgramChangeMessage)
var pgNumber : Integer = GetProgramChangeNumber(m)
cc_num : ControlChangeMessage
cc_num = MakeControlChangeMessage(80 + pgNumber, 127)
SendNow(cc_num)
cc_num = MakeControlChangeMessage(80 + pgNumber, 0)
SendLater(cc_num, 100)
End
Make sure the following options are set in the Global MIDI dialogue.
NB. If you have songs you may also need to set the “Only accept program change messages on specific channel” and separate the PC messages from your pedals from the PC messages used to switch songs in Setlist View.

