What does CMT do? The major components and their functions are:
The entire CMU MIDI Toolkit occupies 5 to 10MB of disk space, although this could be trimmed considerably by not compiling all the examples.
README
on the distribution disk.
With the computer powered off, install your (hardware) MIDI interface. Connect your keyboard MIDI OUT to the interface MIDI IN. Connect the interface MIDI OUT to your keyboard MIDI IN. Hardware procedures should be described in the documentation with your interface. This manual does not discuss hardware installation.
MIDI THRU is likely to cause some confusion at some point, so please read this and the next paragraph carefully. MIDI THRU means that MIDI IN data is copied to MIDI OUT. For example, an MPU-401 interface normally implements MIDI THRU when CMT is not running. Some synthesizers cannot handle having output data returned to their input, so you may have to disconnect one of the MIDI cables to avoid the adverse effects of MIDI THRU. On the other hand, if you connect your computer's MIDI OUT to a sound module, you may depend upon MIDI THRU to route MIDI from your keyboard to your sound module.
In the current releases (but check for documentation updates),
set MPUIRQ=6 set MPUBASE=360Be sure the values of these environment variables correspond to the actual hardware. Consult your MIDI interface hardware documentation to determine the proper values.
So, to use a SoundBlaster or other UART-mode MIDI interface, place the following in your autoexec.bat file:
set MPUUART=1and reboot. If you set MPUUART, then you must have the proper MPUIRQ and MPUBASE settings (see the previous section). CMT will not check these settings and will not operate if they are incorrect.
This procedure allows you to use the SoundBlaster MIDI interface only. You need an adapter cable to convert from the small sound card connector to MIDI connectors (see your sound card manual for details). Unfortunately, this procedure does not support the use of the synthesis capabilities of your sound card.
app/util/stepmeans the step program in the folder util, which is within the folder app. All directory paths are assumed to start in the directory in which the toolkit is installed. For DOS users, substitute ``\'' for ``/'' in paths.
Within your main CMT directory you will find four main folders (with names greater than two letters) and a bunch of folders with one- and two-letter names.
The main folders are:
The one- and two-letter directories are the details for individual platforms, i.e. a compiler and/or operating system; you can delete the ones you don't need. (Also, by the way, you can delete the makefiles for platforms you don't use from the individual library and applications directories.)
Within /app there are folders for specific applications and several general directories:
Macintosh users may not be familiar with command lines. Since the toolkit developed from a command-line interface, parameters called options can be passed to programs by typing them on the command line. On the Macintosh, a dialog box appears when a program is started, prompting for a command line.
If you install and compile CMT, you will find that compiled programs are
left in the same directory as the source (C) code. You may wish to copy
these to a single directory such as bin
. A set of compiled programs
is included with the release.
midifns.c
provides an interface to MIDI input and
output.
userio.c
provides system-independent functions to print text, read user type-in, test for input ready, and open files.
cmdline.c
provides a standard way to read and parse command lines.
cleanup.c
provides a way to register functions that
perform cleanup operations such as removing interrupt handlers, closing
windows and files, and freeing memory. An EXIT
function
automatically invokes the cleanup operations.
mem.c
provides fast constant-time allocation and
freeing of small blocks of memory.
timebase.c
provides a data structure, call_type
, that holds a function pointer, a set of parameters for the function, and a time at which to call the function. A timebase_type
is a structure that holds a sorted queue of call_type
's and maintains a mapping from real time to virtual time, which can run faster or slower than real time.
moxc.c
implements cause
, which schedules a function to be called in the future. Moxc manages a set of timebases and also parses MIDI input and ASCII (console) keyboard input, calling application-specific handlers when input arrives.
moxcmain.c
is a default main
program. It is intended to be linked with application-specific handlers to implement an interactive MIDI program.
seq.c
implements the seq_type
data structure, with operations for creating empty sequences, inserting events, playing sequences, and deallocating sequences.
seqread.c
is the Adagio score language parser.
seqmread.c
is the standard MIDI file reader, it translates the contents of a standard MIDI file into a seq_type
. It relies on midifile.c
to parse the MIDI file, and tempomap.c
to convert beat number and tempo information into absolute real time in milliseconds needed for seq_type
.
seqwrite.c
writes a sequence as an Adagio file.
seqmwrite.c
writes a sequence as a standard MIDI file.
seq_type
structure and Moxc. These include Adagio, Cornucopia, and Conduct, described at the beginning of this chapter and more fully in chapters of their own. There are also a few small demonstration and test programs in app/test
.