Trigger the sending of the pitchbend when received
CH_INnumber
Channel of the msg
Typenumber
Type of the msg
Data1number
First part of the MIDI msg
Data2number
Second part of the MIDI msg
Sentpulse
Triggered when pitchbend is 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 type;
int data1;
int data2;
int channel;
if (isInputDirty<input_TRG>(ctx)) {
channel = getValue<input_CH_IN>(ctx);
type = getValue<input_Type>(ctx);
data1 = getValue<input_Data1>(ctx);
data2 = getValue<input_Data2>(ctx);
if (type ==224) { //Pitchbend
xod::copsmusic__midi::MIDI.send(xod::copsmusic__midi::MIDI.getType(), data1, data2, channel);
emitValue<output_Sent>(ctx,1);
}
}
}