DIY USB MIDI Host to MIDI - Use FTP without computer

Started by Spider, October 09, 2013, 06:41:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tatun_g

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:

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!

sixeight

#26
Quote from: tatun_g on October 10, 2017, 09: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 (...)

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;

#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);

tatun_g

Quote from: sixeight on October 10, 2017, 10:43:50 PM
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;

#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?

admin

#28
QuoteMake 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;

#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);

sixeight

QuoteOh! 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

tatun_g

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!

sixeight

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

tatun_g

Quote from: sixeight on October 12, 2017, 10: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

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

sixeight

Quote from: tatun_g on October 13, 2017, 10:55:00 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...

tatun_g

Quote from: sixeight on October 14, 2017, 08:42:48 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.

sixeight

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.

tatun_g

Quote from: sixeight on October 15, 2017, 07: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.

Just an update on this:
1)A faulty USB Host Shield caused the uploading errors. I've just bought a new one and the uploading is OK...but
2) It´s just that for some reason it does not work with the Novation Launchkey. I've tested with other controllers and works great: I can control a master keyboard via MIDI USB HOST with Arduino. Novation Launchkey do nothing. Thanks anyway for the help.

Greetings from Argentina!

Elantric

#37
Quote from: tatun_g on November 15, 2017, 04:34:48 PM

2)  It´s just that for some reason it does not work with the Novation Launchkey. I've tested with other controllers and works great: I can control a master keyboard via MIDI USB HOST with Arduino. Novation Launchkey do nothing.

https://d2xhy469pqj8rc.cloudfront.net/sites/default/files/novation/downloads/10577/launchkey-mk2-ug-en_0.pdf

What are you trying to control on the Novation Launchkey ? AFAIK Novation Launchkey Controller only Transmits MIDI  - but does not Receive any MIDI 


Others report problems  / non functionality with the Novation Launchkey on other gear with USB Host ports that support USB Class Compliant controllers  ( Akai MPC- X) 

"random lost connection" - rumor is it draws a fair amount of supply current from the USB Host device  - even when powered by its own Wal Wart Power supply

Suggest insert a Powered USB Hub between your USB Host project and the USB on the  Novation Launchkey.

List of USB Class Compliant Controllers
http://www.akaipro.com/support/kb/articles/connecting-usb-audio-interfaces-midi-controllers-and-keyboards-to-an-ipad-or-ios-device

turboblue

#38
HI, I successfully built this adapter and it works great with a ZOOM G3. You will have to Power the Arduino with external 9v the Zoom G3 doesn't provide USB power. Aside from that I had some issues compiling the sketches and would like to explain what I did to over come this.

Use the following other versions will Fail!

arduino-1.0.5-r2 (I used the same as tutorial)
USB_Host_Shield_2.0-1.1.1
Arduino_MIDI_Library_v4.1
USBH_MIDI v0.4.0

Then rename the directories and place in your Arduino\libraries
USB_Host_Shield_2.0-1.1.1       --->      USB
Arduino_MIDI_Library_v4.1        --->     MIDI
USBH_MIDI v0.4.0                      --->     USBH_MIDI

I tried every combination of Arduino Midi Library and USB Host Shield, and this is what worked for me, hope this helps. Thanks for putting together this awesome tutorial!

Update
I had strange issues with the midi host glitching out, I instead used Arduino v1.8.7 recompiled and uploaded the code and it works perfect.

There was also a ground loop problem I discovered there is a flaw in the wiring diagram, you need to remove the ground wire from the midi input it's not needed. And for added protection (not required) I added this schematic between the input and ardruino.

http://www.notesandvolts.com/2015/02/midi-and-arduino-build-midi-input.html


shannonrichards

Good project, it would be nice if you guys can share some schematics diagram for that project. Or are there no soldering involve in this project?

Elantric

#40
Quote from: shannonrichards on March 12, 2024, 01:42:29 AMGood project, it would be nice if you guys can share some schematics diagram for that project. Or are there no soldering involve in this project?



Use Chrome Browser, translate this URL  to English

http://cyfrowogitarowo.pl/archiwa/124

shannonrichards

Quote from: Elantric on March 12, 2024, 04:24:08 AM

Use Chrome Browser, translate this URL  to English

http://cyfrowogitarowo.pl/archiwa/124

Wow, I think this will be an awesome project for those planning to delve in DIY guitar gears.