It is currently Thu Aug 16, 2018 9:10 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sat Aug 11, 2018 1:14 am 
Offline
User avatar

Joined: Wed Jul 11, 2018 2:24 am
Posts: 12
Location: Batrachia, New York
Would anyone have some advice about Removing/Disabling music but keeping the sound effects in a NES rom? I've tried a few things... just not sure where to begin. This is my 2nd hack; still noobing out hard here, but I'm pretty sure this game hasn't been hacked before.

Check out my first hack if you have some time to kill : http://www.romhacking.net/news/2062/


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 2:24 am 
Offline
User avatar

Joined: Fri Jan 24, 2014 9:05 am
Posts: 150
Location: Hungary
This largely depends on how the particular sound engine is built. I personally always have two flags that allow me to disable the music and/or sound effects so that the player can change these settings. But most games probably did not bother to add any kind of separation, in which case you'll have to reverse-engineer the sound engine to find where music processing starts and where sound effect processing starts so that you can add your own code to (conditionally) skip over the music part.


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 2:27 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3474
Location: Mountain View, CA
What game? It matters.

Yes it's possible -- people doing NSF rips basically do the opposite (playing only the music tracks). However, it's long and involved, and kind of a "niche" thing because it requires, on a game-by-game basis. You won't find many (if any at all) romhacking tutorials on this subject. This is what's involved, paraphrased:

1. Reverse-engineering of the game, to figure out where the music playback code/engine is in the game (it may be in multiple places depending on the game) -- this requires extensive 6502 knowledge and general familiarity with the NES, as well as its audio registers. Many people find the audio aspects of the NES to be very tedious/daunting and tend to avoid it (I myself am one such person),

2. Reverse-engineering the engine itself, and its sequence data format for the music/sound effects. The engine has to be "understood" before it can be analysed further. Every music engine is different, although commercial companies tend to make their own engines and use them throughout games (ex. Capcom had their own, Konami had their own, Nintendo had their own, etc.), and change/tweak them over time (as newer games tended to do different things),

3. Figuring out, safely, what 6502 and/or data needs to be changed in the ROM so that effectively the sequenced music data isn't used but the sound effects are. This is a subset of item #2 above (so more like "#2b" rather than "#3"), and then doing it. This may become complicated if the desire is "disable the music played only in this one part of the game", where the music in question is actually used in several places in the game.

In other words: you really have to understand how the music engine in the game works at the 6502 level, and the data format of the sequence or effects data, to accomplish this.

A good example of the in-depth reverse-engineering of this sort was done by rainwarrior some time ago for StarTropics. The deep technical details of the reverse-engineering aren't covered in that video, but safe to say Brad had to do all of the above... then again, considering he made and released his own NES game (Lizard) his capability to do it should come as no surprise.

I might suggest posting in this thread and asking one of the people there who commonly do NSF rips if they could take a look at your thread here for general assistance. But do not hijack that thread for this project/idea you have here -- that thread has a very specific purpose. People doing NSF rips tend to be quite familiar with game sound engines and may be able to provide technical insights to certain games or certain engines, i.e. User X might have great familiarity with doing NSF rips of Capcom games, while have no experience with Acclaim games, while User Y has the opposite.


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 3:11 am 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 957
Location: Japan
If you don't know 6502 assembly, forget it; find a good Samaritan somewhere to do it for you for your particular game.

If you know 6502 assembly, it's not that hard. Just look into the NSF for a hint as to where the game code receives its value for the song or effect, and do it the dumb way: usually a range of values is music, and all values above/below that range are SFX. Write some rerouting code that CMPs #LOWER_LIMIT, and CMPs #UPPER_LIMIT to reject values above or below these.

Going as deep as the audio driver or music data format is usually not necessary; you just find the entry point for initializing tunes and filter out unwanted values.

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 3:16 am 
Offline
User avatar

Joined: Thu Oct 26, 2017 12:29 pm
Posts: 37
What is the most common method for implement sound effects in games?

I understand it's per-game basis, but I'm asking in broad terms.

Are the effects made by the DMC channel and the rest of the channels are used by the music?
Or are the effects somehow mixed-in with the music by disabling a music channel momentarily?
Any other method?

_________________
...


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 4:04 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 332
olddb wrote:
What is the most common method for implement sound effects in games?

Mute whatever music channel(s) are needed while the sound effects play. Different sound effects will want to use different channels, or multiple channels; it's too restrictive to force them onto one.


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 5:26 am 
Offline
User avatar

Joined: Thu Oct 26, 2017 12:29 pm
Posts: 37
pubby wrote:
olddb wrote:
What is the most common method for implement sound effects in games?

Mute whatever music channel(s) are needed while the sound effects play. Different sound effects will want to use different channels, or multiple channels; it's too restrictive to force them onto one.


Won't this cause "hiccups" in the music?

_________________
...


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 7:11 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20405
Location: NE Indiana, USA (NTSC)
olddb wrote:
pubby wrote:
Mute whatever music channel(s) are needed while the sound effects play. Different sound effects will want to use different channels, or multiple channels; it's too restrictive to force them onto one.

Won't this cause "hiccups" in the music?

Yes. When these hiccups are short, the human auditory system ignores them under the illusory continuity of tones effect. When these hiccups are long, the player accepts them as a quirk of the NES platform. Different games apply different interruption policies:

  1. Stop the playing note, and don't start it again until both the sound effect has ended and it's time to play another note.
  2. Stop the playing note but resume it immediately once the sound effect has ended.
  3. Stop the playing note but resume it with a fade-in once the sound effect has ended.
  4. Each tick of the audio driver (usually 60 Hz), compare the volume of the playing note to the volume of the sound effect on the same channel, and play whatever is louder. In my experience, this produces better results when a sound effect has a long quiet tail, as the music is allowed to mask it.

My own audio driver "Pently" uses option D by default but can be configured at build time for option B using the PENTLY_USE_MUSIC_IF_LOUDER flag.

Previous discussions about sound effect interruption:


In any case, to minimize interruption, one convention several games use is to put pulse sound effects on channel 1 and your main melody on channel 2.


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 8:25 am 
Offline
User avatar

Joined: Thu Oct 26, 2017 12:29 pm
Posts: 37
Thank you so much.

_________________
...


Top
 Profile  
 
PostPosted: Sat Aug 11, 2018 4:13 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 957
Location: Japan
A qualified "Yes" would do.


Attachments:
lecturessm.jpg
lecturessm.jpg [ 33.35 KiB | Viewed 258 times ]

_________________
http://www.chrismcovell.com
Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 2:20 pm 
Offline
User avatar

Joined: Wed Jul 11, 2018 2:24 am
Posts: 12
Location: Batrachia, New York
Still having trouble locating some of the music parameters in hex code. Like everything else its doable just tricky... the joys of trial and error


Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 2:59 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6588
Location: Canada
To elaborate on the tip to use NSF rips as a guide:

NSFs will have their INIT routine called with a song number loaded into A. (In FCEUX you can actually conveniently type INIT and PLAY into the address for breakpoints.)

You can usually follow that directly to where it gets used to actually start playing a song. Often it will get stored temporarily with a PHA before some initialization routines, or look up a second number from a table added by the NSF ripper, but ultimately that value in A has to determine the song to play.

Once you find where it goes, you can probably achieve music silence by cutting off the code that reads that value back to load a new song.


Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 11:44 pm 
Offline
User avatar

Joined: Wed Jul 11, 2018 2:24 am
Posts: 12
Location: Batrachia, New York
I found a NSF file still struggling to find those breakpoints! So close on this one!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group