All USB devices are set up to identify themselves to a computer when they plug in. (This is what allows drivers to be downloaded automatically.) However, many USB devices of a similar type can share drivers, and are called "class compliant". Examples are keyboards, mice, flash drives and external storage, some cameras, audio devices, AND USB-MIDI devices. Class-compliant devices support inheritance: they can use the built-in OS drivers, or you can manually install a more sophisticated driver for additional features.<div>
<br></div><div>Older Arduinos, by default, are not class-compliant, and require installation of a device driver, basically a serial-over-USB driver. New Arduinos, and the Teensy, let you reprogram the device identifier, to one of the the standard classes. This lets you plug in a Teensy or an Arduino Uno, and have it appear to the computer as if you have just plugged in a keyboard/mouse/storage device/MIDI device. Of course, it is up to you to make sure that what you are sending out the port is coherent and makes sense. In the case of MIDI, your software (on the microcontroller) is still just sending serial data.</div>
<div><br></div><div>So by using a Teensy or an Arduino Uno you can probably build something that when plugged in to a USB port will be automatically identified as a MIDI device. </div><div><br></div><div>The alternative that Tymm mentioned is a driver that was published by Roland quite a while ago, that will map input from a serial port to a virtual MIDI device. You could take a regular Arduino, which when plugged into a computer appears as a serial input, and connect it via the driver to something that will appear like a regular MIDI device to the operating system. Here are some ancient instructions on setting up, the Roland specific part is towards the end. I believe the driver has been updated since, try downloading it directly from Roland. Apparently Alesis and Yamaha also make a serial to MIDI driver.</div>
<div><br></div><div>Disadvantage of this approach is that you need one more piece of (antiquated) software, but it will appear just fine to Traktor and such. It is also PC only. (I think Apple might incorporate a serial-to-MIDI driver in OS/X, not sure).<br>
<br><div class="gmail_quote">On Sun, Jan 30, 2011 at 11:00 AM, Michael Shiloh <span dir="ltr"><<a href="mailto:michaelshiloh1010@gmail.com">michaelshiloh1010@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You say, in (5):<br>
<br>
"Teensy's ... Midi profile ... will make them show up as a USB Midi device."<br>
<br>
This sounds like the key of my misunderstanding.<br>
<br>
Is a USB Midi device something sufficiently universal that it will<br>
immediately be available to software like Traktor? How will it appear in<br>
the pulldown menu?<br>
<br>
Perhaps I need to see this in order to understand it.<br>
<div><div></div><div class="h5"><br>
On 01/29/2011 07:11 PM, Tymm Twillman wrote:<br>
><br>
> On Jan 29, 2011, at 5:25 PM, Michael Shiloh wrote:<br>
><br>
>> Very helpful information. Thanks. I will read and digest.<br>
>><br>
>> To confirm my understanding of #3, the reason the price of going Arduino->Midi->"real" Midi-to-USB is to get the software that comes with the "real" Midi-to-USB adapter that makes it look like a real Midi device to the application, without any (further) weird hacks?<br>
><br>
> Well, you get<br>
><br>
> - MIDI standard connectors& interface (which is optoisolated, if a bit slow) and ability to connect directly to "real" MIDI hardware. Old-school MIDI is actually a pretty hacker-friendly protocol once you start playing with it, and requires very minimal hardware to use on... well just about anything.<br>
> - Less latency if you use a decent adapter<br>
><br>
> #4& #5 would also let you plug in cleanly without other weird hacks though -- and wouldn't require drivers on most systems.<br>
><br>
><br>
><br>
>><br>
>> On 01/29/2011 05:03 PM, Tymm Twillman wrote:<br>
>>> Well there's a couple of ways to go about it.<br>
>>><br>
>>> Thing is, regular Arduinos (Diecimila, Duimilanove, Uno, ...) show up as USB serial ports, not USB Midi. So here's a small load of approaches...<br>
>>><br>
>>><br>
>>> 1) Roland has some software that folks use to convert, but I don't remember the name of it (sure a quick web search would find it). This would have to be installed on any systems that would use the Arduino for Midi. The Arduino needs to speak Midi over its serial port though -- not too hard; there are several examples on the Arduino Playground. I also have a Midi stack for Arduino that I've put up on <a href="http://timothytwillman.com/itp_blog/?page_id=240" target="_blank">http://timothytwillman.com/itp_blog/?page_id=240</a> that a number of folks are using for Midi projects -- though there may be some issues with newest Arduino release that I haven't had time to straighten out (seems that the Arduino software now doesn't include some headers that they used to by default).<br>
>>><br>
>>> 2) Another alternative is to use Max/MSP or Pure Data to act as an intermediary (I've done a number of projects sending / receiving Midi over the Arduino's serial port at a standard baud rate, and then using one of these to route the messages to/from the OSX system MIDI buses, mostly using the Midi stack mentioned above... that's how these: <a href="http://amorphicrobotworks.org/works/innerspace/index.htm" target="_blank">http://amorphicrobotworks.org/works/innerspace/index.htm</a> <a href="http://amorphicrobotworks.org/works/growth/index.htm" target="_blank">http://amorphicrobotworks.org/works/growth/index.htm</a> are controlled for example).<br>
>>><br>
>>> 3) Another approach (the way I prefer for music) is to build or buy a Midi shield, and hook into a "real" USB to Midi adapter (e.g. MidiSport 2x2 -- you can find them sometimes on Craigslist, etc. for anywhere from $5-$50). The main advantages here are the more "standard" driver support, and with good quality hardware / drivers you can decrease some of the extra latency that comes from cheapy USB Midi adapters (on top of Midi's already borderline crappy latency)... a little technical, but the way most USB serial adapters, and cheap Midi adapters send data over USB isn't great for minimizing latencies; professional hardware& drivers have been designed to do a better job at this. Narbotic's Vox Box does this.<br>
>>><br>
>>> 4(?) ) I've heard speak of some ways to get Uno's to show up as other USB devices, but I don't have one and haven't tried. Since they use AVR chips as the USB Serial Converter,I suspect you upload new firmware to that chip... no clue difficulty on that.<br>
>>><br>
>>> 5) Teensy's have a Midi profile that can be used in the newest Teensyduino releases. This will make them show up as a USB Midi device. I haven't played with it. But the Teensy stuff is generally well put together, and I use 'em for other things all the time, mostly rapid prototyping and tiny embedded controllers. There's some disagreement / lack of clarity in just how well they fit an open source model (don't think they release assembly files for their boards, and might be some pieces of e.g. the bootloading software that they don't release, but haven't spent the full time to dig into it... and for me personally it's not that big of an issue... but it does bother some folks that they don't seem to match the open source model of the Arduino boards).<br>
>>><br>
>>><br>
>>><br>
>>> On Jan 29, 2011, at 4:31 PM, Michael Shiloh wrote:<br>
>>><br>
>>>> Although I'm pretty comfortable with Arduino, I'm not very plugged in to<br>
>>>> the MIDI music control scene, although I understand the underlying<br>
>>>> technology.<br>
>>>><br>
>>>> Note that the word MIDI here refers only to the protocol. There is no<br>
>>>> MIDI plug: it's MIDI over USB.<br>
>>>><br>
>>>> One of my students wants to build a MIDI input device for Traktor, which<br>
>>>> is a music manipulation program. The MIDI input is not a keyboard or<br>
>>>> other musical instrument, but rather a generic set of knobs and sliders<br>
>>>> that can be mapped to certain Traktor functions.<br>
>>>><br>
>>>> I suspect this same mechanism is used by a wide range of music and other<br>
>>>> programs, so that arbitrary control surfaces can be used to control<br>
>>>> various functionality. (I think I've heard of a video editor working the<br>
>>>> same way.)<br>
>>>><br>
>>>> My student, Trevor, wants to use Arduino to build his control surface.<br>
>>>><br>
>>>> I can handle the Arduino/sensor/USB side of things, but I'm mystified as<br>
>>>> to how to make it appear as a MIDI input to Traktor.<br>
>>>><br>
>>>> Trevor showed me how you add new inputs (controllers) to Traktor, and<br>
>>>> there is a pulldown menu for manufacturer and model.<br>
>>>><br>
>>>> I guess that when you buy an off-the-shelf MIDI control surface, it<br>
>>>> comes with a driver that makes it appear to be a MIDI device, which the<br>
>>>> application software can then attach to.<br>
>>>><br>
>>>> These means that for any DIY device like Arduino, we must provide the<br>
>>>> equivalent of this driver, that speaks the right protocol and convinces<br>
>>>> applications like Traktor that it is a legitimate MIDI device.<br>
>>>><br>
>>>> I'm sure that this software exists, and that it's free, but I have no<br>
>>>> idea what it's called, or where to find it, or, if I can write it, what<br>
>>>> I should make it do.<br>
>>>><br>
>>>> Any advice?<br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Noisebridge-discuss mailing list<br>
>>>> <a href="mailto:Noisebridge-discuss@lists.noisebridge.net">Noisebridge-discuss@lists.noisebridge.net</a><br>
>>>> <a href="https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss" target="_blank">https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss</a><br>
>>><br>
>>><br>
>><br>
>> --<br>
>> Michael Shiloh<br>
>> KA6RCQ<br>
>> <a href="http://www.teachmetomake.com" target="_blank">www.teachmetomake.com</a><br>
>> <a href="http://teachmetomake.wordpress.com" target="_blank">teachmetomake.wordpress.com</a><br>
><br>
><br>
_______________________________________________<br>
Noisebridge-discuss mailing list<br>
<a href="mailto:Noisebridge-discuss@lists.noisebridge.net">Noisebridge-discuss@lists.noisebridge.net</a><br>
<a href="https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss" target="_blank">https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss</a><br>
</div></div></blockquote></div><br></div>