FYI you can download Malinowski's software for free and visualize midi files at your own desk. it'll save you a lot of coding.
http://www.musanim.com/player/