tewtal / mITroid

A tool for converting Impulse Tracker files into data for the N-SPC music engine used in Super Metroid, A Link to the Past and other games as well as creating stand-alone SPC files.
23 stars 1 forks source link

EarthBound Music Editor compatibility #6

Open livvy94 opened 6 years ago

livvy94 commented 6 years ago

I use a program called EBMusEd that's basically a dedicated music tracker that reads EarthBound ROM images, and while it saves your custom music directly into the ROM (over the original song data, or expanded areas of the ROM), you can export individual songs' sequence data files to back them up, and it seems like it's similar to what your "Save N-SPC data" button does. (here's an example) Would it be possible for these .nspc exports to be made compatible with EBMusEd? Instrument samples aren't stored in these exports, of course, but I think it'd still be interesting to make something in OpenMPT and be able to import the sequence data into EBMusEd. (The latest build of the tracker is being hosted here.)

EDIT: Here's a better example of an exported N-SPC datafile vs. it running in-emulator (SPC file dumped by SNES9X).

tewtal commented 6 years ago

I took a quick look at it and it does look like the .ebm files are exactly the same kind of data dump as the .nspc files produced by the "Save N-SPC data" function, although with only music data and no sample/instrument headers or sample data. So with that in mind it should be pretty easy to support writing compatible files. All I would need to do is implement the correct SPC ARAM offsets for Earthbound so that the data and pointers are written correctly.

The fact that I've recently added support for A Link to the Past also helps making this possible since I've already had to implement support for adjusting all the relevant data pointers depending on what game the data is produced for.

I'll take a look at it and I'll probably then just include full support for all features, including custom samples, but I'll also make sure there's a mode that only exports music data for .ebm-file compatiblity.

tewtal commented 6 years ago

I've done some more work on this and in the upcoming version there's limited support for this. I've had some trouble though with EBMusEd expecting (somtimes incorrectly in terms of what's needed) the N-SPC data to conform to a very specific way of being written otherwise it'll give errors when importing. For example EBMusEd expects all the tracks to be writtten sequentially and never have a track be reused in multiple patterns. I've added some workarounds to disable those features in the program and it mostly works now but for some songs it still refuses to import it. And even when the imports work EBMusEd likes to crash when trying to play it :)

I'll give it some more time though and see if I can fix it, but it's not a major priority right now.

livvy94 commented 6 years ago

Thanks for working on it at all! EBMusEd-related things don't get updated very often so I appreciate it a lot.