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.

Spider

Finally I made some tutorial... Please ask, comment etc.

MIDI USB HOST DIY tutorial
By Spider ver. 1.0 (9 Oct 2013)


Download PDF Instruction in ENG here: http://cyfrowogitarowo.pl/archiwa/124

utensil

Hi Spider, I just saw this post and got your tutorial, I'm sure I'm not the only one who appreciate this but Thanks ! I'm going to follow your tutorial and make one for myself in the next week and this will really make things easier for me.


dacama

Hello,

But what does it do exactly? Recieves the FTP signal and send it to MIDI port?

Thank you

Elantric

QuoteRecieves the FTP signal and send it to MIDI port?

Correct - like the Kenton USB Host to MIDI convertor or iConnectMIDI Box

Good job Spider!

dacama


Spider

But DIY solution has at this moment one big minus: You couldn't;t use it with computer. Of course it is possible and maybe one day Yuuichi Akagawa  will write newer version of their library like changed it two times on my request (he resolved problem with PC in multi MIDI USB host and added support for 5 DIN MIDI In > USB Host :)


bbtshane

Spider,  I am having issues getting the code to run.  I keep get an error on the verify step.

Spider

@bbtshane
send me more info, screenshots from IDE and info about libraries which you use.

bob4u

Quote from: Spider on October 09, 2013, 06:41:01 AM
Finally I made some tutorial... Please ask, comment etc.

THANK YOU Spider, I did it and it works !   ;D

The only thing important also for the other people:
it's not clear the use and functionality of the MIDI IN connector.
Does it merge with FTP messages?
Also is safer for MIDI IN to use a schematic using a optocoupler, e.g.:
http://theaudiostash.files.wordpress.com/2013/05/midi_in.png?w=604

Ciao!


Spider

Use MIDI IN for:
* sending Program change message to  FTP from some floorboard (look at G-Lab GSC-4 for example)
* sending CC#66 to FTP and use it to control a hold pedal like in computer apps

FreeTime

The reason for the optocoupler is to prevent ground loops. Have a look here for more info :
http://www.jaycar.com.au/images_uploaded/optocoup.pdf

Spider

#11
BTW: MIDI IN is soft THRU so it could be used for something more then for FTP.

Spider

#12
Quote from: FreeTime on March 10, 2014, 10:59:44 AM
The reason for the optocoupler is to prevent ground loops. Have a look here for more info :
http://www.jaycar.com.au/images_uploaded/optocoup.pdf

Yes it is a reason! And good advice :)

lord-g

#13
How Nice!
Good Job man, i will do one like this!!!
Thank You

Spider
Can this conversor control the BOSS GP-10?

Elantric

#14
QuoteCan this converter control the BOSS GP-10?


See link below for alternative strategy to add 5 pin MIDI I/O to Boss GP-10 using $35 Raspberry Pi computer
https://www.vguitarforums.com/smf/index.php?topic=11998.0

lord-g

#15
Quote from: Elantric on September 02, 2014, 09:56:19 AM
No

See link below for alternative strategy to add 5 pin MIDI I/O to Boss GP-10 using $35 Raspberry Pi computer
https://www.vguitarforums.com/smf/index.php?topic=11998.0

Elantric
Thank You

AaronMusic

Quote from: Spider on October 09, 2013, 06:41:01 AM
Finally I made some tutorial... Please ask, comment etc.

MIDI USB HOST DIY tutorial
By Spider ver. 1.0 (9 Oct 2013)


Download PDF Instruction in ENG here: http://cyfrowogitarowo.pl/archiwa/124

Hello and thanks for the tutorial. I followed it using the recommended boards and installed the required libraries.
But I ran into some compilation errors including:
D:\Docs\Arduino\libraries\USB_Host_Shield_2.0-master/SPI.h:54:22: fatal error: avr32/io.h: No such file or directory
D:\Docs\Arduino\libraries\USB_Host_Shield_2.0-master/SPI.h:54:22: fatal error: avr32/io.h: No such file or directory

I'm using the latest Arduino IDE, ver 1.6.5 on two PCs with the same results, (WinXP and a Win 8.1)
The standard Arduino example sketches compile and run fine from both PCs. (Blink, etc.)
USB_MIDI_converter.ino and bidrectional_converter.ino give the same error messages.

Any suggestions?  Thanks, Aaron


Spider

All new libraries should be where Arduino IDF libraries are. And use simple names for folder like USB_Host_Shield_2 not USB_Host_Shield_2.0-master. On GitHub use Download as a ZIP button.

AaronMusic

Quote from: Spider on September 16, 2015, 10:58:36 AM
All new libraries should be where Arduino IDF libraries are. And use simple names for folder like USB_Host_Shield_2 not USB_Host_Shield_2.0-master. On GitHub use Download as a ZIP button.

Thanks for the quick reply. The problem is that the headers are not in the libraries. The two missing files (so far) are SPI.h and avr32/io.h.

