UF's adventures in BMS by unknownfile at 11:17 AM EST on December 15, 2006
This thread created by popular request.
BMS (aka JaiSeq) is a sequence format from Gamecube games. As you are all aware, I have been doing analysis on the format for a while.
Known types of JaiSeq archives: - SeqBank (.arc files) (Super Mario Sunshine, Luigi's Mansion) - RARC (.arc files) (Zelda WW, Twilight Princess)
For games that use JaiSeq, take a look at the GC stream database, JaiSeq-powered games are usually identified as having "AW" files.
The purpose of this thread is to analyze the formats used by JaiSeq, including AW (samples), AAC (init files), BMS (sequences), and integrate support in in_cube.
More stuff coming soon.
by PokeParadox at 12:29 PM EST on December 15, 2006
All I can say is: Good luck :)
by unknownfile at 3:38 PM EST on December 15, 2006
And voila, I have written an extractor (with help from hcs) that extracts BMSes from seqbanks. The header is similar to the following (C code):
Regarding the sequences themselves, I am currently doing analysis on the sequence format. Once again, I urge all of you to annoy hcs to decode the .AW sample blocks so that I can figure out how to play this shiz.
You can find the BMS sequences at http://unknown.hcs64.com/JaiSeq
And yes, I am aware the extractor is somewhat broken.
I know that BMS files aren't playable, as they're not understood at all yet. However, because they're sequenced based, I'd recommend that you look into MIDI files, IT files, MOD files, and things like that. That way, you can familiarize yourself with what sequenced formats look like. Hopefully, that'd make understanding BMS easier. Also, to ease the programming end of it, I'd suggest you look for an open source MIDI/IT/MOD/etc. player. That way, you can see how they did things, and modify it to fit your needs.
Of course, a complete re-write might be in order, to accommodate BMS files. Even so, I'd think having something to learn from would help out a lot.
Anyway, good luck on this. I always look forward to whatever progress you may have had. Mouser X over and out.
I wish you good luck. A few years ago i already tried to decipher them but i suck at reverse engineering(not enough patience) so i gave up pretty early only knowing the files start with a 4 byte signature. I think there is probably more similarities with the way the nintendo ds plays sequenced data.
Edit: I just checked the bms of Donkey Kong Jungle Beat(yes i wanted the music from that game) and what i noticed is F0 and FF are very common and often with 2 bytes in between so i guess these are the note on and note off events. I could be completely wrong though. Also the the 5th byte the bigger it is the more i see E0 in the file followed by 00 and another byte(and then E0 again). Sounds like empty channels.
edited 4:14 PM EST December 16, 2006
by unknownfile at 4:42 PM EST on December 16, 2006
There is always the possibility of volume controls. Anyways, my extractor is still being written, so I can't really post it yet.
Stuff to implement:
- RARC support - Yaz0/Yay0 support
Stuff to fix:
- fake RARC suport
by unknownfile at 9:57 PM EST on December 19, 2006
While looking through the Pikmin ISO, I came across a DLL, assembled in x86. This appears to have a lot of the game code inside of it.
They didn't leave the source code for JaiSeqs in Pikmin, did they?
The obvious by unknownfile at 10:36 AM EST on December 25, 2006
no
Bad news by unknownfile at 11:51 PM EST on January 2, 2007
The jaudio library is used only in games that Nintendo EAD has had involvement in, with the possible exception being Pac-Man Vs., which was developed elsewhere in the Nintendo labs.
As we don't know who compiled the US build of Pikmin, we cannot determine who has the library, and even asking them about it would result in no response.
We can, however, wait for a Gamecube emulator with sound and debugging features that works so that we can analyze the format from there. Who knows, we even might be able to make 3sf rips...
I've seen in the DSP distribution thread that you're working on a BMS ripper for ARC files. So you just want to extract files from ARC archives? thakis programmed some tools for GC files a whole while ago, among them an ARC archive dumper. If your ripper has a different purpose I apologise for the useless information. :-)
Found this crap in Mario Kart Double Dash. This was compiled by Yoji Inagaki, who was one of the sound programmers for many games using the library. The syntax seems to derrive from C.
code by unknownfile at 12:46 AM EST on January 27, 2007
I have some code that rather crappily decodes the samplebanks.
Decoding is done thus:
outbin=*(long*)inbin - 128; idx = (outbin)&0xf; outbin=((outbin-16)+afccoef[idx][1]); outbin=(outbin << 8)^0x8000; // convert to 16-bit signed pcm
Samples should be decoded at 18000 Hz
This uses some code from the AFC decoder, and I must admit that it works quite nicely, though not accurately.
...
What, you're still here? Fine, take these wavs and leave me alone! Wavs from Super Mario Sunshine and Luigi's Mansion This is on megaupload as the ftp uploads here are slow and I am collapsing from drowsiness atm, so get it while its hot.
by unknownfile at 12:36 PM EST on January 27, 2007
Tweaked the code a bit, it is now easier to hear samples. The playback rate is a bit slow, but whatever.
Decoding is now done thus:
for (int i=0;i<2;i++) { outbin=*(long*)inbin + 128; idx = (outbin)&0xf; delta = 1<<(((outbin)>>4)&0xf); // currently unused. outbin=outbin^afccoef[idx][i]; outbin=(outbin << 8)^0x8000; // output the audio here... }
and the samplerate is 36000 Hz.
The way decoding is done is pretty much the same as before, but at least it's easier to hear now.
I'm also doing analysis on the BMS format as well. Setting up the instruments seems to be done thus
I'm really glad this is taking some real progress. Keep it up!
great news by unknownfile at 11:31 AM EST on February 2, 2007
The BUILD.MAP file in the Pikmin ISO is actually an outline of how the DOL was assembled (probably in chronological order). The jaudio library is implemented within a HUGE thread which could be used for gameplay, but I am unsure of this.
For now, I need to go downstairs and brave the idiots in the cafeteria lineups.
I hope to have more functions supported later. For now, I'm going to play Mario Sunshine.
by unknownfile at 11:34 AM EST on February 5, 2007
hcs sent me the ZeldaWW code last night, and it seems that jaudio went under a major overhaul.
The second version of the library is written in C++ as opposed to C, so there are likely to be major differences. Super Mario Sunshine might use some of the same functions, but I'm not sure.
I am still working on the .sig files for Dolphin OS Revision 37 (Luigi's Mansion, Pikmin), and I'll do OS Revision 54 (ZeldaWW, Mario Sunshine) when I get around to it. There are very very few functions supported, so you'll need to wait a bit.
As for killing threads, it can probably be achieved in this manner
infiniteloop: b infiniteloop nop
hcs, here's a hint at what jaudio does:
1) Sequence notes are played back on the CPU. 2) A mixer compiles the notes into AFC. 3) The AFC stream is passed to the DSP. 4) The DSP decodes the data. 5) Rinse and repeat.
Perhaps by looking for the decoding function that you could capture the ADPCM and pass it to the output?
Thank's for the info on jaudio. Now I understand why the BMS-format is hard to comprehend. Anyway I can tell Donkey Kong Jungle Beat is Revision 5(it has BMS files inside ARC files and AFC codecs inside AST containers).
Anyway what are the CIT files inside the JaiChord.arc files then? Chords Info Table or something?
no progress for a while... i guess i lost interest or can't be arsed with it.
That Stuff by wolup at 9:30 AM EDT on August 10, 2007
Hey Man,
Just wanna know if you could upload the luigis mansion and super mario sunshine .aw files, and the program you used to convert them to wav, and anything else that might help me get the .aw files onto a cd. Video game music CD's are my life!
Hey! When I said sorry it was 6th on page 1! I severly doubt that this is hell... Though it might be a Taco Shop...
back to work by unknownfile at 1:26 PM EST on February 11, 2008
I am investigating this stuff again for developing a multi-game HLE emulator. However, the Gamecube debugger that I use (gcnrd) sucks enough to randomly crash games, or not even break propertly on old games (Luigi's Mansion won't allow breakpoints).
BARC files figured out by unknownfile at 9:44 PM EST on February 13, 2008
The three early jaudio games have quite nasty ways of setting their ARC files up, in particular the headers are hidden somewhere else:
- Luigi's Mansion has the BARC header in JaiInit.aaf - Pikmin has the BARC header in the DOL executable - Super Mario Sunshine has the BARC header in msound.aaf, hidden away inside nintendo.szs
The format is rather simple, however, and all the sequences have been extracted.
(see next post for sequence filenames)
edited 9:54 PM EST February 13, 2008
im too lazy to edit by unknownfile at 9:53 PM EST on February 13, 2008
Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp.
>barcdump jaiinit.aaf BARC---- Output LuigiSe.bms OK Output Mario02.com OK Output PianistQuiz01 OK Output PianistQuiz02 OK Output PianistQuiz03 OK Output Mario.com OK Output OyamaLab.com OK Output LuigiSings.co OK Output Training.com OK Output Mario.com OK Output Demo_FirstMon OK Output Demo_FirstDoc OK Output OyamaLab.com OK Output Training.com OK Output GetKey.com OK Output Gallery.com OK Output OyamaPress.co OK Output Total.com OK Output GoodNight.com OK Output Fishing_Zako. OK Output Fishing_Event OK Output PictureSays.c OK Output Telescope.com OK Output DanceHall.com OK Output Demo_BabyCrie OK Output Demo_Entrance OK Output Demo_FirstDoc OK Output Demo_FirstMon OK Output DoorLoop.com OK Output Kinopio.com OK Output Kinopio_Light OK Output Room_Baby.com OK Output Room_Space.co OK Output Tittle.com OK Output Total_Picture OK Output Total_Score.c OK Output Warp.com OK Output Training_Cont OK Output Training_Resu OK Output Training_Stop OK Output select.com OK Output Babyroom.com OK Output BabyDemo.com OK Output BabyBattle.co OK Output BlueOhaka.com OK Output BlueDemo.com OK Output BlueBattle.co OK Output TelesaDemo01. OK Output TelesaDemo02. OK Output TelesaBattle. OK Output BattleClear.c OK Output PianistBattle OK Output Room_AfterBos OK Output GetKey_Heart. OK Output OyamaPress_Pr OK Output Ending01.com OK Output Ending02.com OK Output Ending03.com OK Output Event_Speak.c OK Output Event_Game.co OK Output Event_Speak.c OK Output GetKey.com OK Output OyamaCall.com OK Output OyamaSpeak.co OK Output Change_Kabe.c OK Output Change_Water. OK Output Change_Mayoi. OK Output StuffRoll.com OK Output Demo_GetPictu OK Output Demo_Lion1_1. OK Output Demo_Lion1_2. OK Output Demo_Lion2.co OK Output Demo_Sakasa.c OK Output Demo_TeleChec OK Output Demo_TeleOpen OK Output Telesa.com OK Output TelesaSpeak.c OK Output TelesaSpeak2. OK Output Light.com OK Output Light.com OK Output KuppaDemo01.c OK Output KuppaDemo02.c OK Output KuppaBattle.c OK Output KuppaDemo03.c OK Output Ochi01.com OK Output Ochi02.com OK Output Ochi03.com OK Output HeyHoo.com OK Output Demo_Star.com OK Can't open - for writing. Probably hit the end of the file
>barcdump pikmin.dol BARC---- Output pikise.jam OK Output sysevent.jam OK Output dummy OK Output dummy OK Output tutorial.jam OK Output play3.jam OK Output d_end2.jam OK Output jungle.jam OK Output dummy OK Output yaku.jam OK Output cave.jam OK Output boss2.jam OK Output map.jam OK Output demobgm.jam OK Output dummy OK Output dummy OK Output boss3.jam OK Output flow.jam OK Output select.jam OK Output char.jam OK Output cresult.jam OK Output fresult.jam OK Can't open - for writing. Probably hit the end of the file
>barcdump msound.aaf BARC---- Output se.scom OK Output k_dolpic.com OK Output k_bianco.com OK Output k_manma.com OK Output t_pinnapaco_s OK Output t_pinnapaco.c OK Output t_mare_sea.co OK Output t_montevillag OK Output t_shilena.com OK Output k_rico.com OK Output k_clear.com OK Output t_chuboss.com OK Output k_miss.com OK Output t_boss.com OK Output t_select.com OK Output t_bosspakkun_ OK Output k_title.com OK Output t_chuboss2.co OK Output k_ex.com OK Output t_delfino.com OK Output t_marevillage OK Output t_corona.com OK Output k_kagemario.c OK Output k_camera.com OK Output t_montevillag OK Output t_mechakuppa_ OK Output k_airport.com OK Output k_chika.com OK Output k_titleback.c OK Output t_montevillag OK Output t_delfino_kaj OK Output t_event.com OK Output t_timelimit.c OK Output t_extra_skyan OK Output t_montevillag OK Output t_pinnapaco_m OK Output k_select.com OK Output t_casino_fanf OK Output t_race_fanfar OK Output k_camerakage. OK Output k_gameover.co OK Output t_boss_hanach OK Output t_boss_geso_i OK Output t_chuboss_man OK Output t_montevillag OK Output t_shine_appea OK Output k_kuppa.com OK Output t_monteman_ra OK Can't open - for writing. Probably hit the end of the file
Looks like you are figuring it out. I assume that some sort of GC sequence player will be needed to play the files?
by unknownfile at 5:19 PM EST on February 14, 2008
I have to run the stuff on the actual system before coming to any conclusions, really.
The good news is that the audio library just seems to use sequence IDs as opposed to file names so easy memory pokes can be done to make an easy gamerip.
possible patch for Pikmin by unknownfile at 7:53 PM EST on February 14, 2008
0x80018CC4 = nop 0x80018CC8 = nop
This skips a check and writes sound code 2. I can't test it yet, though, because every GCM streaming program I've tried won't work and I'm not willing to waste DVDs.
So much good news lately. I didn't even know someone was still trying to figure it out. Maybe we can finally get a full pikmin, luigi's mansion and super mario sunshine rip with all the songs and no sound effects like the line over rips on galbadia hotel.
I hope donkey kong jungle beat follows too.
by Only3Penguins at 8:41 AM EST on February 15, 2008
Put me down for Star Fox Adventures when this sequenced stuff finally becomes available. There's no complete quality rip of that one anywhere.
Some stuff from the Pikmin 2 ISO by unknownfile at 1:07 PM EST on February 18, 2008
so does this mean luigi's mansion and mario sunshine will soon be available with no sound effects? Granted someone can make a sequence player.
by nensondubois at 2:03 PM EST on February 18, 2008
If someone makes a sequence player than I can play those Playstation demo menus as long as it supports .seq files which I assume it does or it'll be like having a car with no gas tank.
Mario galaxy also has some sequenced tracks but i'm not sure if they'd be the same format. (a few tracks were not in the disc extraction or the official soundtrack)
by unknownfile at 3:27 PM EST on February 18, 2008
They'll be available once I can get stuff built and working
In relation to Only3Penguins' post, I've actually attempted a complete rip of Star Fox Adventures before... all the BGMs are actually available in the sound test (however they fade in at the beginning) but what has always been the problem is the cutscene BGMs which are often overlaid with sound effects and/or voices. I've wondered recently if there's a way to separate them (a la Twilight Princess) or if they're mixed down already. Until I take a look at the files on the disc, though, I'm just speculating...
by Only3Penguins at 6:31 PM EST on February 18, 2008
I know about the sound test. The fact that it fades is the reason I'd prefer them directly from the game. That and the fact that the sound test doesn't actually tell you what you're listening to. Hopefully the files are named in such a way to give some indication of what each one actually is.
Failing that, I have a list that I made a couple years ago. (Since they're in pretty random order on the sound test I don't hold much hope for an orderly nomenclature on the disc.)
I've never even played Star Fox Adventures, but Star Fox Assault certainly mixed the sound effects directly into the DSPs that played during the cut scenes.
oh well, most of the cutscene music from sunshine can be put into mono and most of the voices are drowned out. It doesn't work with luigi's mansion though.
Heres one of the tracks from mario sunshine put in mono and inverted: http://www.mediafire.com/?7x0ttjgwjun
The voices are almost completely drowned out, it sounds a bit static at times with the voices but it's the best possible.
libjaudio by unknownfile at 10:26 AM EST on February 20, 2008
Another shitty attempt at a library in the works from yours truly. I have yet to figure out all the file formats, but I will start with what hcs did.
Also, as was posted elsewhere, Link's Crossbow Training seems to be using a Wii variant of the same library. I'll check it out once I can find an ISO of it.
I'm also going to need to make signatures for IDA Pro so I can get stuff analyzed without needing to keep comparing crap. (I did at one point, but I lost them)
I'm just wondering if the Yoshi drum beats in mario sunshine will be kept as seperate files? If so we would have them isolated from the main music. I think that's the only sort of variation that mario sunshine's music had.
yes it doesn't appear to work for the luigi's mansion cutscenes. Sorry was just trying to be helpful and provide the music with as little sound effects as possible.
We all know that UF isn't going to finish work on this. Instead, why not concentrate on Dolphin? Zelda Wind Waker actually has working sound (or so I've been told), and that game is definitely sequenced. This means that Dolphin has progressed enough that the audio hardware is getting close to being emulated. This means that we don't need to know the format to be able to play the music (though, to create rips for it, you'd need to know how to cut up the NGC executable to remove all of the non-audio related functions). And, having seen what UF has done (or ignored) in the past, I have no doubt that Dolphin will get their emulator working before UF figures out BMS stuff.
I suppose the other possibility is that someone else (not UF) decides to fiddle with this stuff, and figures it out. That might happen before a NGC xSF player is created, but I certainly wouldn't put my hopes on that. Mouser X over and out.
As MouserX said, it's true! They are finally getting the music sequences working. I just checked out the videos on YouTube and they pretty much prove it. If this progresses even more, we might finally have a xSF format for both GC and Wii. How about naming them GCSF and WSF respectively?
My understanding is that GC xSF is already named. Similarly to DS xSF files being called "2SF" because of the dual screens, Gamecube is "3SF" because....you know, cube, third power...hardy har har. WSF could work though.
Why are we calling GC seqs 3SF? Why 3? What does 3 have to do with it? I understand 2SF for the dualscreen thing but, 3? CSF makes more sense than this "3SF"....
A cube has 3 dimensions, "cubed" is written with a 3. It also goes along nicely with 2SF. Anyway, I'm glad there are so many people interested in deciding on the name. Anyone interested in actually making the format?
Hey, I'll give all the help I can offer. Of course you'd probably waste more time teaching me how to figure this out than working among yourselves. Last time I coded was in Assembly.
I guess it would be beneficial if I started kicking around the iRC more often. Where is it again?
indeed. there's complete soundtracks available for most these games, official or otherwise. that's more than can be said for the snafu of playstation and nintendo 64 games without soundtrack rips of any kind ... the costs outweigh the benefits here.
reminds me though. i gotta redownload full soundtracks for SMS and Wind Waker...
I think a few tracks from Mario Galaxy are sequenced as the complete ost is missing a few, such as the drum beat when you have a shell in beachbowl galaxy underwater and a variation of the bowser battle theme.