themidibus icon indicating copy to clipboard operation
themidibus copied to clipboard

Cant connect MIDI Device with Processing

Open charnsith opened this issue 2 years ago • 2 comments

Hi there! I'm very new to coding especially with Processing.

After researching through this i've tried the first step of connecting my MIDI device and found an error :


Consoles error :

java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because the return value of "java.util.Map.get(Object)" is null at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1388) at processing.core.PApplet.handleMethods(PApplet.java:1542) at processing.core.PApplet.dispose(PApplet.java:3593) at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:405) NullPointerException Could not run the sketch (Target VM failed to initialize). For more information, read Help → Troubleshooting.


I have only trying to import MIDI device, and could not find the name of my midi on the device list. I have connected my devices to other music making software logic pro and it works fine. Note that when i try connecting the device the additional input number is 2 and 3 so I put 2 and 3 as my input and output.


import themidibus.*;

MidiBus bus;

void setup() { MidiBus.list();

bus = new MidiBus(this,2,3); }


Console Shows

Available MIDI Devices: ----------Input---------- [0] "Real Time Sequencer" [1] "Out" [2] "EDITOR Out" ----------Output---------- [0] "Gervill" [1] "Real Time Sequencer" [2] "In" [3] "EDITOR In"


Does anyone have similar problems or any suggestion :(

charnsith avatar Jul 26 '22 11:07 charnsith

@charnsith, I'm having the same issue. I'm guessing it's an issue with this library and how it calls Java, but I'm not very familiar with this area.

NicholasCHowlett avatar Dec 02 '22 22:12 NicholasCHowlett

@charnsith, seems my issue (and perhaps yours, too) can be solved using a workaround: https://github.com/sparks/themidibus/issues/28

NicholasCHowlett avatar Dec 02 '22 22:12 NicholasCHowlett