pouët.net

MOD-player library for GBA?

category: general [glöplog]
I've just started playing around a bit with the GBA, using devKitPro.

Getting some graphical stuff going was easy, but now I want to play some music. There is sample code for three different audio players included with devKitPro (BoyScout, Krawall and AAS). Krawall and AAS did not have the libs included, so I couldn't even build the example sources, and when I searched on the net, both those libraries seemed to be commercial. No go.

Boyscout wasn't a mod player, but instead something called 'bgf' files, which I am not familiar with, and when I compiled and ran the example app, it did produce some sounds, but to call it music would be stretching it...

Then I searched a bit on the net and found an old Hitmen modplayer called AMF I think it was. However the library didn't play nicely with devKitPro, some kind of lib-version mismatch, so it was impossible to compile it.

Now I am so frustrated that the only solution I can think of is posting on the pouet BBS to try to get help (yeah, then we are talking desperation!)

OK, now I've rambled on long enough. What I'm looking for is:

* A free library that plays mod-files (4 channel standard mod is sufficient)
* It should play nicely with devKitPro
* Free!
added on the 2008-05-27 00:10:23 by Sdw Sdw
pimpmobile?
added on the 2008-05-27 00:12:15 by raer raer
BB Image ?
added on the 2008-05-27 00:14:58 by trc_wm trc_wm
As rarefluid pointed out, theres pimpmobile, a mod/xm-player I wrote together with a friend a couple of years ago. It has served us (Shitfaced Clowns) fine for a couple of gba-demos.
added on the 2008-05-27 00:15:36 by kusma kusma
oh, and kb's SID-emu or minimal MOD player or what was it...
added on the 2008-05-27 00:16:10 by raer raer
Does that run on GBA? I seem to remember it being pretty damn accurate, emulating the filter, DAC and everything, with a heavy load of over-sampling or something. I can't imagine the GBA being up for that job, but I could be wrong :)
added on the 2008-05-27 00:20:38 by kusma kusma
If i remember correctly there was some way to strip it down...
added on the 2008-05-27 00:24:26 by raer raer
My player will be available SOON (really really soon). You can try out the utility used for conversion: http://ekid.nintendev.com/mutil1.zip
Use "mutil -b song.mod" to build a test rom.
added on the 2008-05-27 09:59:20 by eKid eKid
BoyScout uses the GBC channels, so it doesn't use sampled sounds like mods do (except for channel 3 which plays 4-bit(?) samples). It also had some annoying limitations iirc, like not having any good way to do arpeggios. But if you're good at it you can still create some decent music with it.. The music for http://pouet.net/prod.php?which=4520 was done with BoyScout iirc.
added on the 2008-05-27 10:11:59 by mic mic
Thanks all! I was a bit worried that the thread would turn 'pouet' right away when the first reply was 'pimpmobile?', but it turned out to be a serious response after all! :D

Unfortunately I was unable to build pimpmobile. I'm using devKitPro for Windows, standard install.

Code: $ make make -C example ../bin/example.bin make[1]: Entering directory `/home/andr/pimpmobile_r1/example' arm-eabi-g++ -I/c/owndev/devkitPro/devkitARM/include -I/c/owndev/devkitPro/libgba/include -I../include -DRELEASE -DNDEBUG -mthumb-interwork -mlong-calls -fconserve-space -fno-rtti -fno-exceptions -O3 -fomit-frame-pointer -mthumb -c example.cpp -o example.o -MMD -MP -MF example.d make[1]: arm-eabi-g++: Command not found make[1]: *** [example.o] Error 127 make[1]: Leaving directory `/home/andr/pimpmobile_r1/example' make: *** [bin/example.bin] Error 2


Dare I ask if there is a prebuilt lib (*.a file) that I can just drop into my lib folder?
Also, does the modules need some kind of pre-processing before they can be used? (the stuff in the 'convert'-folder)?

Oh, about that BoyScout player - anyone have any tunes in that format (bgf or whatever it was called) that I could try?
As I said before, I actually did manage to build that one, but either it doesn't work correctly, or the included demo tune was really, really, REALLY bad...

As for the "Do it yourself"-comment, yeah, I guess that it would be a good way to learn, but when it comes to playing music I have never really gotten into it, I'm all about the graphics. I prefer to keep the music-coding to something like:

InitModulePlayer(myModData);
PlayModule();

