Hello,
I've built the 'wham jammer' from here: Notes and Volts: WHAM Jammer - Build it!
The basic circuit works fine, and passes MIDI messages correctly from my Gigrig G2 switcher, thru the wham jammer, and then on to my Digitech Whammy v5 pedal. Because the G2 only sends a hard-coded PCM per preset, I was hoping to 'intercept' the ProgramChange message from the G2, and then modify it to map to the desired preset on the Whammy pedal.
What I'm finding is that while I can catch the PCM, and then send a modified one on to the Whammy, the original Program Change message still goes thru to the Whammy.
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
MIDI.setHandleProgramChange(HandleProgramChange);
}
void loop() {
MIDI.read();
}
void HandleProgramChange(byte channel, byte number) {
delay(1000);
MIDI.sendProgramChange(0, channel);
delay(1000);
}
By inserting the delay, i can see that my program change '0' gets to the whammy first, changing its preset to the '2 octaves up', and then one second later, the original program change message gets applied (switching back to a different preset).
I clearly have some problem with my logic or the way I'm trying to solve this problem, would appreciate a pointer on how best to accomplish this?
Thanks -
Guy