FF6 Hacking
new here and have some questions - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Hacks, Resources and Tutorials (https://www.ff6hacking.com/forums/forum-1.html)
+--- Forum: Opera House Rehearsal Room (https://www.ff6hacking.com/forums/forum-71.html)
+--- Thread: new here and have some questions (/thread-4005.html)



new here and have some questions - musicalman - 05-24-2020

Hi everyone, I'm new here. Hopefully I'm posting this in the right place! Apologies for the long post, but I have a fair number of questions.

I'm by no means an expert, but I've done some porting for SmW, so I know, musically speaking, how SPC700 music works. I randomly stumbled across FF6 custom music on Youtube, and decided to at least give FF6 porting a shot and see how I take to it. For now, I expect to be more active in the SmW community but I always like trying new things.

I should also probably mention that I am visually impaired and am unable to play most video games. Thus, my experience with romhacking is nonexistent, and will probably stay that way for the near future. The reason I actually took off with SMW porting is because the music insertion tool is standalone enough that someone like me who will never really get into romhacking can still immerse and specialize in the musical side of the process. But the tools available for FF6 seem rather daunting to me because more knowledge about the rom seems to be required. While I understand the basics somewhat, I have trouble putting it together in a way I understand. So please forgive me if I ask stupid questions. BTW if it's more appropriate to discuss this on the Discord, let me know.

I assume I need to use these tools to make ports. Learning the MML syntax shouldn't be much of a problem for me, with a few exceptions, but I feel confident in my ability to work out that bit of the process. Assuming I'm off to a good start so far, here are the things which confuse me at the moment.
1. What's the easiest way to hear the port while you're working on it? In SMW/AddmusicK you can generate spcs which I always do while working on the mml. So is something like this possible with the tools here?
2. (sort of ties into 1) When uploading ports here, you need the data bin file, the instruments bin file and a preview spc at minimum. Perhaps I haven't looked enough for the answer to this one, but how do you generate those from the mml?

3. I know some people use custom samples in their ports. I like making my own samples so I was hoping to do that too, though FF6 has nice stock samples so I'll try to use them too. With SmW it's easy to use custom samples; the amount of samples needed in-game is comparatively small, thus not too many ports need to modify AddmusicK's sample table as SMW and custom samples can often coexist nicely in aram. Those who do need a bit of extra space will kill off some of the less important/used samples and there's now even a list of such samples on smwcentral. So, what's the situation on the samples in fF6 ports?
4. From what I've read, FF6's echo buffer size is fixed. I think the above tools let you change that when patching a rom, but I'm guessing for any ports I create, I shouldn't mess with it since it's a global setting the engine uses, and isn't customizable per song. Just want to confirm that.


If you've made it this far, thank you for reading and for any guidance you can give!


RE: new here and have some questions - Cecil188 - 05-24-2020

1. One of those tools(It's titled _TEST.py in my directory) allows you to insert a specified .mml file into a destination ROM. I tend to write a measure or two, run the .py script, and then open the ROM to hear the song. Simple as that.

3. I believe it's this thread here: https://www.ff6hacking.com/forums/thread-3922-post-38220.html that has a patch that allows the ROM to use many more samples. I have no idea how to go about adding new samples, but there's quite a few there to start out with.


RE: new here and have some questions - madsiur - 05-24-2020

Regarding #2, I think mfvitools can turn a mml file into FF6 raw hex, or at least insert the song in the ROM. If you ever put a song on the wiki, you'll need the FF6 raw music data, the 32 bytes samples file and a SPC file you can generate with an emulator (like snes9x or zsnes) when the song play in-game.

Regarding #3, I think there's a tool in the mfvitools repository called insertmfvi that allows you to insert samples in the game, at least that is what emberling use. Prior to this it was done manually by relocating/expanding the samples pointers/adsr/loop point/pitch blocks, making a few ASM changes and adding samples. There are samples of other Squaresoft games here but some don't have the correct pitch value to be usable in FF6.

Note that I'm not a music hacker so I might got some stuff wrong lol


RE: new here and have some questions - emberling - 05-24-2020

1. I use notepad++ for MML editing and have configured hotkeys so that one keypress inserts the loaded MML file into a ROM (with any specified custom samples) and another keypress opens snes9x to either listen ingame or rip an SPC for analysis in kuroneko. Direct SPC export would be faster but only by a second or two, and making the required "blank" initialized SPC isn't quite in my skillset (I've tried the obvious things, just replacing the sequence, samples, program tables, and track pointers, but it doesn't work reliably enough to be worth using.)

If using snes9x for spc export is too inaccessible for you, though, I can try to build an independent SPC generator script, just understand that it won't be as reliable as using the original game unless I can get someone better at the code internals to help me with a clean blank.

Batch file for inserting MML with samples:
Code:
{PATH_TO_MFVITOOLS}\insertmfvi.py -m "%~1" {REPLACED_SONG_ID} -i {PATH_AND_FILENAME_OF_CLEAN_FF6_ROM} -o {PATH_AND_FILENAME_FOR_DESTINATION_ROM} -l {PATH_AND_FILENAME_OF_CUSTOM_SAMPLE_DEFINITIONS} -s {PATH_AND_FILENAME_OF_CUSTOM_SAMPLE_FILES}
mine looks like this:
Code:
E:\Stuff\BeyondChaos\ff5ff6mcs2\temp\insertmfvi.py -m "%~1" 4C -i E:\Stuff\BeyondChaos\ff5ff6mcs2\test.smc -o E:\Stuff\BeyondChaos\ff5ff6mcs2\mytest.smc -l E:\Stuff\BeyondChaos\ff5ff6mcs2\samples\bcx.txt -s E:\Stuff\BeyondChaos\ff5ff6mcs2\samples\bcx\

2. The song data page here isn't really up to date with the current state of tools. Specifically, all the song data posted is for either original samples only, or for one specific set of custom samples (either the old T-Edition set posted on the page, or the Beyond Chaos set that's floating around somewhere). There are no examples or precedents on this page for songs that include their own samples as is common in SMW, even though the tools support it. This is mostly because the big FF6 projects that use custom music ... well, they're BIG. Loading a whole mess of independent samples for each song, when you've got a couple hundred songs, would quickly give you more samples than the ROM can hold. Smaller projects are possible, but it hasn't really been a thing yet.

So if you're interested in posting something with its own custom samples, that's a new frontier! Probably the best way to do it is to zip up the MML with the samples and assume insertmfvi will be used. Maybe with an extra info file containing the raw loop/tuning/ADSR data, and maybe with FF6 style BRR headers, in case someone wants to insert it manually? (insertmfvi doesn't care about BRR headers, but FF6 internally uses a different header than the AddmusicM loop header used by SMW community, and mixing these could get very annoying for manual inserters who may not know the potential problem). Anyway, how best to do this is probably best discussed on discord with input from several people.

For something with original samples, just run mml2mfvi on your MML and it'll give you the binary files needed. Getting the SPC is answered in #1.

3. Load custom samples from MML with the "#brr" directive when using insertmfvi. You'll need to specify loop point, tuning, and default ADSR; there are several ways to express each of these described in the mfvitools docs. As far as memory, things are pretty limited: you've got 3746 BRR blocks to work with (33,714 bytes) before you overflow in memory and things start to glitch out. There are as yet no ways of effectively increasing this size when making songs for romhacks, other than reducing the global EDL value. Similarly, sequence size is limited to 0x1000 bytes.

BUT, if you're just making music and not intending it to be part of an actual gameplay project, there's considerably more flexibility. Insertmfvi can change the global EDL, of course, as you've noticed. That basically moves where the END of sample RAM is. I'm not sure if I've posted this to github yet, but my current version of insertmfvi can also change the starting address for sample RAM. Effectively, this lets you divide all the memory between $1C00 and $F500 between sequence, sample, and echo however you like (as long as it's in that order). That has to be done at the command line, though, not in MML, and it'll likely be different for each song.

(FYI, the memory from $2C00 to $4800 is usually used for sound effects, which is why it's vital to keep intact when playing the game, but an obvious sacrifice when just making music.)

4. Already touched on this in 3, but some more on the echo buffer -- a couple months ago I got Myria to try to solve this, and she actually came up with a working hack that independently sets the echo buffer for each track. The problem we found is, unfortunately, the FF6 sound engine's "set echo buffer" interrupt doesn't actually *work*. It changes the size, alright, but it also ends up blasting a bunch of nasty corrupted data out of the speakers whenever it changes. Fixing *this* isn't really hard, per se, but it requires expanding the song engine code, which has a bunch of attendant annoyances that haven't been worth dealing with. So this is a very approachable problem, basically, it just hasn't been sufficiently approached yet.


RE: new here and have some questions - musicalman - 05-24-2020

Thanks guys for the replies.
I think using snes9x to export an spc is easy enough for me to do. I haven't tried it, but last I remember snes9x just uses standard controls so there's no accessibility challenges with accessing its basic functions. Thank you for the batch file and the other tips btw.

I think I won't attempt custom samples for my songs for a little while as it seems like it would cause a fair bit of confusion for romhackers. I'll take a stab at it at some point, but will wait until the idea is a little more fleshed out before I dive fully into it.

I guess I'm a bit spoiled by SMW's tools. So for now I think I'm going to play on the simple side with FF6. But I think I now have a firmer grasp on what I need to do, but will needx to actually try it to be sure, so I'll probably either be active on here or the Discord if I run into issues. Looking forward to showing off a port or making an upload soon!


RE: new here and have some questions - PowerPanda - 05-24-2020

Side-question: are you by chance working on any of William Kage's stuff? If so, I've established contact with him, and he's willing to share any of his source files that might help you out. I would love to use "Shock and Awe" in my patch, but i haven't looked into music hacking yet.


RE: new here and have some questions - musicalman - 05-25-2020

Sorry, I don't know who he is.
My questions were concerned with making FF6 ports which other romhackers could use.