snestracker icon indicating copy to clipboard operation
snestracker copied to clipboard

[Feature request] Rip BRR from game ROMs

Open RowanDDR opened this issue 4 years ago • 2 comments

Ability to rip BRRs from game ROMs. Ideally, preserving ADSR data and the note/octave.

A good test subject would be the "Cowabunga" sample from Turtles in Time which plays with a distinctive echo effect during the game (when you complete a stage, and maybe for other events too).

I'm not aware of an existing tool that can rip BRR including the ADSR data. However, the following tool can rip "virgin" BRR samples from game ROMs:

https://github.com/noisecross/noiSNESs_Brr_Finder

RowanDDR avatar Jun 22 '20 02:06 RowanDDR

You can get the offset of the sample table by reading $1015D from the SPC file, which references what DSP register $5D will be initialized to, which stores the high byte of the start address of the table (low byte always null). If the first int16 at the read address is null, we can assume the SPC doesn't have initialized values (some SPCs will have $5D written to in the execution of the code), so instead execute the SPC and wait for DSP register $5D to be written to. (The SPC of Smash It does this, for example.)

For getting the ADSR/GAIN, I suggest executing the SPC and watching for writes to DSP registers $x4-$x7 (x = channel), which are sample index, ADSR 1, ADSR 2 and GAIN respectively. This of course means that any samples included in the song but never played will not have any envelope bytes logged.

exodustx0 avatar Jul 08 '20 01:07 exodustx0

Thanks, however you mention "the SPC file", whereas the subject I am interested in here is ripping sound effect brrs from game ROMs. Sounds effects, such as the "Cowabunga" sample from Turtles in Time ROM are not part of any music SPC in the game, as far as I am aware.

I know that some SNES Music rip packs contain SPCs of the sound effects in addition to the SPC songs, but not always. Even so, it would still be useful to be able to perform the rips ourselves.

RowanDDR avatar Jul 08 '20 01:07 RowanDDR