There is an NSF compiler?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
There is an NSF compiler?
by on (#69496)
Hi, I have a fairly simple question I hope someone can help with. Is there a program that can compile multiple NSF tracks into one NSF file? The powerpak is a great NSF player, but unless multiple tracks are compiled into one master track, you need to restart the powerpak when you want to play another track.

Thanks for any help.

by on (#69497)
There's nothing like that out there.
NSF files are basically roms. This would mostly be the same process as making a multicart.

by on (#69499)
Dwedit wrote:
NSF files are basically roms. This would mostly be the same process as making a multicart.

But because all NSFs use the same mapper (4 KiB PRG banks in $8000-$FFFF controlled by $5FF8-$5FFF), and this mapper supports switching the entire PRG area, it's not as hard as one might think. NSFs that don't bankswitch would just need a front-end that bankswitches to the right NSF during init, but NSFs that do bankswitch would need their $5FFx writes patched to add a constant.

by on (#69541)
Sorry guys, I guess maybe I wasn't very clear on what I'm asking, so I'll try again.


I have found most .nsf files for various games are the game's entire soundtrack, from titlescreen to staff roll. These .nsf files contain the game's ENTIRE soundtrack.

I have a few .nsf files that are just individual tracks, and would like to know if there's any way to put them all together in one master .nsf like what is most common.

In particular, I found RushJet1's excellent Megaman 9.5 original arrangement split all up into individual tracks on Capcommunity here:

http://www.capcom-unity.com/mega_man/go ... post_num=1

So what I'm asking here is if someone could possibly combine these nsf files into a single master nsf whose tracks could be scrolled through using the Powerpak?

Sorry if this is confusing, I'm not sure how else to explain it.

by on (#69549)
SatoshiMatrix wrote:
So what I'm asking here is if someone could possibly combine these nsf files into a single master nsf whose tracks could be scrolled through using the Powerpak?

Sorry if this is confusing, I'm not sure how else to explain it.


You could do it by gluing the NSFs together with some wrapper code probably, but it'd be huge (8K times however many songs there are, thanks to the padding and the engine being reproduced over and over). However, as the one who wrote the songs, I can compile a special version if you want it. This was my first time trying this so hopefully nothing is really wrong with it.

by on (#69595)
tepples wrote:
But because all NSFs use the same mapper (4 KiB PRG banks in $8000-$FFFF controlled by $5FF8-$5FFF), and this mapper supports switching the entire PRG area, it's not as hard as one might think. NSFs that don't bankswitch would just need a front-end that bankswitches to the right NSF during init, but NSFs that do bankswitch would need their $5FFx writes patched to add a constant.


No offense, but I'd like to make a small addendum to what you said so that others know. If you also use the FDS setting in the NSF header, you can use $6000 - $FFFF. Which includes the following registers; $5FF6 and $5FF7 to control $6000 - $6FFF and $7000 - $7FFF respectively. This feature can also be used for NSFs that are not specifically FDS or those that do not have FDS sound.

-----------------------------------------------

As far as merging other NSFs together, be it one song each or more.

What you want to do is designate a hardwired bank that is always loaded. There is where you would keep your initialization code. Also, if the NSFs have different play entry points, you need to designate a variable to switch the play address entry point. Using this variable and checking it for certain numbers and then load the appropriate play entry point address.

For example;

If you want to merge many Megaman tunes together from various games 1-6. The music code and data is located at $8000 - $BFFF. Init: $8003, play: $8000, load $8000.

Each NSF bank is 4KB. So we'll do the following;

0- $8000 - $8FFF

1- $9000 - $9FFF

2- $A000 - $AFFF

3- $B000 - $BFFF

4- $C000 - $CFFF (hardwired bank)

Set the NSF header at 70h to $00,$01,$02,$03,$04

This is telling the player to load these banks first when the NSF is loaded or when the tune is switched. You can also eliminate other banks, whatever is not used. But that's beyond the basic description of what I'm telling for you to get started.

So, we would have Megaman 1 first. Then we want to append the Megaman 2 banks to the NSF file.

5- $8000 - $8FFF

6- $9000 - $9FFF

7- $A000 - $AFFF

8- $B000 - $BFFF

So, now you have the banks set up.

The code can be written in many different ways, but to try and keep it simple I'll do it this way.

Init:

TAX
LDA TUNE_INDEX,X
STA CORE_CHECK
CMP #$03 ; 4th song is from Megaman 2
BCS SWITCH_BANK
JMP AUDIOIN

SWITCH_BANK:

LDA #$05
STA $5FF8
LDA #$06
STA $5FF9
LDA #$07
STA $5FFA
LDA #$08
STA $5FFB
LDA CORE_CHECK
JMP AUDIOIN_1

TUNE_INDEX:

.DB $00,$01,$02,$03,$04,$05,$06,$07,etc

If there are more than one play entry point addresses, do the following or otherwise just set the play address in the header.

LDA CORE_CHECK
CMP #$03
BCS DRIVER_1
JMP AUDIOIN

DRIVER_1:
JMP AUDIOIN_1

This is just one way to do it. You'll have to get creative in dealing with NSFs that are already bankswitching and those that have banks in other address ranges than I described. I don't really feel like writing out all the possibilities. However, this is enough to get you started if you want to do other NSFs yourself. Even though, I know you asked others to do it for you and it was done.

by on (#69612)
RushJet1 wrote:
SatoshiMatrix wrote:
So what I'm asking here is if someone could possibly combine these nsf files into a single master nsf whose tracks could be scrolled through using the Powerpak?

Sorry if this is confusing, I'm not sure how else to explain it.


You could do it by gluing the NSFs together with some wrapper code probably, but it'd be huge (8K times however many songs there are, thanks to the padding and the engine being reproduced over and over). However, as the one who wrote the songs, I can compile a special version if you want it. This was my first time trying this so hopefully nothing is really wrong with it.



Oh wow, thank you! this is exactly what I was hoping to find, and from the composer himself! This is really fantastic, among your best work. Must have taken ages to made this.

RushJet1, did you make this using Famitracker? These tracks are really damn impressive .nsf work.

Once again, thank you for doing this!

by on (#69663)
In this post, RushJet1 wrote:
You could do it by gluing the NSFs together with some wrapper code probably, but it'd be huge (8K times however many songs there are, thanks to the padding and the engine being reproduced over and over). However, as the one who wrote the songs, I can compile a special version if you want it. This was my first time trying this so hopefully nothing is really wrong with it.

Doesn't song #16 sound a little like it was ripped out of Battle Kid?

by on (#69666)
Dwedit wrote:
RushJet1 wrote:
You could do it by gluing the NSFs together with some wrapper code probably, but it'd be huge (8K times however many songs there are, thanks to the padding and the engine being reproduced over and over). However, as the one who wrote the songs, I can compile a special version if you want it. This was my first time trying this so hopefully nothing is really wrong with it.

Doesn't song #16 sound a little like it was ripped out of Battle Kid?

Yeah, who ripped who?

by on (#69701)
thefox wrote:
Dwedit wrote:
RushJet1 wrote:
You could do it by gluing the NSFs together with some wrapper code probably, but it'd be huge (8K times however many songs there are, thanks to the padding and the engine being reproduced over and over). However, as the one who wrote the songs, I can compile a special version if you want it. This was my first time trying this so hopefully nothing is really wrong with it.


Doesn't song #16 sound a little like it was ripped out of Battle Kid?

Yeah, who ripped who?


I posted this at several sites (2a03, theshizz, ocr) on November 4, 2008. Sivak posted this on January 9, 2009. I didn't notice how similar his song sounded to mine until July 19, and as a result I (kinda jokingly) posted this. It's kinda close, isn't it? I messaged him and said it was fine that he clearly pulled some inspiration from that song, whether knowingly or subconsciously :X

by on (#69702)
SatoshiMatrix wrote:
RushJet1, did you make this using Famitracker?


PPMCK.. and thanks for the comments ;P

by on (#69704)
I can see after hearing it that there is a lot of similarity that were pulled from your song. Those statements aside, I never heard about that soundtrack before until today. It's very good! It feel so "from the days" that I have a hard time to not mix with one of the original soundtrack from the nes mega man ;)

edit:

I just finished listening to it. Wow. Even thought it was an alternate soundtrack for mm9 it gives me inspiration to make a platformer with that music. That music should be in a game, it's written all over it.

by on (#69711)
RushJet1 wrote:
thefox wrote:
Yeah, who ripped who?


I posted this at several sites (2a03, theshizz, ocr) on November 4, 2008. Sivak posted this on January 9, 2009. I didn't notice how similar his song sounded to mine until July 19, and as a result I (kinda jokingly) posted this. It's kinda close, isn't it? I messaged him and said it was fine that he clearly pulled some inspiration from that song, whether knowingly or subconsciously :X

Yeah, I thought it was like that. There's no dispute that Sivak copied A LOT. I hate when people don't acknowledge other peoples work and instead make claims like "All programming and music composition is by me.". They should ask for the permission BEFORE posting/using the copycat version, not after they get caught.

For the record, I like your version better. :)

by on (#69715)
thefox wrote:
I hate when people don't acknowledge other peoples work and instead make claims like "All programming and music composition is by me.".

It's not always easy to tell where "standing on the shoulders of giants", as Bernard of Chartres put it and as Isaac Newton popularized it, ends and copying begins.

Quote:
They should ask for the permission BEFORE posting/using the copycat version, not after they get caught.

So you ask for permission in one medium, and the copyright owner grants it in that medium. But a new medium is developed afterward, and the copyright owner declines in that medium. The result is the DVD versions of WKRP in Cincinnati, which ended up with the Jimmy Hart version of most songs.

And what exactly should one do when he doesn't know he's copying until he is caught? George Harrison got burned for this in Bright Tunes Music v. Harrisongs Music, the case of "My Sweet Lord".

by on (#69741)
tepples wrote:
And what exactly should one do when he doesn't know he's copying until he is caught?


Tepples the armchair lawyer spoke! Here we go again with the impartial argument ;) Now on a serious note thought it's pretty obvious that the song was "inspired" by the one from rushjet. There is so many similarity that it cannot be a coincidence. You cannot stay gray in that case.

What you don't realize it that it now affect your judgment on the content since it was never mentioned from the start. Now you start to doubt things like "is it the only one that was 'inspired' that way?". It's sad in a way that now I won't listen to the soundtrack (BT) without doubting the other songs. It should have been mentioned from the get go and proper credit should have been given, especially when you sell the product after.

by on (#69773)
thefox wrote:
Yeah, I thought it was like that. There's no dispute that Sivak copied A LOT. I hate when people don't acknowledge other peoples work and instead make claims like "All programming and music composition is by me.". They should ask for the permission BEFORE posting/using the copycat version, not after they get caught.

For the record, I like your version better. :)


Thanks, and yeah I was kinda annoyed. Normally something like this wouldn't bother me in the least; however, he is making a profit from this game, so it's not quite so cut-and-dry. Anyway I let it go over a year ago.. it would suck if he actually accidentally copied chunks of it and whoops, someone else's song idea. What, should I demand like 10 bucks from him? :P

by on (#69774)
Banshaku wrote:
It should have been mentioned from the get go and proper credit should have been given


yet this happens all the time. in another thread, this guy posted this and someone else brought up that i wrote the music, and people just ignored that and were like "wow your music is way better than before" after that post :X Not to start a witch hunt or anything--this game is pretty much dead anyway.

by on (#69827)
I see. I really like the soundtrack and that gave me an idea for a game. This is not a mega man but a platformer with some shooting elements (I mean many weapons you can select). I need to put my ideas on paper and sketch it. If it does go forward, I really want to use this soundtrack and will ask proper permission.

For now, I don't expect something anytime soon since I don't have time for my previous projects anyway ;)