Previous Page | Next Page

by Jasper at 11:14 AM EST on February 7, 2017
Yeah, this matches my own experience decompiling BMS:

I originally wrote this for Super Mario Galaxy 2 for , which has a slightly different format which I called "MML2".

which was combined from BMS_DEC, JAudioPlayer, arookas's MIDItoBMS, Sage-of-Mirror's BMSTool, and my own analysis as well :)

I also have some really awful ugly code for parsing banks and completely fake ADSR which I hacked in there. If anybody wants to help me finish the vgmtrans stuff I've done, I'd more than appreciate it. I also have BRSEQ support in there as well.
by Jasper at 11:52 AM EST on February 7, 2017
Also, yeah, arookas is a mysterious guy.

This otherwise innocuous file says the word "JSystem library", and the only reference to that name publicly that I can find is on some otherwise unknown guy's blog bio:

"the code that arookas decompiled is no longer available" -- did he stumble upon a debug copy of JSystem or something?
by dj4uk6cjm at 1:31 PM EST on February 7, 2017
That's neat, I didn't know the slider theme in Super Mario Galaxy 2 was sequenced! What is the progress on the wav to soundfont converter if you don't mind me asking? It would be awesome to have SMG and other Wii and Gamecube soundfonts similar to this for example :) I think it's safe to say that thanks to arookas we have a pretty good amount list of games that use bms now.
by Yuuto at 1:49 PM EST on February 7, 2017
Okay, these formats really seem to be incompatible, but nice to see you got the same results regarding the branch opcodes.

I don't think he got a debug build, he rather rewrote the disassembly of some functions by manually (can't remember the exact code). He also didn't name them according to the .map file.

I think I'm giong to rewrite my player, guess this will be the best way to check for the right behaviour. Writing a converter that can handle all kinds BMS files correctly is impossible anyway, since the converter would not even be able to tell whether a sequence terminates. Due to the various jumps and calls we get to the halting problem at some point.
by Jasper at 2:16 PM EST on February 7, 2017
I don't think the formats are that incompatible -- it's just some new-ish stuff and there isn't any opcode overlap as far as I can tell. The interpretation of the perf values in MML2 are a tad different, and I don't properly support both yet. See me changing the generic code here:

I have to do some more investigation to figure out the range of that.

Re: conversion, the approach that vgmtrans takes is to assume that any branch that has been taken before is considered a "Loop Forever", and it copies patterns like that until all tracks explicitly end or are in "Loop Forever" state. It's not perfect, but it gets you far enough to stick an epic flintstones in there.

I do have a Slider soundfont, but it's not perfect. As mentioned, I never quite figured out the values in the ADSR data. Twilight Princess uses multiple .aw files per WSYS, and I never quite figured out how the C-DF table actually works. Trying to copy what JAudioPlayer did got me in some really weird spots. is just the result of a ton of trial-and-error to get it to sound accurate, but someone smarter could probably figure out the actual meanings there.
by Yuuto at 5:53 PM EST on February 7, 2017
Some commands do overlap, like MML_TEMPO and cmdNop or MML_TIME_BASE and the cmdPrintf of the newer version. It's not a major difference, but different enough to be completely misinterpreted by a program.

That would be an option for simple single-loop seqs, but that's it. It would fail at more complex ones, you would have to adjust the converter for certain seqs to get the result you desire, as there just can't be a program that can handle everything properly. It is only possible to some extent, but it is possible. One could provide switches to disable certain types of branches or limiting the number of iterations or whatever.

Dou you mean JAudioPlayer got it right (apart from decoding the files)? Then I can take a look at it one more time, it's been a while since I wrote it.
by Jasper at 7:18 PM EST on February 7, 2017
I didn't actually run JAudioPlayer. I stared at the code for it, probably didn't quite understand it, tried to translate it into my vgmtrans code, and failed.

Can you roughly describe to me what the C-DF section does? Also, just in case you don't want to keep refreshing a forum thread, do you have IRC/Discord/Skype if you want to investigate a bit faster?
by Yuuto at 7:38 AM EST on February 8, 2017
I'll take a look at it, as I remember the structure wasn't too complex.

I get the feeling most BMS commands are parsed before thy are actually executed, my breakpoints get always triggered before the expected event occurs, except for the conditional opcodes like C4 and C6. They are executed right on time and I guess this is due to their result isn't predictable. However, I could be completely wrong with that.

Currently I don't have any of these, but perhaps I will take a glance at IRC soon.
Ports, Registers and data manipulation by Yuuto at 8:54 PM EST on February 8, 2017
Found out a lot on this topic today, now I know how most parts of the dynamic seqs work.


There is still plenty of things I didn't document, but I think that's a good start.
I also know how conditional commands work, but that I'm going to upload another time.
by Yuuto at 6:56 AM EST on February 11, 2017

"C-DF" is followed by the number of samples (uint32) in this section and an offset (uint32) for each sample. The offsets point to a rather long and empty structure, but you'll need only the first two uint16. The first is the aw file the sample is stored, the second is the sample ID that is used in the instrument banks. You can then match the sample index in the C-DF section with the entry index for the sample information for the corresponding aw file in the WINF section.

For example: If the first entry in C-DF says aw file 2 and sample ID 0x2dc, you look into WINF section for aw table 2 and the first entry.

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=]Link[/url]


HCS Forum Index
Halley's Comet Software
forum source
Generated in 0.0077s;