Problem with theMidiBus on Mac mini M2 Pro

I just made a fresh install of Processing 4.3 on a new M2 Mac mini running Ventura 13.6,
just to find that my old sketches using theMidiBus library do not work.

I also tried with the basic examples coming with the libraries, and I’m seeing the same problem as well: NullPointerException when loading a midi device on the setup. It doesn’t matter which of the listed devices I choose, it will throw the error before ending the setup.

Has anyone else found this problem? any chance to find a solution to have midi working on this new m2 machines?


I finally solved the issue dismissing the use of theMidiBus libraty and going stratight to JAVA MIDI. If someone else finds this same problem, i share the helper functions i wrote to have an easy replacement for the midi bus using Java MIDI. Here it goes:

void setupMIDI() {
  try {
    // List all available MIDI devices
    MidiDevice.Info[] infos = MidiSystem.getMidiDeviceInfo();
    for (int i = 0; i < infos.length; i++) {
      println("Device " + i + ":");
      println("  Name: " + infos[i].getName());
      println("  Description: " + infos[i].getDescription());
      println("  Vendor: " + infos[i].getVendor());
    // Define the desired device index
    int desiredDeviceIndex = 2;  // Replace with the desired index

    // Check if the index is valid
    if (desiredDeviceIndex >= 0 && desiredDeviceIndex < infos.length) {
      midiDevice = MidiSystem.getMidiDevice(infos[desiredDeviceIndex]);
      if (!midiDevice.isOpen()) {;
      // Initialize receiver
      midiReceiver = midiDevice.getReceiver();
    } else {
      println("Invalid device index!");
  } catch (MidiUnavailableException e) {
    println("Error initializing MIDI devices: " + e.getMessage());

void sendMidiMessage(int command, int channel, int note, int velocity) {
  try {
    ShortMessage message = new ShortMessage();
    message.setMessage(command, channel, note, velocity);
    midiReceiver.send(message, -1);
  } catch (InvalidMidiDataException e) {

also, remember to add this to initialization:

import javax.sound.midi.*;
MidiDevice midiDevice;
Receiver midiReceiver;
1 Like