A new update for Ray2Get

Discuss tools to aid in the modification and running of Rayman games.

Moderators: English moderators, Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Post Reply
Synthesis
Barbara
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

A new update for Ray2Get

Post by Synthesis »

Ten years later (well... more like, ten years too late, amirite?) I'm back with a major update for Ray2Get.

About a month ago, deton24 suggested me to dig around and try to find a way to improve the game's audio engine. Turns out it didn't work; but in the process, I noticed that some stuff in my old and rusty music-decoding tool needed improvement. And I was like "hell no, there's no way I'm gonna do all that crazy time-consuming stuff for just tiny little details"...

Yet.
After what unexpectedly turned out to be a whole month of delving into technical details and experimenting with the game, I'm releasing this new version which allows you to convert the musics from the game to regular .wav... and back!

This means you can now put your own music into the game!... provided you know how to split your files and what their names should be. Fortunately, I provided a text file which lists all the sequences of .apm files that are played throughout the game at every location (yes, I've spent quite some time replaying the sh** out of Rayman 2 to figure all that out in every bit of the game).

This new version fixes the artifacts I noticed (see my previous post)—actually, you can choose between standard IMA ADPCM (in which the original music files provided with the game were encoded anyway) and a slightly modified version to prevent the artifacts—, and supports more .wav formats (8, 16, 24 and 32-bit integer, mono and stereo, any sample rate).

The code has been rewritten almost from scratch (it started as a custom encoder which I eventually merged with the original ray2get), in Python for convenience (it's cross-platform and doesn't require to recompile after every minor tweak), so you should have a working Python 2.x/3.x environment installed on your machine if you want to use the script.


I've set up a GitHub repository with the code, some documentation including a how-to guide, an .apm format description (gathered from my current knowledge), and the list of all the sequences played during the game, and it's available here:

https://github.com/Synthesis/ray2get


Have fun hacking around.
Now I can retire peacefully.
Last edited by Synthesis on Mon May 14, 2018 7:12 pm, edited 1 time in total.
Fifo
Joe
Posts: 9531
Joined: Thu Sep 19, 2013 7:08 pm
Location: rm –rf /*
Tings: 78355

Re: A new update for Ray2Get

Post by Fifo »

Nice! What an unexpected update.
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: A new update for Ray2Get

Post by PluMGMK »

Python 2? Not 3? :tssk:

Kidding, of course! This is great work, I can't wait to try it out! :D
Droolie
Mr Sax
Posts: 5162
Joined: Wed Apr 20, 2005 7:31 pm
Tings: 61830

Re: A new update for Ray2Get

Post by Droolie »

Very cool! And thank you so much for putting the code and documentation online!
I haven't had the time to look at it yet, but I do have a quick question to see if I understood correctly:

The music files provided with Rayman 2 were encoded with standard IMA ADPCM and the old Ray2Get used standard IMA ADPCM to decode them, so it didn't introduce artifacts. However, the game itself does have artifacts when playing back, because it doesn't implement the algorithm properly -- and you implemented Rayman 2's incorrect version purely so that new files play properly in Rayman 2, but this isn't necessary for any of the old files. Am I correct?
Synthesis
Barbara
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis »

PluMGMK wrote:Python 2? Not 3? :tssk:
Yeah, that sucks, I know. I've been nitpicking over tiny details, but the lazy, quick-n-dirty way. :oops:
Synthesis
Barbara
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis »

@Droolie: Yes, you're right.

In fact, I noticed this when I was trying to replace the in-game musics with my own, to see if the game could handle 44100Hz audio.
When recording the game's audio, I noticed a DC offset slowly building up on some of my files. I initially thought that it was due to downsampling, but the problem was the same at 22k.
So I dove into the Rayman2 executable and found that tiny difference in the code, which I thought was intended.
But when decoding some of the leftover files (especially "Jail20 bruitages.apm") with the "fixed" version, I noticed the same DC offset. Which made me think that it's actually Rayman 2's DLL that is slightly buggy.

So eventually I chose to implement both and let the user choose the one they want.
Synthesis
Barbara
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis »

Alright everyone, small update: I fixed a minor bug or two (incorrect automatic output file name when using the 'ei' option, no .apm format check); and the script should now work with Python 3 as well.
incognito
Électoon
Posts: 15619
Joined: Wed Oct 02, 2013 10:34 am
Tings: 0

Re: A new update for Ray2Get

Post by incognito »

Now, on to play Rayman with Marilyn Manson in the background.... :lol:
Greeness
Aurora
Posts: 976
Joined: Tue May 17, 2016 9:39 pm
Contact:
Tings: 17030

Re: A new update for Ray2Get

Post by Greeness »

Nice! I think it would be interesting to try and replace some music from the game with tracks from the N64 version, so for example maybe the first phase of the final boss fight could play the N64 version of the final boss theme and then the second phase would use the normal track.
Rare Rayman images Drive folder:
https://drive.google.com/drive/folders/ ... sp=sharing
Feel free to share any rare media that's missing.
The Jonster
Joe
Posts: 34053
Joined: Sat Mar 24, 2018 6:15 am
Location: The realm of Mario Karting
Tings: 78205

Re: A new update for Ray2Get

Post by The Jonster »

Wow, this is great! Well done, Synthesis! I should try doing some experimenting with this sometime! :)
Always be true to yourself.
Image
Sigs by Steo and R4Y_ANC3L
Post Reply