don't click here

The "REAL" Sonic 2 HD Sound Engine

Discussion in 'Fangaming Discussion' started by saxman, Jul 6, 2012.

  1. saxman

    saxman

    Oldbie Tech Member
    As some of you are aware, my sound engine wasn't used in S2HD because our lead programmer supposedly could not get it working. It doesn't deserve to sit and go to waste, not after all the work I put into it. It's a good, solid library that I would love to see be adopted by other C/C++ based games.

    Today, I decided to go ahead and test the waters with a small demonstration of the engine to show that it works.

    http://www.4shared.com/zip/76veUOy0/SonicAmpExampleApp.html

    Check out the readme file for instructions on how to use the example application. The major features are as follows:

    - Support for VGM, VGZ, GYM, OGG, and WAV files
    - YM2612 (FM) and SN76489 (PSG) synthesis
    - Use driver with any number of channels up to 127
    - Compression algorithms to allow more headroom for other sounds
    - Flexible volume and panning controls
    - Pitch and tempo controls
    - Load and unload only sound data that is needed

    If you're writing a program in C or C++ and would like to use the library in your program, let me know! I'm offering the library on a limited release basis. If there's enough demand for it, I'll do a general public release, but otherwise I'll keep the release more constrained for the time being.
     
  2. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    Very noice.

    Out of curiosity, are we talking tempo/pitch effects on just vgms, or full audio too? I'd love to see a sample with it using them on that EHZedit ogg. I take it it supports loop points within the ogg/wav too?
     
  3. Mastered Realm

    Mastered Realm

    Member
    3,831
    558
    93
    -
    You forgot sound upsampling :P
     
  4. dsrb

    dsrb

    Member
    3,149
    0
    16
    Oh you ;)
     
  5. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,373
    81
    28
    HoleNet!
    Sonic Worlds Next
    Impressive! This would actually be really interesting to try and make a MMF2 extension with, but I don't know enough about making extensions to take a crack at doing it myself. I know at least one person who would kill for it to happen, though.
     
  6. saxman

    saxman

    Oldbie Tech Member
    Only VGM and GYM support this. Originally, we wanted to do it for PCM too. However, performance issues were a real problem in testing, so I didn't implement that feature for PCM. You are correct about looping though. A loop marker can be used for PCM.


    I didn't forget. But you're right, it does this.


    That's a great idea! I don't know anything about making those extensions other than Visual C++ is used, but if someone wants to attempt this, I'll support that inititive.
     
  7. Falk

    Falk

    Member
    1,570
    15
    18
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=167139

    Someone's semi-gotten fmod working, so it's not impossible at all to plug an audio engine into MMF2 as an extension. The forum's a great resource on getting started on extensions.
     
  8. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    11
    18
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    I'm thoroughly interested in this and would like to use the library.
     
  9. Flipside

    Flipside

    Member
    33
    0
    0
    127 Channels... NICE! Does it also support FLAC or some other lossless music types suggested? Can you make it alternate between playing the ring sound on the left and right side?

    I would try downloading it, but I don't want to sign up for a new website or make iLivid my home page.

    I might just be stubborn about it, but not all hope is LOst for S2HD yet... I'd love to see a sound engine like this I could use in C++ if I could get it working! :)
     
  10. saxman

    saxman

    Oldbie Tech Member
    Only OGG is supported in terms of lossless music. You can pan the audio to one side or the other, allowing the ring to chime like it does in the games.

    There is no sign-up required for 4shared.com. It's free. You also don't have to change your home page. I have downloaded stuff for years from 4shared.com. Trust me, it's safe =)
     
  11. Harmony Friends

    Harmony Friends

    it's the whole gang Oldbie
    I'm the programmer and co-designer of a game called Here Comes Launchman.

    We've just been using SDL for our sound and it's honestly garbage, all the other libraries are expensive as fuck to use commercially (e.g. fmod), proper looping support is something we need, SDL has so few sound channels that often times sound effects in the game get pre-empted, and flexible panning for directional sound is a massive perk too.

    So yeah, I'm extremely interested in this!
     
  12. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,373
    81
    28
    HoleNet!
    Sonic Worlds Next
    Are you sure? I think they changed that recently. Log out from 4shared and try to download your file from the link you provided. You'll be stopped by a page that says "You should Sign Up or Login to download this file".
    I'm going to make a mirror for it here (be gentle, please!) so those that do not want to sign up for 4shared can download the file. I WAS going to use MediaFire to make a mirror, but they got rid of anonymous uploading...
     
  13. steveswede

    steveswede

    Member
    5,032
    1
    16
    Ask my hand
    Fighting against the Unitary State of Europe
    @Techokami

    Thanks for the other link.

    @Saxman

    This is really sweet what you have done though I really think you could expand on it more to make it the sound engine to go to, like build a mini DAW into it so us none programmers can make some tunes.
     
  14. Flipside

    Flipside

    Member
    33
    0
    0
    This is ridiculously awesome, saxman! Thanks for the mirror, Techokami.

    That music was great. especially loved that 4th song.

    Only problem I have with it is when you click outside of the window, the music repeats the 2 notes it's on til' you click on the window again. I'm not sure this would be a problem in a game engine though.
     
  15. Foxeh

    Foxeh

    Animator Member
    43
    17
    8
    In the Walls
    Sonic AGES and Writing a documentation for Realms
    I believe that whole bit depends if you allow your app/game to continue playing when it's in the background.


    I'd really love to learn to slap this into Unity3d, mainly for the "point A to point B" loops (I really don't know the proper term for this) unfortunately, I don't know if Unity already has something built in for it. Either way, it would be fun to just learn how this was put together!


    "Gapless looping (Android/iOS only) Use this when compressing a seamless looping audio source file (in a non-compressed PCM format) to ensure perfect continuity is preserved at the seam. Standard MPEG encoders introduce a short silence at the loop point, which will be audible as a brief "click" or "pop"." ....... never mind...

    actually, just to learn to incorporate this into any game engine would just be dandy to know! So I'm all in for trying to make this work because I'd love to use it!

    I'll just ask you at a later time when I'm ready to use it
     
  16. Flipside

    Flipside

    Member
    33
    0
    0
    It's been a while since Sonic 2 HD has been cancled... Saxman, is there any chance of you making a s2hd engine, or maybe Sonic CD with s2hd music or something?

    That would be awesome. :)
     
  17. Why on earth would he release Sonic CD with S2HD music? It's a licensed game that he's paid for by SEGA, and even if it was something like a new version with the music optional, it would be a legal nightmare due to needing to pay each of the people who made each remastered/remixed track for their permission to use it in a paid-for licensed game, wouldn't it?

    As for the engine, a collaborative effort with I don't recall how many people fell apart. Do you really think that the engine as it is now, if it's still intact on any of the developers' computers, would be much use for anybody? Maybe if they decided to restart the entire project and picked out the code that was screwing it up the first time, but I doubt it. The thing's beyond dead.
     
  18. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Saxman wasn't paid by Sega to do anything. You're thinking of Taxman.
     
  19. Oops. My bad. Sorry.