Roland TD-15 MIDI read/write

It seems I had a request recently to improve my Roland TD-15 hack. And since I'm such a nice guy *cough* I figured I'll have a go at it... and behold the new version! It's pretty similar to the old one except that it now not only sends from the Roland to MIDI but also the other way around, i.e. it's "read / write".

Unfortunately the development didn't went as smooth as I hoped. Conceptually it was quite easy, just read from the MIDI device and pass that to USB via bulk data. The first annoying but was the fact that some programs send MIDI data in a somewhat shortened version which means you can't pass it directly but it needs some conversion. 

However that wasn't the bit I struggled with... reading from both MIDI and USB at the same time was. The first attempt was to fork the process and read USB in one process and MIDI in the other. While this worked in principle, it caused a weird issue, namely that the USB reading process would catch the result of the other process writing to the USB port. Which in turn locked up the device causing nothing to happen after that. What I don't get is that windows manages to send to the USB while listening to it uninterrupted. So probably the reading process is paused during the write... then again I haven't managed to convince LibUSB to do so...

Anyway as a result it's now a "polling" based driver which continuously checks the MIDI and the USB devices for new data and handles it accordingly. The obvious result is that it causes a somewhat heavy load and lags (a little)... then again I played around with Renoise and my TD-15 and I'm actually quite pleased with the results!

Enjoy, and keep the feedback coming!

XHTML 1.1 valid CSS 3.0 valid JavaScript 1.6 valid Vivaldi valid Os-linux valid Ws-apache valid Php valid Jas valid