Arduino IDE, ver 1.6.5 installs libraries from the ZIPs from within the IDE and puts them in the default document directory in its own sub-directry, ie. D:\Docs\Arduino\libraries. (and requires them to be there) I downloaded all of the libraries as full ZIPs.

The calls for the missing files are from "includes" within files in those libraries, not from the main sketch. So the compiler is reading the libraries, it's just that SPI.h and avr32/io.h are not in there. 

I'm wondering if this a problem in the newer version of the Arduino IDE. What version did you use?

I found the following on https://communities.intel.com/message/227889
.......................
"The avr directory (avr32/io.h) is Atmel processor specific; there is no Intel equivalent. In these forums, at least one include was converted (dummied out). io.h has not been converted, and will need some work by a forum member. "
.............
Re: How to find avr/io.h: No such file or directory
rmm200 Acolyte Mar 14, 2014 8:12 AM (in response to Wang_Xin)

The process is simple:

1) Download Arduino IDE 1.05. It can coexist with Arduino 1.53 (different directories).
2) Navigate to Arduino 1.05\hardware\tools\avr\avr\include\avr - this contains everything you will need to convert
3) Navigate to Arduino 1.53\hardware\arduino\x86\cores\arduino and create a directory avr
4) Copy io.h from 2) to 3)
5) Copy nested includes sfr_defs.h, portpins.h, common.h, and version.h as well
6) Now it gets harder - compile your sketch and correct all compile errors. Comment out all sections that don't apply to Galileo.
7) You are sure to need avr\pgmspace.h also. A corrected (commented out) version was posted to this forum.

What do you think?  Thanks, Aaron

Spider

I use Arduino IDE 1.05 on OS X and yes... new IDE doesn't work.

AaronMusic

Quote from: Spider on September 16, 2015, 01:48:26 PM
I use Arduino IDE 1.05 on OS X and yes... new IDE doesn't work.

Thanks for the info. I downloaded Arduino IDE 1.0.5 and installed it on another WinXP machine. I installed the three libraries and compiled the USB_MIDI_converter.ino. It compiled without errors. I'll assemble boards later and test it with the FTP and a MIDI monitor and synth. I'll also write a follow up covering a few details I discovered so far that may help others.

Thanks again for your tutorial and your help. Cheerio, Aaron

Spider

Use sketch called Multi for FTP.
For bidirectional communication (sostenuto CC in for example) use "bidirectional" sketch.

AaronMusic

Quote from: Spider on September 17, 2015, 10:47:30 AM
Use sketch called Multi for FTP.
For bidirectional communication (sostenuto CC in for example) use "bidirectional" sketch.

I tested today with FTP and a hardward synth. All works well. Thanks to Spider for the tutorial, to Yuuichi Akagawa for the library and everyone else who went before. I'll post a few notes to smooth over a few bugs I found along the way.

I used the USB_MIDI_converter.ino sketch because I only need MIDI in one direction. But I imagine any of the sketches (except dump) would do this as well.

I have two goals for this project:

1. Play the FTP into a hardware synth without using a laptop. That's now accomplished.

2. Modify the MIDI stream coming from the FTP and change how it handles legato. I like the FTP better than any other MIDI pickup system I've tried but I would like a better/different implementation of legato for my playing style. I wrote some code to do this for wind controllers years ago using a different microprocessor so I have a head start on this goal. I'll post results on this if folks are interested.

Thanks again for all the help.  Cheerio, Aaron

Spider

You should use Multi if you want use separate MIDI channels for strings. In HW mode legato and other modes are determined by patch. So one could be set to triggered other to auto and third as stepped.

AaronMusic

Quote from: Spider on September 18, 2015, 12:31:09 PM
You should use Multi if you want use separate MIDI channels for strings. In HW mode legato and other modes are determined by patch. So one could be set to triggered other to auto and third as stepped.

Thanks for the comment. I'm not sure I understand what you're saying. Yuuichi Akagawa's READ ME says:
for single device > File->Examples->USBH_MIDI->USB_MIDI_converter
for multiple device (with USB hub)> File->Examples->USBH_MIDI->USB_MIDI_converter_multi

That seems to suggest that either you need to use multi when you have multiple MIDI devices (with different IDs) in the same stream, or he's added code to handle multiple USB devices in the USB protocol. Not clear which he means.

I haven't read thru his code functions yet so I don't yet know how he's parsing either the USB or the MIDI stream. However I'm only using one FTP.  I am using it in hardware mode and in mono mode which sends each string on a different MIDI channel. But even if you assign strings to different splits it's still only one device, yes? I'm new to FTP and haven't dug into this yet.

In any case, while using the single version: USBH_MIDI->USB_MIDI_converter, I'm getting the same MIDI stream on 6 channels as I do when running it thru the laptop.

However my ultimate goal is to intercept the MIDI stream in the Arduino, discard the FTP's interpretation of legato (auto, stepped, etc.), modify the Note_On, Note_off sequences and handle legato passages in the hardware synth. So I still have to read a lot of his code to see where to modify it.

I appreciate both corrections to my understanding and suggestions in this project. Thanks again, Aaron