sparks / themidibus

A simple MIDI Library for Processing
http://www.smallbutdigital.com/themidibus.php
GNU Lesser General Public License v3.0
176 stars 37 forks source link

Cant connect MIDI Device with Processing #32

Open charnsith opened 2 years ago

charnsith commented 2 years ago

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 :(

NicholasCHowlett commented 1 year ago

@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 commented 1 year ago

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