I need a class which could read number of track (channels) in MIDI file + length in seconds. I use class I got from phpclasses and it works fine in 90% of cases but in 10% it fails to return correct lenght. Probably it does the same for channels. Does anyone have anything better?