Midi.Program Writes Only To Instrument Settings? Not To Midi?

Hi. I’ve been mucking around with

function midiprogram(change)  
local midi=renoise.song().selected_instrument.midi_output_properties  
local currentprg=midi.program  
 currentprg = math.max(1, math.min(128, currentprg + change))  
 rprint (currentprg)  
renoise.song().selected_instrument.midi_output_properties.program = currentprg  

Trying to get my Digitech Studio Quad 4’s effect preset to change, but while I do notice the change in the Instrument Settings in Renoise upon doing a +1 or -1, it only gets transmitted to Midi when I click on next or prev preset in the Instrument Settings window. Is there some sort of a Midi Transmission I’m supposed to put to use to transmit the Midi information to the outboard gear?

It also seems to get sent when I press play a few times.

Ok I’ve found a workaround… If I immediately send panic afterwards, it changes, but then of course the lineinput device gets cut off. until I press play again.

That sounds like you lack a signal to send to the external device that also proceeeds with the program change.
sometimes not only a program change cc has to be send but also another CC signal to confirm it (i thought it was somewhere around message 32, but is a wild guess based on vague reference memory of an older topic posted by someone using that method to send a program change from the effect column)