libxmp is a library that renders module files to PCM data. xmp is a module player for Unix-like systems, based on libxmp, that plays over 90 mainstream and obscure module formats from Amiga, Atari, Acorn, Apple IIgs and PC, including Protracker (MOD), Scream Tracker 3 (S3M), Fast Tracker II (XM) and Impulse Tracker (IT) files.
It allows you to use JFugue-2.1 API to program music on MIDP 2.0, CLDC 1.1 compatible mobile devices.
It's easy to use, like this code to play C-major scale:
Player player = new Player();
player.play("C D E F G A B");
It's all based on JFugue-2.1 sources, so go to http://www.jfugue.org for more information.