fixed midi data parsing and generally made things more sane