'MIDI' was not declared in this scope

gdsports:
Starting with a fresh installation of IDE 1.8.4, use the IDE library manager to install USB Host Shield Library 2.0 by Oleg Mazurov, et al., version 1.3.1. Then install the MIDI Library by Forty Seven Effects, version 4.3.1.

Open the example starting from File | Examples | USB Host Shield Library 2.0 | USBH_MIDI | bidirectional_converter. The example compiles without errors.

The example source code is different from the version you have. You might be using an obsolete version so upgrade to the latest USB Host library. And use the example code included with the library.

The MIDI serial library is different from the one mentioned in your sketch. I installed the Forty Seven Effects version which is specified in the latest example comments. You may have to remove other MIDI serial libraries to get this to work.

Thank you very much! Done.

I think that is compiling correctly but there's a problem uploading. I'm facing this error:

Arduino: 1.8.4 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 11854 bytes (36%) of program storage space. Maximum is 32256 bytes.
Global variables use 623 bytes (30%) of dynamic memory, leaving 1425 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x94
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x94
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.