Home

MIDI Monitor



Source Code

The source code for MIDI Monitor can be downloaded here.

The code is released under the BSD license. See the LICENSE file in the source code for the legal details.

This is the source code for the entire application. You do NOT need any of this if you just want to use the application. You only need the source if you want to play with the code, customize the application, or use parts of the code in your own project.



What's Included

Everything you need to build MIDI Monitor is here. You should have a source tree that looks like this:

  • MIDI Monitor Source
    • Applications
      • MIDIMonitor
    • Frameworks
      • SnoizeMIDI
      • SnoizeMIDISpy
      • DisclosableView
    • Configurations
    • Scripts

In decreasing order of importance:

Applications/MIDIMonitor

The source to the MIDI Monitor application. The project file is MIDIMonitor.xcodeproj; open this using Xcode.

MIDI Monitor is a Cocoa application, written in Objective-C.

The application relies on the other frameworks, described below.

Frameworks/SnoizeMIDI

A framework containing code for dealing with CoreMIDI in a Cocoa app:

  • Creating a CoreMIDI client
  • Finding MIDI devices, sources, and destinations
  • Creating "streams" of input and output data, and hooking them up to inputs and outputs
  • Parsing MIDI streams into separate MIDI messages
  • Dealing with older versions of CoreMIDI (from 10.1 onwards)

This framework is used by both MIDI Monitor and my other application, SysEx Librarian. You should be able to use it in your own applications as well.

The code is mainly Objective-C, with one ordinary C file.

Frameworks/SnoizeMIDISpy

This project builds two things: A CoreMIDI driver, and a framework.

The CoreMIDI driver can "spy" on the MIDI sent to any destination in the system by any application. (Look up the MIDIDriverEnableMonitoring() function in CoreMIDIServer/MIDIDriver.h for more details.) The driver can then pass the MIDI data to another application.

The framework is used by applications that want to use the driver. It manages the communication between the app and the driver. It also provides the app with an easy way to install the CoreMIDI driver when necessary.

This code is currently only used by MIDI Monitor, but it could be useful in other contexts.

The driver is written in C++, and the framework is plain C code. So you should be able to easily use the code from a Cocoa or Carbon application.

Note that MIDI Monitor contains some code to channel the "spy" MIDI data into the rest of the SnoizeMIDI stream system, so it acts just like any other MIDI source.

Frameworks/DisclosableView

A framework containing a Cocoa "disclosable" view -- one that can be shown and hidden by the user on demand.

Configurations

Contains Xcode configuration files which are shared between the various different Xcode projects.

Scripts

Contains a script to build the final ("install") version of MIDI Monitor.



How To Build

The projects enclosed are for Xcode 2.2. You may be able to use the projects in earlier versions of Xcode, but no guarantees (that's up to you -- I haven't tried it myself).

The code will work on OS X 10.2 and later. It builds using the 10.2.8 SDK; if you didn't install this SDK along with Xcode, you will probably want to. Intel builds use the 10.4 SDK, of course.

For development builds: Open the MIDI Monitor project and build it. It will build all of the dependent frameworks as necessary.

For installation builds: There is a shell script in Scripts/BuildMIDIMonitor which builds the whole app and takes care of some miscellaneous details. If you just run the script, you should end up with a MIDIMonitorBuild directory in your home directory, with an "InstalledProducts" directory inside containing the built application. If you want the built results to go elsewhere, feel free to change the script.



Contact

Please send questions or comments to: MIDIMonitor@snoize.com