There are many software options for composing music; one of the free options I use currently is
Linux MultiMedia Studio(LMMS).
I'll run you through how to use it, should you decide it's what you'd like to do.
First, you need to find a soundfont that contains the "piano" instrument you want to use. There are a lot of soundfonts available you can find through google, but be sure to check that the soundfont's license is something like creative commons or the MIT license. Just something free to use, really.
[IMG]http://i.imgur.com/PHSTPmp.png[/IMG]
When you open LMMS, you need to add your instruments. You can do that with this panel on the left.
[IMG]http://i.imgur.com/zWW14I9.png[/IMG]
The instrument type you want is this one, the soundfont player. Drag it to the Song-Editor window.
[IMG]http://i.imgur.com/0vKAShT.png[/IMG]
Next, click on this bar so you can assign it to the soundfont you downloaded.
[IMG]http://i.imgur.com/fksSQkk.png[/IMG]
Use the first button to open the soundfont, and the second to select the piano instrument if it didn't show up by default.
[IMG]http://i.imgur.com/JI3gssX.png[/IMG]
Double click on the first bar here and you can start composing.
[IMG]http://i.imgur.com/EH5b4j2.png[/IMG]
Use the pencil tool to add notes and make some nice music!
LMMS is pattern-based, so if you have a part you want to repeat, double-click the bar again to make a new pattern, compose it, and ctrl-drag where you want the pattern to repeat on the Song-Editor!
When your music is done, save the project itself, but you'll need to export it too to use it in X Maker!
That command is under the Project menu.
[IMG]http://i.imgur.com/5CRibfS.png[/IMG]
Select where you want to save it and decide whether you want to export as WAV or OGG. OGG generally is better for the size:quality ratio you want for a game resource. Don't worry about the other options, the defaults are fine until you know more about sound design.