Hi there, another guitarist-electronics freak here!
I'm quite new to MIDI programing, and as a first project I wanted to create a very simple footswitch that would change the presets in my Line6 HX One. According to the manual, this pedal is able to load presets by receiving PC (Program Change) messages.
Therefore, I started researching online on how to program my Pro Micro to send this kind of messages. FYI, I'm using MIDI-OX as my MIDI monitor, so I can see everything that's happening. Based on the title, you can guess that I'm having trouble sending Program Change messages to both MIDI-OX and my HX One. Before showing you the code, I tried sending some Control Change messages and NoteOn/NoteOff messages and everything works as a charm, so I know that my setup works (in terms of wiring) and so should my code.
So, here it is:
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
pinMode(2, INPUT_PULLUP);
MIDI.begin(1); //I've tried with the MIDI.begin(MIDI_CHANNEL_OMNI) too, but nothing
}
void loop() {
if (digitalRead(2) == LOW){
//MIDI.sendNoteOn(1,1,1); //this was here just for quick testing
//MIDI.sendControlChange(0,0,1); //this was here just for quick testing
MIDI.sendProgramChange(1,1);
delay(500);
}
}
After compiling and uploading without errors, when I push the button I can't see any messages coming through MIDI-OX.
I hope any of you can help me with this. I'm sure it has something to do with how the code is set up, but I can't manage to figure it out. I've tried different versions of the MIDI library and Arduino IDE version 2 and 1 and nothing works.
Thanks for the help!