FTDI USB and MIDI

Hi

I was just wondering if anyone had done any previous work, or seen any reference on how to connect PC MIDI over the serial FTDI usb chip. I have downloaded a roland serial midi driver, is this all I need to get midi to exit the FTDI chip into the CPLD?

cheers jacko

Reply to
jacko
Loading thread data ...

I don't think this will work. MIDI relies on exact timing of the data, which is impossible with a serial-USB solution. For instance, when you send a few bytes out to the virtual com port of the FDTI chip, these bytes will be sent only when the the buffer is filled up or when a time-out occurs. This timeout is set to 16ms default but can be set to any time between 1 and 255ms. And even then there are delays in transmission and reception of short bursts of data. When implementing an XON/XOFF handshake recently, I experienced delays of several 10's of ms between sending the XON/XOFF charachters and receiving them on the other end. Even though I set the FTDI latency timer to 2ms.

Meindert

Reply to
Meindert Sprang

hi

setting the baud rate much higher than the 9600 default (115200), flow control none. Haven't worked out how to set the ftdi driver timeout. Changed the com port to COM2, Set Roland Serial MIDI driver to use COM2. Just wondering if the latency will be acceptable.

cheers jacko

Reply to
jacko

hi

After looking at the FTDI latency documentation 38400 baud seems best, to always trigger a 16ms timeout (greater than 62 note start/end points per second, and about 16 note events per start/end point), and it's higher than midi baud. There appears to be no information on the PC -> FTDI latency. This is the bit I was really interested in.

cheers jacko

Reply to
jacko

At leas a part of that is a USB issue. Serial port devices use Bulk endpoints to transfer data. Bulk endpoints have no guaranteed latency across the USB, as the effectively get the leftover bandwidth of the bus. In practice this may mean that the typical latency is good (1ms minimum for USB 1.1), but if there are other devices on the same bus doing file transfers, that will change :)

--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
  and we never even know we have the key."
"Already Gone" by Jack Tempchin (recorded by The Eagles)

The Beatles were wrong: 1 & 1 & 1 is 1
Reply to
Michael N. Moran

It will be the only device on the PC hub if necessay. I just want to know if playing a midi file using PC synth and FTDI serial synth on seperate channels, will sync close enough.

cheers jacko

p.s. this is because I have an FTDI on the MAX II devkit I have, and well...

Reply to
jacko

Depending upon your definition of "close enough". Another thing I noticed is that you talk about using

38,400 baud. I doubt that will work reliably. The MIDI spec wants 31,250 baud +- 1%. Of course, that has nothing to do with the USB latency issue of 1ms. IIRC, there is a minimum timeout between bytes of 10 character times, which is about 3ms. So it would seem the USB might work from that perspective. Also note that there are more than a few USB/MIDI adapters out there, so USB performance must be somewhat reasonable :)
--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
  and we never even know we have the key."
"Already Gone" by Jack Tempchin (recorded by The Eagles)

The Beatles were wrong: 1 & 1 & 1 is 1
Reply to
Michael N. Moran

baud is greater therefore no loss, so not bothered.

3ms ok. =2E

just have devkit with usb, simulation of midi over it ok then fine.

Reply to
jacko

Umm... what do you mean by this? The other MIDI devices

*will* mind if you try to use a 38.4Kbaud signal on a MIDI "bus", since they expect the baud rate shown below. This is not a bandwidth issue, its a UART character synchronization issue.

Or have I missed something?

--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
  and we never even know we have the key."
"Already Gone" by Jack Tempchin (recorded by The Eagles)

The Beatles were wrong: 1 & 1 & 1 is 1
Reply to
Michael N. Moran

Well the player would sen d midi to the roland driver, which then would send it to the USB serial device, (Midi rate not supported), so as long as usb serial rate exceeds midi rate there is no backstore of data waiting or stalled. Going from usb serial to midi, the usb device should not send much midi, mainly sysex, so not used for synchronous note playing.

The other midi devices will never receive an incorrect baud rate. They will be on another midi port, either internal general midi sound, OPL3 synth, virtual synth or game port midi. In this sense the midi over usb is just a tunnel layer over USB with the same serial protocol.

cheers jacko

Reply to
jacko

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.