Here is a step by step guide to get a song to be included in a demo and compile it in freebasic.
First of all I want to thank Rbraz / Gvy because I am using one of his tools and some of his code here.
Also credit to Radix, I've used one of his tracks because it's small and good.
First of all download the attachment and unzip it to your desktop, you'll see that it contains
a folder called ufmod toolkit.
Inside the folder you will find;
Bin2Bas.exe
example no music.bas
ufmod.bi
ufmod.o
mustro.bas
music
The first thing I would like you to do is just to run example no music from Fbide.
You'll see a pretty 3D starfield, nothing else. Don't change anything in the listing for now.
First we'll convert the music.
The file Music in the folder used to be called "filename.xm" I just renamed it to "Music"
for your purposes, whatever XM file you use, just rename the file to "Music" this makes things easier.
We are now going to convert this with Bin2Bas so that it can be included as part of your exe.
go to the start menu on your computer
click on run
type cmd and then press enter
type cd desktop
then cd ufmod toolkit
now type Bin2Bas Music Music.bas
now type exit
In the folder ufmod toolkit you will see that another file has appeared called Music.bas
It's much bigger than the original but don't worry about that as it will shrink when compiled!
Now we need to go to wherever you have freebasic stored on your pc.
On my computer it is in;
C:\FreeBasic
So click on My computer
Then Local Disk (C:)
Then open the Freebasic folder.
We need to copy the following files from ufmod toolkit into the freebasic folder.
ufmod.bi
Music.bas
mustro.bas
ufmod.o
Now we are ready to make our 1 file exe with music :-)
Back to the start menu
run
cmd
cd\
cd freebasic
fbc -s gui ufmod.o mustro.bas
and that's it.
Your freebasic folder now contains a file called mustro.exe which if you pack it with UPX will shrink to about 30kb.
The file you compiled "mustro.bas" is identical to "example no music.bas" except that mustro has 6 comments removed.
If you can't figure out how to include ufmod after reading this tut you probably shouldn't be
coding, but if you need more help, ask.
[ edit ~ It packs down to 19.5 kb with upx -9 !!! ]