dakrk / manatools

Collection of tools for Dreamcast audio and music formats
GNU General Public License v3.0
6 stars 0 forks source link

Metadata support #25

Open PiKeyAr opened 1 month ago

PiKeyAr commented 1 month ago

Hi! Thanks for your hard work. This is just an idea to make usage of the tool easier with large quantities of known data.

Basically for MPBs and MSBs, a way to specify what each item is would be helpful. For example, for Sonic Adventure files, we know that bank 0 sequence 0 in all MLTs is the ring loss sound. We also have an enum of all sound effect IDs, which can be mapped to program/sequence IDs like this:

image

If the GUI tools supported loading of some sort of a mapping file to identify data inside soundbanks, we could build metadata for all MLTs/MPBs/MSBs we need, and that would make navigating this data much easier. In my old implementation, I just checked for a TXT file in the same folder as the bank, and assigned names to program IDs based on the contents of it.

dakrk commented 1 month ago

Thank you! Yes, I can do that. Would be good to make such a mapping editable and exportable by the GUI tools too, by double clicking the program column to edit the name.

Another interesting idea could be to see about embedding information in those files by adding an extra chunk to the end of them, because typically files contain their own size in the header, meaning data after that would presumably be completely ignored by the driver.

dakrk commented 1 month ago

mpbgui can now edit and save these map files since 264249d90567263ac3180e294b5d063a6943c1b9. It looks for and saves to a CSV file with the same name as the current file (e.g., "CART_000.MPB.csv"). To deal with multiple similar files however (as in your case), it looks for a "manatools_mpb_map.csv" file in the directory of the current file if a file-specific mapping is not found.

The current format of the CSV file is as follows:

path,name
0,SE_DAMAGE
1,SE_CURSOR
2,SE_DECIDE
3,SE_PAUSE
4,SE_COUNT

MSBs do not have GUI tools yet (and I'm being annoyingly blocked by #21) so I'll leave this open until then