send-program-change

copsmusic/midi-basic/send-program-change

Send Program Change msg to MIDI output
send-program-change
@/send-program-change
Send Program Change msg to MIDI output
TRGpulse
Trigger the sending of the PC msg to MIDI output
CH_INnumber
Channel of the msg
PrgNumnumber
Program Number
send-program-change
Sent
TRG
CH_IN
PrgNum
Sentpulse
Triggered when the PC msg has been sent
To use the node in your project you should have the copsmusic/midi-basic library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    int programNumber;
    int channel;
        
    if (isInputDirty<input_TRG>(ctx)) {

        channel        = getValue<input_CH_IN>(ctx);
        programNumber  = getValue<input_PrgNum>(ctx);

        xod::copsmusic__midi::MIDI.sendProgramChange(programNumber, channel);

        emitValue<output_Sent>(ctx,1);
    }
}