Previous: MIDI Import Examples, Up: MIDI Import Examples


9.1 Some Basic MIDI Examples

9.1.1 Tracks to Voices

MIDI files can be imported into FOMUS with a little help. For best results, open the MIDI file in a sequencer and examine at how the tracks are organized and how time values should be scaled. Then setup a .fms file to act as a “header file” for the MIDI file. The header file should contain a few global settings and parts with instruments that include import definition objects. The import objects should contain the necessary information for importing the midi data.

This first example uses a MIDI file taken from Alan U. Kennington's collection of WTC MIDI files at http://www.topology.org/midi/wtk/.

clip = (0 20)
midiin-timescale = 1/4

part <id kbd
      inst <template: piano
            imports: (<midiin-track: 1 midiin-setvoice: 1>
                      <midiin-track: 2 midiin-setvoice: 2>
                      <midiin-track: 3 midiin-setvoice: 3>)>>

mid001.png

Figure 9.1: Bach

An instrument is defined based on the build-in piano instrument with three import objects, one to match each of the three tracks in the MIDI file. Incoming MIDI from track 1 is sent to the part with voice 1. Track 2 data is set to voice 2, etc..