The MidiBus is a MIDI library for Processing. It provides a quick and simple way to access and interact with installed MIDI system resources. The MidiBus is aimed primarily at real time MIDI applications. The focus is on strong MIDI I/O capabilities and keeping frills to a minimum (e.g. currently no built in sequencer, file read/write, MIDI recording/playback).
Download and Javadocs
- Visit the GitHub page and download it there
- Latest Release (includes examples and javadocs)
- The MidiBus Online Javadocs
A Few Quick Notes
Before you get started, it is important to understand that the MidiBus offers little functionality that isn't available from Java's native javax.sound.midi package. Anyone interested in working with MIDI in Java should take the time to read the documentation for the javax.sound.midi. It offers a more full featured and flexible alternative to this package, although it does do so at the cost of added complexity. In addition, it may be worthwhile to skim the "official" Java Tutorial for the javax.sound.* packages.
The MidiBus is very straight forwards to use. A good place to start is the Basic.pde example included in the latest release. From there you can look at the Javadocs either online or bundled with your library in the "reference" subdirectory. The Javadocs are a comprehensive reference of all the MidiBus' available functionality. There are also a few advanced examples which can (hopefully) help answer the most common questions: how to work with multiple input/output devices, how to send uncommon MIDI messages and how to receive uncommon MIDI messages.
Please do not hesitate to contact me with any questions, comments or bug reports.
Caveats, Problems with SysEx, Alternate MIDI for java
The Apple MIDI subsystem has a number of problems. Most notably it doesn't seem to support MIDI messages with status >= 0xF0 such as SysEx messages. You can use MMJ as an alternate subsystem. To do so, download mmj and add both mmj.jar and libmmj.jnilib to the midibus library subdirectory. You must also disable timestamps in your MidiBus instance otherwise MMJ won't work properly. You can do so by calling mybus.sendTimestamp(false). Check out the README and the advanced example for more information