MIDI import: optimization for speed

The result of optimization:
MIDI file with more than 900 bars and 8000 chords
https://drive.google.com/file/d/0B5alKuFoSol2NW1Sek9xU1JNcjg/edit?usp=sharing
imported in 3 secs on my computer in Release mode.