Microsoft KB Archive/173718
HOWTO: Use a Midi File as a Midi Input
PSS ID Number: Q173718 Article last modified on 09-12-1997
The information in this article applies to:
- == Softimage 3D for IRIX, version 3.7 ==
This article offers instructions for setting up a midi channel driver that will be used with a midi file. The midi driver can be configured with a multitude of input devices, drum, keyboard, guitar, slider box. Additionally, you can also use a simple midi file as a virtual input device. In this case, the midi file is a sound file that also contains a midi stream so that every interval from a song is mapped to a midi note ranging from 0-127. These notes, 128 in total, are all possible connections that you can use to drive an fcurve.
On an NT machine, it is not possible to have a virtual internal midi device, since the driver can not listen into the midi stream being played as if it were an external device (as on IRIX).
Verifying if Other Midi Drivers Already Exist
Before beginning, enter the following command to verify if you have any other midi files already running on your system.
ps -ef |grep midi
If others already exist, a report similar to the following is returned. This example reports a midi file with one internal midi and one midi device connected to port2:
user_name 1717 1 0 10:29.27 ? 0:00 startmidi -d internal user_name 1790 1 0 7:02:30 ? 0:00 startmidi -d /dev/ttyd2
If others exist that you no longer require, you may kill these processes by using the command: killall midi or kill -v pid_number
If you wish to keep the pre-existing processes, you must start a new midi process and specify a name. Once this is done, you can define which midi process you wish the driver to listen to.
Configuring the Midi Channel Driver with a Midi File as the Input
To begin, start the internal midi process by entering the following command:
startmidi -d internal -n banana (or your specified name)
Now that your midi process is running, you can launch Soundplayer and load your midi file.
From the Motion module, choose Channel>Channel setup and in the dialog box, add the midi driver to the Active Type Driver list.
Double-click on the midi you added, and make the following changes:
Enable the driver’s Debug option.
Change the Midi Port option from Default to Specify and enter the name you specified for the midi (for the purpose of this example, “banana” was used). If this is the only midi running on the computer, leave the option on Default.
Activate any note from the list of Active MIDI Notes, you do this so that you can run the driver.
To connect an object to the driver, get any object and select it.
From the Motion module, choose Channel -> Connection setup, then connect the selected midi note to one fcurve of your object.
You must now run the driver and play the midi file at the same time.
Press Alt-F3 to bring up the shell where you launched SOFTIMAGE 3D and then position the Soundplayer on top of the SI3D interface. To position windows in the background that are not required, place your cursor on top of the window and press Alt-F3.
To start the driver, choose Channel->Chanel run ->Frame I/O, then press play on the Soundplayer.
When you start the Soundplayer, a report similar to the following appears in a shell. The contents of the midi stream appear; lines containing On or OFF indicate valid notes (74 and 70 in this example). Other numbers represent velocity and other midi attributes.
Controller 7 [ 79 ]  Message : 953657878322553: Control Change : channel 0: 7: 79
Controller 0 [ 0 ]  Message : 953657878771834: Control Change : channel 0: 0: 0
Controller 7 [ 79 ]  Message : 953657879259516: Control Change : channel 0: 7: 79
74(100) : ON  Message : 953658897337259: Note On : channel 0: D5: 100
74(54) : OFF  Message : 953659238343551: Note Off : channel 0: D5: 54
70(100) : ON  Message : 953659238421311: Note On : channel 0: A#4: 100
After analysing this file you now know which notes are available for connecting animation. You can assign available notes as the active connection for their driver, and connect them to fcurves.
- In Channel Setup, edit the midi channel driver again by double-clicking on the midi. Toggle on the notes that are valid, you may also toggle the velocity as active.
10.Now to connect the midi channel to your model fcurves, choose Channel -> Connection setup.
You can now run the driver and start the midi file as in steps 7 and 8. Watch the model’s animation driven by the midi file.
If you have any questions concerning the information contained in this article, contact firstname.lastname@example.org by e-mail.
Additional query words: si si3d si3dchnl si3dconst
Version : IRIX:3.7 Platform : IRIX Issue type : kbhowto ============================================================================= Copyright Microsoft Corporation 1997.