Re: Warmonger!
This is kinda difficult to explain but I will try my bast. NES is mostly analog sound and you could say that the sound system is embedded as it's quasi audio and the sound hardware is built into the CPU.
You have 5 channels for the sound and you access these channels by address ports. First you would have to turn the sound on by writing to $4015 which is read/write. All you need to know right now is the write function. With this you can turn on any of the 5 channels you want.
So each channel has a different ability and able to manipulate the sound frequencies in a certain way.
Square 1/Square 2:
duty, loop envelope/disable length, evn disable, vol/env
etc
Triangle:
Control, linear counter load , lenghth index, etc
Noise:
making sound effects.
DMC, PCM, DPCM: (Delta Modulated Channel
What I understand is this is a older form of wav. This is used for samples of drums and to make tunes sound heavier, also used for voice samples like when you hear some games talking.
This is just a very brief example of the technical aspects since you wanted to know how it works.
----------------------------------------------------------------------
So you have the music driver in a NES game and the program code that was written by the programmer to manipulate the sound hardware. So you write some code and the code picks up the data bytes in the PRG(Program ROM) and stores then in various memory addresses and eventually transfers them to the sound hardware and so this is how the sound hardware is manipulated.
So for a hacker hacking NES sound you don't want to find the code unless you're into assembly. You want to find the data and change the data for each sound channel so it produces a different sound. Now what you possibly find is a byte that in the simplest example is for the note of a certain channel say square 1, so you could have note A or E or a rest or whatever. Then you could have an octive for the note. The note and the octive could be in the same byte which would be a good idea. Then you could have another byte for speed and another for the instument and another for the volume and it's different for each game but you should know these few things that a game will have for each channel notes,octave,volume,speed, instument, etc.
So you could use Virtual NES, and GNSF for hacking music, because with GNSF you can bring up a menu and you can turn on and off the other channels and listen carefully to each to see if you heard a change or not. With VirutaNES you have a keyboard that plays while the NSF plays and you can kinda tell what notes are being played and this is very usefull for hacking. So yeah it's better that you hack the NSF first and after you figure it out it's easy to find the place in the rom since the NSF is nothing more then a dump that was edited to run in a NSF player.
The easiest way for me to find the music data is to use assembly but you can use the method I just told you with decent results. Sliver-X doesn't use assembly and makes some really good music hacks. And infact he has some docs that you should look at. He has his music hacking doc and he has Final Fantasy 1 mapped out and a few others that you should look at on the message boards at
http://www.panicus.org/
Also check out the Super Mario Bros1 music hacking Documentation or it's called something like that.
Also check out my NSF ripping doc and this will give you some insite to hacking music as well.
http://gilgalad.panicus.org/ you can find the doc linked to my NSF page.
Well if you have any more questions let me know. There is hardly enough space here to cover it all. You should start doing some reading. Music is not easy at all.