Computer Music: Musc 216
Isadora Tutorials: Play MIDI Files

In this tutorial you will learn how to program controls for playing MIDI files.


There are no new MIDI COMMANDS associated with this tutorial. However, you will be using Standard MIDI Files. Please check out the following links which describe this special FILE TYPE:

What is a MIDI file? (from Borg's MIDI site)

Technical specs of the SMF (Standard Midi File) - this section is for the technically minded programmer who might be interested in exploring in detail the file structure of Standard MIDI Files. One practical use for this information is to PARSE a MIDI file to extract useful data such as individual notes.

SMF Structure

SMF Specification

SMF Outline

STEP 2: Outline of the procedure for playing MIDI files with Isadora

In order to play MIDI files with Isadora you will have to:

1. Add a new scene called "PlayMIDI"

2. Add ACTORS to the new PlayMIDI scene for playing MIDI files.

2. Build (add) new controls to the Controls Window:

- Popup menu for choosing individual MIDI files (songs)
- PLAY button
- STOP button
- TEMPO slider
- VOLUME slider

3. Find some MIDI files on the Internet (or use those provided by the Instructor)

4. Import the MIDI files into Isadora's MEDIA WINDOW.

STEP 3: Open your current Project2Controller and ADD a new scene called, "PlayMIDI"

Consult earlier tutorials if you forgot how to add a new scene.

STEP 3: Add the Actors to the new PlayMIDI Scene

You will have to add only ONE actor to your new PlayMIDI scene, the Midi Player Actor. See the Audio Group (group #2):

Change the Control numbers of the various parameter fields to those shown above. These Control numbers will match the Control ID's of the new controls you will add to the Controls Window. Click the cursor on the parameter LABEL to change the Control number. Enter a value of ZERO (0) if you want to DELETE a Control number.

The "vel. mod." field is "velocity modulation." The VOLUME SLIDER you create on the Controls Window will affect the overall volume of the MIDI file by changing (modulating) the individual KEY VELOCITIES for every note that is played. Otherwise, you would have to build a slider that would affect each MIDI Channel separately. The only drawback to this approach is that once a note has sounded and you move the Volume Slider it will not affect the volume until the note receives a NOTE OFF command and then is sounded the next time.

STEP 4: Add these new Controls to the Controls Window

The Control labeled, "Song 1" is a Popup Menu control.

The "Play" and "Stop" controls are MOMENTARY SWITCH buttons.

The "Tempo" and "Volume" controls are Sliders.

Add COMMENT controls as shown.

STEP 5: Set the Parameter Values for your new Controls

See the graphic in STEP 4 for the Control ID numbers for the new controls.

For the song select ("Song 1") popup menu control, add as many new song labels as you want. You will have to enter each new label by typing it completely. Isadora Control fields do not have the standard COPY/PASTE function implemented.

The PLAY and STOP buttons are both MOMENTARY SWITCHES. Select the mode, "Don't Send Off" checkbox for each button.

The Tempo Slider MINIMUM and MAXIMUM values are: Minimum = 10; Maximum = 200.

The Volume Slider MINIMUM and MAXIMUM values are: Minimum = 0; Maximum = 100.

The Display Format for both sliders should be INTEGER values (no decimals).

STEP 7: Add an additional ACTOR to the MAIN Scene which will activate the PlayMIDI scene.

Add this actor to the MAIN scene to activate the PlayMIDI scene.

STEP 8: Find some MIDI Files

You will need to find some MIDI files (or use the ones the Instructor has provided) and download them to your Isadora Project folder. Please create a new folder called "Media" and save all your MIDI files in this folder. Once you link a MIDI file to Isadora's Media Window and you save your Isadora document, you should not move the MIDI file or change it's name. If you should move the file once it is LINKED in Isadora MEDIA Window, then nothing will happen when you click the PLAY button and you will have to go back to the MEDIA window and re-link the file.

To open Isadora's Media Window, select "Show Media" from the Windows pulldown menu:


Right-click your mouse (or Control-click) on the MIDI Files label to import a MIDI file:

Select "Import Media" to choose a MIDI file you have already downloaded into your Media Folder.

After you import some MIDI files your Media Window may look something like this:

Isadora's Media Window after three MIDI files have been imported. Note the ".mid" file extension.

STEP 9: Try it out!

1. Go to the CONTROLS WINDOW (see previous tutorials)

2. Click on the MAIN SCENE to activate your PlayMIDI scene.

3. Select a song with the popup menu.

4. Click the PLAY BUTTON.

5. Adjust the tempo by dragging the TEMPO SLIDER.

6. Try changing the volume by dragging the VOLUME SLIDER.

7. Choose another song and try all your controls again.

STEP 10: Troubleshooting (debugging)

1. Did you get the Control Numbers set correctly? The Control Numbers you set in the parameter fields of the Buttons and Sliders MUST MATCH the numbers you added to the Ctl Value of their equivalent AC TORS.

2. Yo may have to click on the Main Scene to activate the new changes.

3. If your PlayMIDI Scene still doesn't work, ask for assistance from the Professor.

STEP 8: Save your work

When you complete this tutorial:

Save your Isadora file. You will want to keep the OLD Project2Controller file you created in the last tutorial. So you can either RENAME that file as something like Project2Controller.OLD, or you can name this new file something like Project2Controller.CURRENT. Which ever you decide to do, you should always keep the copies of your older tutorial files in case you "mess up" and have to start over again.

2. Save another copy of this file and call it Homework15.YourLastName. See the Class Schedule for specific details about submitting this Homework assignment.

Further Information

Standard MIDI Files (SMF) contain all the information in the form of actual MIDI commands to play the music contained in the file correctly, especially program change, channel volume, pan, etc. Consequently, it will usually do no good to set the Channel Controls before you play the file because they will immediately change to the values imbedded in the file once it starts playing. You can, however, change these values once the files are playing. If you would like to permanently change the program numbers, channel volume and pan settings, you will have to import the MIDI file into a MIDI file editor, make the changes there, save the file and then re-import it into Isadora's MEDIA WINDOW. There are currently no MIDI file editors available in the LAB.

A Standard MIDI File will also contain TEMPO information in it's CONDUCTOR TRACK. However, Isadora ignores this information when you import the file because the Midi Player Actor has its own tempo control. Consequently, when you play the Midi file in Isadora, the tempo you hear will probably be the WRONG TEMPO (too fast or too slow) and you will have to adjust the tempo using the Tempo Slider you created. It is possible to add extra actors to the PlayMIDI scene which will automatically set the correct tempo given which song you select in the Song Popup Menu you created. Experiment with this using the Calculator Actor and the Value Select Actor. See the example below:

With this configuration, when you select a song the CALCULATOR Actor sends the value of your selection to the VALUE SELECT Actor which then selects the tempo according to the POSITION of the value it received. For example, if you select Song #1, then VALUE 1 is selected (which contains the tempo of 40) and this value is then sent over to the MIDI Player and becomes the current tempo. When you first setup the VALUE SELECT Actor, you will have to figure out the exact Tempos of your songs and enter these values manually into the VALUE SELECT Actor.

Back to Isadora Tutorials Menu

Main Page