Quoted from webdiddy:No, by existing song I mean a song already in the game.
Editing it to play a song already in the sound ROMs is *probably* not that hard. You'd do what James said to find the address of the song it's playing *and* find the address of another song you wanted to use instead. Then change the first address to the second using an editor, save a new CPU rom, install.
That's the theory, but the question is if the calls to the sound board are that simple. I'm not sure how it knows to loop the song if the song needs to keep playing when you run out of sample, and I'm not sure how it knows to stop the song. You'd want to investigate those actions, too, to be sure you changed everything you need to change.
The other option would be to figure out the encoding of the sound on the sound ROMs. Find replacement song of the same length, encode, and burn new sound ROMs with your new song at the same location as the one you wanted to replace. You'll need to make sure checksums are updated, too. Not trivial, but maybe easier than the CPU hacking.
The copyright issue is simple to describe. First, if you're using the first method (sounds already in the game, simple CPU hack), it's completely legal to do. But it's not legal to redistribute your hacked CPU ROM. It is legal to describe exactly how you did it, and it's even legal to create a software tool to make it easy for someone else to do it, as long as you don't distribute the ROM image.
The second method is completely legal, too, assuming you bought the song in question you're putting into your game (or it was provided for free from somewhere legally already) *and* again, you still can not distribute the sound ROMs. As before, it would be legal to describe and/or provide tools you wrote to facilitate this, you just can't distribute the original -or- hacked sound ROMs. Well, I take that back. If you replaced ALL the original sounds in the BW sound ROMs for a given game with freely redistributable music (which does exist, but it won't be anything you've ever heard before, most likely), THEN you could redistribute ROM images for others to use.
--Donnie