Arduino Midi Thru
DodaTech
1 min read
In this tutorial, you'll learn about Arduino MIDI Thru Does Not Forward Messages. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
The Problem
MIDI THRU configured on Arduino does not pass incoming messages to MIDI OUT.
Quick Fix
Wrong
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() { MIDI.begin(1); }
void loop() {
if (MIDI.read()) {
// No forwarding implemented
}
}```
MIDI messages received but nothing appears on MIDI OUT.
### Right
```cpp
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
MIDI.begin(1);
MIDI.turnThruOn(); // Enable software THRU
}
void loop() {
if (MIDI.read()) {
// THRU handled automatically by turnThruOn()
// Messages forward from MIDI IN to MIDI OUT
}
}```
MIDI IN -> Arduino -> MIDI OUT. All channel 1 messages pass through. (Software THRU enabled -- no manual forwarding needed)
## Prevention
MIDI THRU wiring: MIDI IN -> optocoupler -> <a href="/iot/arduino/">Arduino</a> RX; <a href="/iot/arduino/">Arduino</a> TX -> 220 ohm -> MIDI OUT pin 5. The MIDI library provides software THRU via turnThruOn(). Optional filter modes: MIDI_FILTER_CHANNEL (same channel only), MIDI_FILTER_FULL (all channels). Hardware THRU (no latency) requires direct wiring from optocoupler to MIDI OUT pin 5.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
## FAQ
<details style="margin-bottom:12px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden"><summary style="cursor:pointer;padding:14px 18px;font-weight:600;font-size:1.05rem;background:#f8fafc;border-bottom:1px solid #e2e8f0;color:#1e293b">### What is THRU vs OUT?</summary><div style="padding:14px 18px;color:#475569;line-height:1.7;background:#fff"><p>THRU is a copy of MIDI IN (passive). OUT is generated by the device. <a href="/iot/arduino/">Arduino</a>'s software THRU combines both -- IN forwards to OUT.</p>
<h3 id="does-software-thru-add-latency">Does software THRU add latency?</h3><p>Yes -- 1-3 ms from serial processing. For live performance, use dedicated hardware THRU box.</p>
<h3 id="can-i-filter-thru">Can I filter THRU?</h3><p>Yes. turnThruOn(MIDI_FILTER_CHANNEL) passes only the listening channel. Or handle manually: read(), Process, then MIDI.send() selectively.</p>
</div></details>
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro