A new update for Ray2Get
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.
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
A new update for Ray2Get
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.
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.
Re: A new update for Ray2Get
Nice! What an unexpected update.
Come and participate in the annual Favorite Rayman Game survey!
Signature made with love by R4Y_ANC3L
Signature made with love by R4Y_ANC3L
-
- 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
Python 2? Not 3?
Kidding, of course! This is great work, I can't wait to try it out!
Kidding, of course! This is great work, I can't wait to try it out!
Sig with Dora made by R4Y_ANC3L; others made by me
Android: How to block an image you don't like
It's good to learn from the past: read the Pirate-Community Documentary!
Other things you should know about this site
Re: A new update for Ray2Get
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?
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?
Re: A new update for Ray2Get
Yeah, that sucks, I know. I've been nitpicking over tiny details, but the lazy, quick-n-dirty way.PluMGMK wrote:Python 2? Not 3?
Re: A new update for Ray2Get
@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.
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.
Re: A new update for Ray2Get
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.
Re: A new update for Ray2Get
Now, on to play Rayman with Marilyn Manson in the background....
Re: A new update for Ray2Get
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.
https://drive.google.com/drive/folders/ ... sp=sharing
Feel free to share any rare media that's missing.
-
- Posts: 34053
- Joined: Sat Mar 24, 2018 6:15 am
- Location: The realm of Mario Karting
- Tings: 78205
Re: A new update for Ray2Get
Wow, this is great! Well done, Synthesis! I should try doing some experimenting with this sometime!
Always be true to yourself.
Sigs by Steo and R4Y_ANC3L
Sigs by Steo and R4Y_ANC3L