fixed midi-thru code; code cleanup