Arduino MIDI library updated

Date December 18, 2008

I’ve had a chance to test the examples (and split into seperate send/receive, plus included code I used for a recent NIME performance involving MIDI-controlled pneumatics), fill in some comments, and generally make it a bit nicer. Please go here to download. I’d love feedback if you try it!

5 Responses to “Arduino MIDI library updated”

  1. dave clark said:

    I am trying to build a midi controller for a pneumatically controlled haunted house. Any suggestions? we’ve down haunted houses for the past few years using a mechanical state machine with roller switches. It was awful.

    I am talking to a guy in IReland, Tom Scarff, who has some boards that might do the tric. I’ll download your midi code but it is probably a bit over my head.

  2. Gareth Jeanne said:

    Hi Timothy,

    I have been using your midi Library recently with great success to create a midi controlled midi switching box.

    However i now need the ability to use two serial ports on the Arduino mega for two midi streams. Is this possible with your current library, i have tried to work out how to do it but without much joy, any pointers you could give me would be hugely appreciated!

    Cheers

    Gareth Jeanne

  3. tymm said:

    Sorry for late response; for some reason I wasn’t getting notifications of new comments…

    You’ve probably got things figured out by now but there are a couple of Arduino MIDI libraries out there that you can use… the one at ruinwesen.com *might* be easier… i believe there are also some examples of midi in on the arduino site. that being said, if you play with the example for this library to control LEDs, it shouldn’t be too hard to tweak to control other hardware… you don’t really need to understand the inner workings of the library, just make the functions that handle the MIDI data.

    For my midi based pneumatic setup, I used small SMC valves that don’t require much power and TPIC595 shift registers chained together to drive them; the TPIC595′s are able to handle enough current to control the small valves directly.

  4. tymm said:

    Hi Gareth,

    I’m sending a private mail, since the explanation depends a bit on C++ experience :)

    The basics though are:

    if both channels are just sending: it’s easy. You do the same thing you’d do but create 2 midi objects, e.g.

    Midi midi(Serial);
    Midi midi1(Serial1);

    and then use midi for everything going to the first serial port, midi1 for everything going to the second one.

    For receiving / both sending & receiving you’d similarly do things like the “EXAMPLE CODE FOR A MIDI RECEIVER” but you’d do the whole shebang twice, one for each channel. e.g. you’d have something like:

    class MyMidi : public Midi {
    … code for first channel …
    };

    class MyMidi1 : public Midi {
    … code for second channel …
    };

    and initialize with e.g.

    MyMidi midi(Serial);
    MyMidi1 midi1(Serial1);

    … and then in the example where midi.begin(0) is called you add midi1.begin(0), and do the same for midi.poll().

  5. David Bernhadt said:

    Tymm:

    I’m trying out your midi library, since I’m having some issues filtering out active sensing while using the MidiLib 2.5 on the Arduino Playground site.

    I’m using the Teensy 2.0 board. When I try to compile MidiReceiveExample, I get an error on

    MyMidi midi(Serial);

    which reads: “error: no matching function for call to “MyMidi::MyMidi(usb_serial_class&)”

    Can you shed any light on this error? Thanks.

    Dave

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>