The midi-thru connection does exactly what it is supposed to, It passes all thru. (it is actually just hardware)
Just draw us how you've connected the devices and cables please. I think we can trust that the midi shield connects properly to the arduino.
Your code should work, though if you want to keep passing midi-sync (most clocks will stop sending that after sending stop though, but this is a different matter)
then your case for clock should look like this
case midi::Clock:
MIDI.sendRealTime(midi::Clock);
break;
Is it still receiving midi clock messages ?
Best practice is to use the onboard LED on the Arduino to show midi-clock messages coming in. For that you need to count them as they come in,
so
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI); // all channels
MIDI.turnThruOff(); // MIDI Thru Off
pinMode(13, OUTPUT);
}
void loop() {
static uint8_t clk = 0;
if (MIDI.read()) //receive msg
{
switch (MIDI.getType()) { //recognize MIDI Type as MIDI Clock and MIDI Clock start, stop, continue msg's
case midi::Clock:
MIDI.sendRealTime(midi::Clock);
clk++;
clk = clk % 24; // 24 clock messages per beat
if (clk / 6) digitalWrite(13, LOW); // this should light it up for 25% of the time
else digitalWrite(13, HIGH);
break;
case midi::Start:
break;
case midi::Continue:
break;
case midi::Stop:
break;
default: //sends other types of msg's
MIDI.send(
MIDI.getType(),
MIDI.getData1(),
MIDI.getData2(),
MIDI.getChannel()
);
break;
}
}
}