MIDI library doesn't work on Arduino Due

Well, the midi library doesn’t work on Arduino Due.

I’m strongly disappointed in this.

Each time i try to compile a midi sketch, the following error occour:

In file included from /Applications/Arduino .app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/Arduino.h:36,

  • from MIDI_Basic_IO_edited.ino:3:*
    /Applications/Arduino .app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/wiring_constants.h:90: error: conflicting declaration ‘typedef unsigned int word’
    /Users/schiller/Documents/Arduino/libraries/MIDI/MIDI.h:65: error: ‘word’ has a previous declaration as ‘typedef uint16_t word’

Generic code:

#include <MIDI.h>

void setup() {

void loop() {


Solved it

I edited the MIDI.h file with a text editor application.

Basically, i replaced this line

ypedef uint16_t word'

with this one

typedef unsigned int word

according to the declaration in wiring_constants file.

Now it works fine, but if anyone would suggest another way to fix that problem, suggestions are wellcome!

We had this same problem on Teensy 3.0.

It turns out that line is never used. You can simply delete it without any problems.