and then be done with it! :)
added on the 2008-05-27 13:08:02 by Sdw Sdw
Sdw: I would really recommend getting the latest version off the SVN, since it's upgraded to a more recent version of devkitPro. I could make a pre-built lib, but then I'd need to get home from work first ;)
added on the 2008-05-27 13:11:09 by kusma kusma
that's pimpmobile for you.

you sure the devkit thing is in your path? for me, arm-eabi-g++.exe simply is in the devkitARM/bin directory, but i don't know, maybe graga put it there. it's something installation-ish, for sure, though. hack around a bit with paths and the makefile and you should get it going.
added on the 2008-05-27 13:12:06 by skrebbel skrebbel
ah :)
added on the 2008-05-27 13:12:18 by skrebbel skrebbel
Ah, now I get it. Yeah, it's cause the Makefile is missing the path-setup for the toolchain. Unfortunately, It's NOT added in the trunk-version of the example-Makefile. I'll fix that ASAP.
added on the 2008-05-27 13:16:41 by kusma kusma
Quote:
Oh, about that BoyScout player - anyone have any tunes in that format (bgf or whatever it was called) that I could try?

Doesn't BoyScout come with example songs?
added on the 2008-05-27 13:50:24 by mic mic
Quote:
Doesn't BoyScout come with example songs?


Yeah, there were some examples, but they seem to be in some horrible strange bloated format though (bsf) . Several hundred kb seems like rather much for a chip-tune...
The example song included with devKitPro was 2kb or something, but it was a 'bgf' file I think.
added on the 2008-05-27 14:10:28 by Sdw Sdw
Btw. if kusma or skrebbel would be so kind as to post the makefile change necessary I could just edit the one I have here and try to build!
added on the 2008-05-27 14:58:25 by Sdw Sdw
no clue, never used pimpmobile. but are you sure arm-eabi-g++.exe is in your path? it's in the devkitARM/bin directory. i think.
added on the 2008-05-27 15:16:11 by skrebbel skrebbel
Sdw: add this line:
export PATH := $(DEVKITARM)/bin:$(PATH)
after these lines:
DEVKITARM = $(DEVKITPRO)/devkitARM
LIBGBA = $(DEVKITPRO)/libgba

added on the 2008-05-27 15:22:33 by kusma kusma
Thanks! Now it built fine, with the exception of the 'convert' app, which is probably not so strange since I guess my devKitPro is for cross-compiling only, while the convert is supposed to be built to a host-system utility.

If I understand pimpmobile correctly, it can't use .mod data directly, instead they should be converted to pattern-data and sample-data with your convert utility?

I made a little test GBA app that is something like this:

Code: char moddata[]={ /* Loads of binary2hex converted data here */ }; char sampledata[]={ /* Loads of binary2hex converted data here */ }; void VblankInterrupt() { frame += 1; pimp_vblank(); pimp_frame(); } int main() { pimp_init(moddata,sampledata); irqInit(); irqSet(IRQ_VBLANK,VblankInterrupt); irqEnable(IRQ_VBLANK); while(1) { VBlankIntrWait(); } return 0; }


This should be all that is needed to play a mod, right? It compiles fine using the mobilepimp-lib I built.
However to be able to test it, I need the output from that mod-converter. I tried compiling it with VC++, but no dice.
You wouldn't happen to have a prebuilt win32 exe? Or if not that, some ready-converted mod data binaries?
added on the 2008-05-27 16:21:36 by Sdw Sdw
Here's the R1 version of the converter, built with mingw32.
added on the 2008-05-27 16:32:18 by kusma kusma
...and here's the trunk version. Use the one that matches the pimpmobile-version you're using.
added on the 2008-05-27 16:36:17 by kusma kusma
Quote:
Yeah, there were some examples, but they seem to be in some horrible strange bloated format though (bsf) . Several hundred kb seems like rather much for a chip-tune...
The example song included with devKitPro was 2kb or something, but it was a 'bgf' file I think.

bsf is the editable file. The smaller file is generated by exporting it from your bsf in BoyScout.
added on the 2008-05-27 16:45:01 by mic mic
Thank you very much for your help kusma! It works like a charm, finally I get sound to my little intro.

Now I need to read up a bit on how the GBA memory system works and how you control what ends up where when you compile with devkitpro.
I got compiler errors with a 40kb mod (something with iwram and data and blabla) but it worked with a 5kb mod, so I guess by default everything ends up in that precious 32kb In-chip Work RAM.
added on the 2008-05-27 16:59:29 by Sdw Sdw
be sure to put your module data in ROM. You can add the keyword "const" to your data-definitions to ensure this.
added on the 2008-05-27 17:10:24 by kusma kusma

login