Author Topic: DIY USB MIDI Host to MIDI - Use FTP without computer  (Read 7086 times)

0 Members and 1 Guest are viewing this topic.

Offline tatun_g

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #25 on: October 10, 2017, 10:30:11 PM »
Hi, guys! Spider are you on this yet? I have some questions:
I'm trying to make MIDI USB Host to connect my Novation Launchey 49 to my Koorg Kronos.

1) When I upload the code to the board I get this error:

Code: [Select]
Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Tatun Arts Center\Documents\Arduino\libraries\USBH_MIDI_IOP\examples\bidrectional_converter\bidrectional_converter.ino: In function 'void setup()':

bidrectional_converter:52: error: 'MIDI' was not declared in this scope

   MIDI.begin(MIDI_CHANNEL_OMNI);

   ^

C:\Users\Tatun Arts Center\Documents\Arduino\libraries\USBH_MIDI_IOP\examples\bidrectional_converter\bidrectional_converter.ino: In function 'void loop()':

bidrectional_converter:74: error: 'MIDI' was not declared in this scope

     if (MIDI.read()) {

         ^

C:\Users\Tatun Arts Center\Documents\Arduino\libraries\USBH_MIDI_IOP\examples\bidrectional_converter\bidrectional_converter.ino: In function 'void MIDI_poll()':

bidrectional_converter:34: error: 'MIDI_DEFAULT_SERIAL_PORT' was not declared in this scope

 #define _MIDI_SERIAL_PORT MIDI_DEFAULT_SERIAL_PORT

                           ^

C:\Users\Tatun Arts Center\Documents\Arduino\libraries\USBH_MIDI_IOP\examples\bidrectional_converter\bidrectional_converter.ino:98:7: note: in expansion of macro '_MIDI_SERIAL_PORT'

       _MIDI_SERIAL_PORT.write(outBuf, size);

       ^

exit status 1
'MIDI' was not declared in this scope

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

I'm using the libraries pointed in your tutorial and installed via ZIP in Arduino IDE 1.8.5. Any ideas?

Another strange thing is that the L led (green) blinks only when the usb host shield is not connected to the Arduino Uno...is it normal?

Thanks in advance!

Offline sixeight

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #26 on: October 10, 2017, 11:43:50 PM »
Hi, guys! Spider are you on this yet? I have some questions:
I'm trying to make MIDI USB Host to connect my Novation Launchey 49 to my Koorg Kronos.

1) When I upload the code to the board I get this error (...)

I'm using the libraries pointed in your tutorial and installed via ZIP in Arduino IDE 1.8.5. Any ideas?

Thanks in advance!

It looks like you forgot to declare the midi object in your sketch. Make sure you have all of the following lines at the top of your sketch;

Code: [Select]
#include <usbh_midi.h>
#include <usbhub.h>

// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>

#ifdef USBCON
#define _MIDI_SERIAL_PORT Serial1
#else
#define _MIDI_SERIAL_PORT Serial
#endif
//////////////////////////
// MIDI Pin assign
// 2 : GND
// 4 : +5V(Vcc) with 220ohm
// 5 : TX
//////////////////////////

USB Usb;
USBH_MIDI  Midi(&Usb);
« Last Edit: October 10, 2017, 11:45:52 PM by sixeight »

Offline tatun_g

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #27 on: October 11, 2017, 05:37:06 AM »
It looks like you forgot to declare the midi object in your sketch. Make sure you have all of the following lines at the top of your sketch;

Code: [Select]
#include <usbh_midi.h>
#include <usbhub.h>

// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>

#ifdef USBCON
#define _MIDI_SERIAL_PORT Serial1
#else
#define _MIDI_SERIAL_PORT Serial
#endif
//////////////////////////
// MIDI Pin assign
// 2 : GND
// 4 : +5V(Vcc) with 220ohm
// 5 : TX
//////////////////////////

USB Usb;
USBH_MIDI  Midi(&Usb);

Oh! And how do I do that?

Offline admsustainiac

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #28 on: October 11, 2017, 07:18:47 AM »
Quote
Make sure you have all of the following lines at the top of your code;

 Make sure you have all of the following lines at the top of your code;

Code: [Select]
#include <usbh_midi.h>
#include <usbhub.h>

// Satisfy the IDE, which needs to see the include staetment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>

#ifdef USBCON
#define _MIDI_SERIAL_PORT Serial1
#else
#define _MIDI_SERIAL_PORT Serial
#endif
//////////////////////////
// MIDI Pin assign
// 2 : GND
// 4 : +5V(Vcc) with 220ohm
// 5 : TX
//////////////////////////

USB Usb;
USBH_MIDI  Midi(&Usb);
« Last Edit: October 11, 2017, 07:20:54 AM by admsustainiac »

Offline sixeight

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #29 on: October 11, 2017, 08:16:40 AM »
Quote
Oh! And how do I do that?

It may be wise to first understand the basics of Arduino, before moving on.

https://www.arduino.cc/en/Tutorial/Foundations

Offline tatun_g

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #30 on: October 12, 2017, 08:03:31 PM »
Thanks for the help! Now it´s compiling fine, and uploading done. Still not working. I've checked connections and wiring.

I've tested with Examples/Basic/ Midi and the board its working, beacuse the hard synth plays the notes sequence (a chromatic scale) so my arduino works. It's just when I play from the controller I've connected to the USB Host Shield (Novation Launchkey 49) that I cant get sound from the hard synth.

I've tried bidirectional, converter and converter multi and it's the same.

Just one more thing: When the uploading is done my hard synth plays a note. (?)

Any ideas will bve welcome!

Thanks in advance!

Offline sixeight

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #31 on: October 12, 2017, 11:51:13 PM »
If you use the USB dump sketch, do you see any data on the serial monitor?  You should be able to see keys played on the Novation as midi events in the serial monitor.

https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino

Offline tatun_g

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #32 on: October 13, 2017, 11:55:00 AM »
If you use the USB dump sketch, do you see any data on the serial monitor?  You should be able to see keys played on the Novation as midi events in the serial monitor.

https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino

Ok, I've just tried it. No messages on serial monitor when I play notes on the Novation. Midi example sketch keeps working.

Offline sixeight

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #33 on: October 14, 2017, 09:42:48 AM »
Ok, I've just tried it. No messages on serial monitor when I play notes on the Novation. Midi example sketch keeps working.

I am afraid the Novation may not be class compliant. In which case it needs a dedicated midi driver, which does not exist for Arduino...

Offline tatun_g

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #34 on: October 14, 2017, 10:55:50 AM »
I am afraid the Novation may not be class compliant. In which case it needs a dedicated midi driver, which does not exist for Arduino...

I thought about that but the Novation site says "Launchkey is fully USB bus-powered and class compliant, so it works straight away without power supplies or drivers on Mac or PC. It also comes with everything you need to start making electronic music" (obviously in this case I'm using a power supply)

That was the idea about to make an Arduino based MIDI USB Host.

Offline sixeight

Re: DIY USB MIDI Host to MIDI - Use FTP without computer
« Reply #35 on: October 15, 2017, 08:40:39 AM »
I do not have the USB host board, though I have looked at it and developed some code for someone else. So I don't know if the receive side of the USBH_MIDI library works OK.

 

Blog