资 源 简 介
This is a library for working with MIDI in ActionScript 3.0.
Update
A new zip has been posted. A few things have been moved around and alpha-quality support for reading MIDI files has been added. MIDI connection stuff has been moved into the io.package and given a more appropriate name. ###
The examples below have not been tested.
Reading a MIDI file:
```
import com.newgonzo.midi.MIDIDecoder;
import com.newgonzo.midi.file.*;
// assuming you"ve loaded your MIDI file into a
// ByteArray via URLLoader, FileStream (AIR), etc.
var midiData:ByteArray;
var decoder:MIDIDecoder = new MIDIDecoder();
var file:MIDIFile = decoder.decodeFile(midiData);
// a MIDI file has an array of tracks that each contain an array of track events
var track:MIDITrack;
var event:MIDITrackEvent;
for each(track in file.tracks)
{
for each(event in track.events)
{
trace("event.time: " + event.ti