This site's content was compiled from 1993 to 2006. Beyond that, Google is your friend.

MIDI-Eiffel

Maintainer

Mike Durian

Description

Midi-eiffel is an Eiffel library designed to facilitate writing MIDI applications.

Several sample applications are included:

The RED_BLACK_TREE data structure classes from this package have been extracted into a separate package with additional documentation and examples.

Categories

Versions

Links

Details

From a top down perspective, you have a SONG which is the basic unit of a parsed MIDI file. Each SONG has some general parameters like the division (number of MIDI ticks per beat) as well as a list of TRACKs. Each TRACK is a sequence of MIDI EVENTS. The TRACK stores the EVENTS as a RED_BLACK_TREE.

EVENTS come in a few different flavors: CHANNEL_EVENT, META_EVENT and SYSTEM_EXCLUSIVE_EVENT. CHANNEL_EVENTs are active events - they do things like turn notes on and off or change the channel voicing. META_EVENTs contain annotation information like the time signature or key. SYSTEM_EXCLUSIVE_EVENTs are a wrapper around device specific commands. CHANNEL_EVENT and META_EVENT have sub-types that are more specific. They should be pretty straight-forward if you're familiar with MIDI events. The only new abstraction I've added is the idea of tied NOTE_ON_EVENT/NOTE_OFF_EVENT. Since it is often easier to think of a note with a duration rather than two distinct events (NOTE_ON_EVENT and later NOTE_OFF_EVENT), they can be linked together.

All EVENTS can be printed via the print_event feature. EVENTS also have a match feature. This feature is used to compare one event to another. EVENTs are allowed to be partially specified, leaving the unspecified values as wildcards (e.g. a NOTE_ON_EVENT specifying on the channel with wildcard pitch and velocity values).

TRACKs have a number of features designed to help manipulate ranges of events. A TRACK is a cursor list meaning that is knows the current position and that it can be traversed using the back and forth features. Ranges of events can be selected using the mark_in and mark_out features. Mark_in is inclusive while mark_out is not inclusive. Once marks have been set, ranges of events can be deleted or copied using the remove_range and copy_range features.

Specific times in a track can be reached using the goto feature. Events can be added to a track with the add feature and the current event can be removed using the remove feature. You can find events from the current cursor position forward until the end of the track using search. Search uses the event's match feature so wildcard events can be used to filter events. The find feature is similar to search except it only searches the specified time.

SONGs can have many tracks. Tracks can be added and removed by changing the number of tracks. When new tracks are added to a SONG, they are created as empty tracks. You can also replace an existing TRACK using the set_track feature. Besides the array of TRACKs, a SONG also contains a division setting (number of ticks per beat) and a format value. The format value is one of Format_single (type 0), Format_multi (type 1) or Format_independent (type 2).

SONGs can also be read or written as Standard MIDI Files using the SMF_READ or SMF_WRITE classes.

That is the basic layout. For sequencing purposes, the useful features will be the remove_range and copy_range features of the TRACK class. Take a look at the minfo, mcollapse and mexpand applications in the src directory of examples on how to use some basic features.

Supported compilers

Platforms

Licensing

Packages using MIDI-Eiffel

Google
 
Web eiffelzone.com