MidiBus NullPointerException

edited July 2014 in Library Questions

Hello,

I'm new to Processing but interested in controlling parameters via MIDI. I'm trying to play around with the MidiBus (http://www.smallbutdigital.com/themidibus.php) but I'm having problems with it. I've installed the library both manually and with the import library function within Processing, and the example patches won't run. I get a NullPointerException when trying to run the "Basic" example, and any object related to MIDIBus generates this. Any ideas?

I'm in Processing 2.2.1 on Mac OS X Mavericks.

Answers

  • Also tried ProMIDI with the same problems. In this case it appears the problem must be related to the way MIDI interfaces with Processing , not the specific library. Any ideas?

  • Can you use a few println() statements to determine where the nullpointer is created? Insert println() with some string at random places in the code and look which ones get printed out. Do this until you know which line causes the nullpointer (the println before will work but the one after it won't). Then we'll be able to help more.

  • In the example, the nullpointer occurs at the MidiBus.list(); line. Commenting it out will just make later calls create the nullpointer. The nullpointer happens in the first instance that MidiBus is called, wherever it is in the code.

    import themidibus.*;
    
    MidiBus myBus;
    
    void setup() {
      size(400, 400);
      background(0);
      MidiBus.list();
    }
    

    This is taken directly from the "Basic" example included with the install of MidiBus (comments removed).

  • Is it just a nullpointer error with no extra information?

    Other than that, I can't offer any help. That piece of code runs fine on my system. Do other programs have problems with MIDI?

    The Midibus website lists some problems with OSX. Maybe that's the cause?

  • Yes, there was no extra information on null I'm trying that, had not done it yet!

    Now the comment I get is "A library relies on native code that's not available. Or only works properly when the sketch is run as a 32-bit application." Note, this is with adding the correct comment that disables timestamps...

    I tried installing the extra things I had to add to the folder (mmj.jar, libmmj.jnilib), and when those didn't work I tried installing with the 32 bit versions also included in the distribution.

    Still no luck. I noticed a thread here that was last dated in April with the same problems I'm running into.

  • Are you using the 32 or 64 bit version of Processing? Have you tried both?

  • Apparently only the 64-bit version of Processing is available to Mac OS X 10.7+. This is probably the problem.

    Sad day, as I use Max/MSP in 32 bit mode most of the time too.

Sign In or Register to comment.