num_events was uninitialised in midi_read_track()