check this site at the bottom of the page..
http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/heja/sy-computing.html

there is some source code that may do this type of thing but it looks like the resulting midi files are to be used for the tg77. I don't know what to do with the source code so I can't help on using it. If you figure it out let me know.