just got finished writing this script and it seems to work:
http://nickleusmusic.blogspot.no/2013/02/lets-say-youve-recorded-track-in-lmms.html

hope someone gets some use out of it :)

Nick

--
Check out my music and let me know if you like any of it:
https://soundcloud.com/nickleus