don't click here

S3&K Collection (PC) HQ music hack [upd v1.3]

Discussion in 'Engineering & Reverse Engineering' started by angryzor, Apr 16, 2011.

  1. angryzor

    angryzor

    Member
    27
    0
    1
    S&KC HQ Music
    Strange, changing 53 works perfectly here, and effectively changes the invincibility song in S3&K...

    No, it's definitely 53.
     
  2. This is awesome. Breathes whole new life into S3&K (not that it needed it).

    I'm gonna play with Project: Chaos in the background! It'll be interesting to see how that changes the tone of the game in general.
     
  3. Azu

    Azu

    I must be stupid. Member
    Chaning 53 nor 42 isn't working for me either.

    Code (Text):
    1. [Config]
    2. [Config]
    3. SongDirectory=songs\
    4. IgnorePauseCommands=0
    5.  
    6. [Songs]
    7. intro_53=53_Pre.mp3
    8. 53=53_Loop.mp3
    9. intro_42=53_Pre.mp3
    10. 42=53_Loop.mp3
    Okay, it works if I remove the intro. Might be a bug in that.
    I think I'll use ADx, after all it supports loops.
     
  4. angryzor

    angryzor

    Member
    27
    0
    1
    S&KC HQ Music
    Can you upload those 2 files please? I have a feeling I might know what the problem is.
     
  5. Azu

    Azu

    I must be stupid. Member
    They're just Cinouss's remix of the Sonic 4 Invincibility song, but I guess so.
    http://www.mediafire.com/?u43r57yxu7f87bq
    http://www.mediafire.com/?i1hexhxh22w4fpr

    Also, if anyone wants to use ADX, heres the tool.
    http://www.mediafire.com/?3kfujab5a8opb0a

    Your songs needs to be in wave first.

    Info:
    Loop in ADX files are defined my samples points. Samples are calcuated as

    follows:

    S*Hz=smp

    S = Current Song's time in seconds. (2mins is 180 seconds)
    H + is the Hertz of your song. (IE 48000Hz, 22050Hz, etc)'
    Example:
    Song Legnth =
    2mins 0secs (s180)
    Starting Loop = 32.450
    seconds, and your Hz is 41000Hz.

    32.450*41000 = 1,330,450smp
    180*41000 = 7,380,000smp

    You can use Audacity or GoldWave to get the smps of your song.
     
  6. angryzor

    angryzor

    Member
    27
    0
    1
    S&KC HQ Music
    Yeah, found the problem. You see at this moment, intro tracks and loop tracks must have the same sample frequency and the same amount of channels. I put that limitation there to guarantee a seamless transition between the 2 tracks, because I wasn't sure of a certain feature, didn't want to check it back then and later forgot about it. I'll tinker around with it a bit, see what gives. In the meanwhile you can avoid that problem by using files with the same sample frequency.

    Also I'll add some actual error message boxes... :specialed:
     
  7. Felik

    Felik

    Member
    1,856
    82
    28
    You sir are my hero!
     
  8. Azu

    Azu

    I must be stupid. Member
    Would it be possible to add fade outs for the music?
     
  9. ValleyBell

    ValleyBell

    Tech Member
    246
    25
    28
    researching PC-98/X68000 sound drivers
    The MIDIs never faded, so I doubt that it would be possible without hacking the main executable.
     
  10. angryzor

    angryzor

    Member
    27
    0
    1
    S&KC HQ Music
    You're welcome :)

    Sure, no problem.
     
  11. Azu

    Azu

    I must be stupid. Member

    They sort of did. They would trail off when at boss song starts.
     
  12. Two requests:

    1. Talk to ValleyBell about adding support for the .vgm format. That will allow playing of the Genesis S3&K music, and anything from a laundry list of old Sega, SNK, and arcade systems.

    2. FLAC support—this one's personal.
     
  13. angryzor

    angryzor

    Member
    27
    0
    1
    S&KC HQ Music
    Updated to 1.3. It now supports FLAC, has fadeouts and better actual error reporting

    Couldn't get different sampling rates for intros and loops working, so I added an error message instead.

    I'll talk to Valleybell about that vgm format, but I'm gonna finish some college work first, as I've been slacking a bit on that matter...
     
  14. Spanner

    Spanner

    The Tool Member
    You know, is there any chance of being able to support custom sound effects in a later release? It's not that important, but if you're covering the BGM, you might as well look at covering the rest.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Sound Effects aren't handled by MIDIOUT.DLL, they're in SONIC3K.DS2 (deleting it mutes all sfx).
     
  16. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    Yes, SONIC3K.DS2 can literally be opened in Goldwave as a raw PCM file (8-bit, 22050Hz, mono). It contains all the sound effects in a row, without padding between eachother. The first 712 (decimal) bytes seem to be a header of some sort (then again, 169 * 4 = 676) but I admit I never tried to do more accurate researches over it.

    It would be neat to be able to use custom sound effects as well, if anything to replace the existing ones with higher quality versions.
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    It's actually fairly simple: the first four bytes is the number of sounds, each 4 bytes from there to (numSounds * 4) + 4 is the length in bytes of the sound effect. I wrote a quick exporter, and the sounds are all there, but I'll leave it to somebody else to make a WAV importer/exporter because I have no clue how to.
     
  18. Azu

    Azu

    I must be stupid. Member
    I was actually going to ask that. Actually. How are they named? Like "00, 01, 02" etc?
     
  19. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    Ah, thanks. Interesting: the first byte is 177, but there are only 169 (0 to 168) sound effects in the Sound Test menu, which is what was throwing me off:
    [​IMG]

    Since the format is this simple I might come up with a replacer... Too bad that the sample rate would still be 22050Hz, though. I guess it's hardcoded somewhere in the exe.
     
  20. Azu

    Azu

    I must be stupid. Member
    I did have an idea that worked well with Peggle. Peggle uses a compressed format (7x7) to store all it's files game data file inside a file called "main.pak". I extracted all the game data and place it inside Peggle's install folder. I was able to change how the pegs look and even the sound. Peggle was looking for the folders, so I guess why that worked. I don't know if this is the same deal with Sonic3k C.