sparks / themidibus

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

NullPointerException from example - fresh windows install processing 4.3 #36

Open jmej opened 11 months ago

jmej commented 11 months ago

I have run this example code on many installs of 4.3 using theMidiBus library from the package manager but on this particular system (windows 11 pro) I can't get the exmaple to run without a NullPointerException with no further information.

I tried downloading the latest library release manually but had the same problem.

jmej commented 11 months ago

the workaround mentioned here seems to work...

AndresMartinM commented 7 months ago

hi ✌️ i tried the examples, and apparently i fixed that problem in particular changing the parent of the MidiBus from 'this' to 'new java.lang.Object()'. myBus = new MidiBus(new java.lang.Object(), -1, 3); i'm using the processing library manager version of themidibus. i still have some other issues, but the nullpointerexception disappears

fukuchi commented 4 days ago

There are other workarounds as shown below.

// myBus = new MidiBus(this, input, output);
myBus = new MidiBus();
myBus.registerParent(this);
myBus.addInput(input);
myBus.addOutput(output);