Game music

Blade556

New member
Another round of questions for me to add to the FAQ I have on my website, so again, I'm gonna have to ask you guys to bear with me. If you have a tutorial or anything, I can put it there with your name on it, like I have already done before.

How exactly is music stored in video games? How is it processed and interpreted into music? What else should I need to know about music?

I know there's alot of assembly involved, so try to be as basic and explanatory as you can.

PS: If you say the word music program once, you will be slapped around a bit with a tuna fish.<P ID="edit"><FONT class="small">Edited by Blade556 on 10/18/05 11:50 AM.</FONT></P>
 
> How exactly is music stored in video games?

It varies on a game-by-game basis. There is no standard. That's all the information we can give you unless you give us a specific game.

> How is it
> processed and interpreted into music?

It varies on a game-by-game basis. There is no standard. That's all the information we can give you unless you give us a specific game.
 
> It varies on a game-by-game basis. There is no standard.

Yeah, you should see the format in SMB1.

> That's all the information we can give you unless you give
> us a specific game.

And once we give you said information, we will have to kill you.
 
> How exactly is music stored in video games?

0s and 1s.
 
Warmonger!

<img src=smilies/laff.gif><img src=smilies/laff.gif>

Seriously though, is there no generic way music is stored into a ROM image?

Heck, you can even go console specific if you wanted to, just give me something...
 
Re: Warmonger!

> Seriously though, is there no generic way music is stored
> into a ROM image?

There isn't.

> Heck, you can even go console specific if you wanted to,
> just give me something...

There are no console-specific music formats, either. It's per-game. Deal with it.
 
Re: Warmonger!

> There are no console-specific music formats, either. It's
> per-game. Deal with it.

So the 2A03 on an NES deals with different NES music differently for each game? It doesn't have the same interpretation laws? Come on.

Ok, here's more questions then. What is so different about the way music is stored within NES roms? How is it different for each game?<P ID="edit"><FONT class="small">Edited by Blade556 on 10/19/05 06:39 PM.</FONT></P>
 
Re: Warmonger!

> So the 2A03 on an NES deals with different NES music
> differently for each game? It doesn't have the same
> interpretation laws? Come on.

You are thinking of logging sound, by dumping the "program" playing the music, which is completely different how that is stored in a rom (which is why rips (psf/usf/etc) are, more often that not, more exotic than dumps (gym/spc/blah)). There may be common "drivers" used for a company or such (sappy for example), but you can't expect this to work as you want to.

> Ok, here's more questions then. What is so different about
> the way music is stored within NES roms? How is it
> different for each game?

Depends on programmers.
 
Re: Warmonger!

> You are thinking of logging sound, by dumping the "program"
> playing the music, which is completely different how that is
> stored in a rom (which is why rips (psf/usf/etc) are, more
> often that not, more exotic than dumps (gym/spc/blah)).

Actually, what am I doing exactly? You know what I'm thinking, so tell me what I'm doing.

You seem to not have understood. I will say it again in caps, rephrased, so you may understand better.

<marquee>HOW THE FUCK DOES THE 2A03 MAKE THE SOUND DATA FROM A NES ROM INTO MUSIC?!</marquee>

For all those with virgin eyes, I apologize. I've asked the question twice now, and nobody is giving me a straight answer.

> Depends on programmers.

...Don't respond please if you're not going to explain.
 
Re: Warmonger!

Okay, wtf.

You come on this board and ask the most broad questions possible, and then get all pissy when you don't get a specific answer in the most dumb-downed terms possible. Why is it that someone who doesn't know at all how emulators work (that is, you) building an emulation FAQ?

The 2A03 is a sound chip. Have you looked up how sound chips work? Have you googled that? Have you looked into making nsfs using mml? Have you bothered to analyze the output of an nsf's separate sound channels to see why they're called Square and Triangle channels? Have you looked up technical documents on the 2A03 and tried to make any sense out of them?

I'm guessing that you've done none of that.
 
Re: Warmonger!

> You come on this board and ask the most broad questions
> possible, and then get all pissy when you don't get a
> specific answer in the most dumb-downed terms possible. Why
> is it that someone who doesn't know at all how emulators
> work (that is, you) building an emulation FAQ?

Considering nobody told me anything I didn't know, I don't know where you're coming from on that. And besides, dumbed down is the way you're SUPPOSED to explain something to someone who has no idea about the concept.

> The 2A03 is a sound chip. Have you looked up how sound
> chips work? Have you googled that? Have you looked into
> making nsfs using mml?

The 2A03, to my knowledge, is a pAPU, and the main processor in the NES. Basically a modified version of the 6502, made to incorporate the ability to create and handle sound.

What the heck is MML, anyway?

> I'm guessing that you've done none of that.

I'm sure I could find documentation on game music if I REALLY looked, but asking here, I can get a really simplified version of what the whole document will explain to me. From there, I can now go read the documentation, and understand it 10 times better than I could just starting off.
 
Re: Warmonger!

> I'm sure I could find documentation on game music if I
> REALLY looked, but asking here, I can get a really
> simplified version of what the whole document will explain
> to me.

That's fine, but please refrain from rash responses to those who are trying to help. That was totally uncalled for in a thread asking for assistance.
 
Re: Warmonger!

> There are no console-specific music formats, either. It's
> per-game. Deal with it.

Well, only thing I can think of is that some game companies tend to use the same formats...like, for example, for the GBA to do really nice music, a music driver must be made, and a lot of Nintendo games use the some version of a driver called Sapphire.

And, thinking about it, I think there may be an at least fairly common sound format for Nintendo DS games...I've seen a lot of files like sound.sdat in sound related directories in card images I've made, I doubt that's a coincidence.
 
Re: Warmonger!

> That's fine, but please refrain from rash responses to those
> who are trying to help. That was totally uncalled for in a
> thread asking for assistance.

Yeah...I was a little frustrated at the time, then it got explained to me (Or as much as I wanted to know by Disch)...

Sorry
<img src=smilies/cry.gif>
 
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.
 
Back
Top Bottom