[Noisebridge-discuss] How do I get midi messages from Arduino into a MIDI program, like Traktor?
Gian Pablo Villamil
gian.pablo at gmail.com
Sun Jan 30 12:32:32 PST 2011
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
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.
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
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
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).
On Sun, Jan 30, 2011 at 11:00 AM, Michael Shiloh <
michaelshiloh1010 at gmail.com> wrote:
> You say, in (5):
> "Teensy's ... Midi profile ... will make them show up as a USB Midi
> This sounds like the key of my misunderstanding.
> Is a USB Midi device something sufficiently universal that it will
> immediately be available to software like Traktor? How will it appear in
> the pulldown menu?
> Perhaps I need to see this in order to understand it.
> On 01/29/2011 07:11 PM, Tymm Twillman wrote:
> > On Jan 29, 2011, at 5:25 PM, Michael Shiloh wrote:
> >> Very helpful information. Thanks. I will read and digest.
> >> 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?
> > Well, you get
> > - 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
> > - Less latency if you use a decent adapter
> > #4& #5 would also let you plug in cleanly without other weird hacks
> though -- and wouldn't require drivers on most systems.
> >> On 01/29/2011 05:03 PM, Tymm Twillman wrote:
> >>> Well there's a couple of ways to go about it.
> >>> Thing is, regular Arduinos (Diecimila, Duimilanove, Uno, ...) show up
> as USB serial ports, not USB Midi. So here's a small load of approaches...
> >>> 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
> http://timothytwillman.com/itp_blog/?page_id=240 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
> >>> 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:
> http://amorphicrobotworks.org/works/growth/index.htm are controlled for
> >>> 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.
> >>> 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.
> >>> 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).
> >>> On Jan 29, 2011, at 4:31 PM, Michael Shiloh wrote:
> >>>> Although I'm pretty comfortable with Arduino, I'm not very plugged in
> >>>> the MIDI music control scene, although I understand the underlying
> >>>> technology.
> >>>> Note that the word MIDI here refers only to the protocol. There is no
> >>>> MIDI plug: it's MIDI over USB.
> >>>> One of my students wants to build a MIDI input device for Traktor,
> >>>> is a music manipulation program. The MIDI input is not a keyboard or
> >>>> other musical instrument, but rather a generic set of knobs and
> >>>> that can be mapped to certain Traktor functions.
> >>>> I suspect this same mechanism is used by a wide range of music and
> >>>> programs, so that arbitrary control surfaces can be used to control
> >>>> various functionality. (I think I've heard of a video editor working
> >>>> same way.)
> >>>> My student, Trevor, wants to use Arduino to build his control surface.
> >>>> I can handle the Arduino/sensor/USB side of things, but I'm mystified
> >>>> to how to make it appear as a MIDI input to Traktor.
> >>>> Trevor showed me how you add new inputs (controllers) to Traktor, and
> >>>> there is a pulldown menu for manufacturer and model.
> >>>> I guess that when you buy an off-the-shelf MIDI control surface, it
> >>>> comes with a driver that makes it appear to be a MIDI device, which
> >>>> application software can then attach to.
> >>>> These means that for any DIY device like Arduino, we must provide the
> >>>> equivalent of this driver, that speaks the right protocol and
> >>>> applications like Traktor that it is a legitimate MIDI device.
> >>>> I'm sure that this software exists, and that it's free, but I have no
> >>>> idea what it's called, or where to find it, or, if I can write it,
> >>>> I should make it do.
> >>>> Any advice?
> >>>> _______________________________________________
> >>>> Noisebridge-discuss mailing list
> >>>> Noisebridge-discuss at lists.noisebridge.net
> >>>> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
> >> --
> >> Michael Shiloh
> >> KA6RCQ
> >> www.teachmetomake.com
> >> teachmetomake.wordpress.com
> Noisebridge-discuss mailing list
> Noisebridge-discuss at lists.noisebridge.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Noisebridge-discuss