The Musical Instrument Digital Interface (MIDI) is a standard for representing and communicating musical data. Its fundamental notion is that instantaneous musical events generated by a digital musical device can be encapsulated as "messages" of a known length and format. These messages can then be transmitted to other computer devices where they're acted on in some manner.
The Midi Kit understands the MIDI software format (including Standard MIDI Files). With the Kit, you can create a network of objects that generate and broadcast MIDI messages. Applications built with the Midi Kit can read MIDI data that's brought into the computer through a MIDI port, process the data, write it to a file, and send it back out through the same port. The Kit also contains a General MIDI synthesizer that you can use to realize your MIDI scores. This is a software synthesizer that includes reverberation—you don't any outboard equipment to use it.
The documentation of the Midi Kit is divided into two parts: The first part describes the basic MIDI classes; the second part describes the classes that give you access to the Headspace synthesizer. There are four basic MIDI classes:
BMidi
The BMidi
class is the centerpiece of the Kit. It defines the tenets to
which all MIDI-processing objects adhere, and provides much of the
machinery that realizes these ideas. BMidi
is abstract—you never create
direct instances of the class. Instead, you construct and connect instances
of the other Kit classes, all of which derive from BMidi
. You can also
create your own classes that derive from BMidi
.
BMidiPort
BMidiPort
knows how to read MIDI data from and write it to a MIDI hardware
port.
BMidiStore
BMidiStore
provides a means for storing MIDI data, and for reading,
writing, and performing Standard MIDI Files.
BMidiText
BMidiText
is a debugging aid that translates MIDI messages into text and
prints them to standard output. You should only need this class while
you're designing and fine-tuning your application.
The synthesizer classes are:
BSynth
BSynth
represents the General MIDI synthesizer and controls some of its
global settings (reverb, volume, and so on). Every app that wants to use
the synthesizer must have a single BSynth
object (represented by the global
be_synth
variable). The other synthesis classes (below) create this object
for you.
BMidiSynth
BMidiSynth
is a BMidi
-derived
class that connects the basic MIDI world (as
represented by the BMidi
class) to the synthesizer.
BMidiSynthFile
BMidiSynthFile
is a subclass of
BMidiSynth
that lets you play a MIDI file
on the synthesizer.
BSamples
BSamples
is an interface to the synthesizer's sound data stream. It lets
you mix normal audio data in with the synthesized sound.
This documentation doesn't attempt to teach you anything about the MIDI or General MIDI specifications. In many cases, you don't need to know anything about the specs (or at least not much). For copies of the MIDI specs, search the Web for "midi specification" (there are dozens of copies out there); or go to the official source at www.midi.org.