Uncompressed & Unfiltered Sonic 3 & Knuckles OST project.

Discussion in 'Engineering & Reverse Engineering' started by TrooperManiac, May 8, 2022.

  1. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    Please note that there is a slight background hiss coming from the synthesizer used to capture this music this is due to an internal interference, because the fact that its SUPER hard to get a hold of these types of devices with the YM2612 chip its likely I wont be able to ever get a capture of the music again. If anyone has a device that can play Midi OR .VGM files and contains the YM2612 chip and doesn't mind me borrowing it then please leave a comment and ill try to get back to you ASAP. I am SO close to recording the clearest tune of genesis games possible.

    This is a personal project I've been working on for years "to get the clearest most pure capture of Sonic 3&K music as possible" and I've finally done it. This feat was only possible thanks to the documentation here https://www.smspower.org/maxim/Documents/YM2612 and various other contributions across the internet. Basically I took an oscilloscope and recorded the individual sine waves to painstakingly manually generate a Midi file containing all the notes of each tune. This was played back on a DAFM synth which was recorded using Creative Sound Blaster Z SE 5.1 & Audacity @ 88200hz.

    What most people don't realize is that the music from the Sega Genesis "And Super Nintendo for that matter" is somewhat dithered because the hardware cannot produce the clearest sound, this leads to some notes either being muted out or blended with other tunes. This project was made to preserve the music as if you were hearing it straight from the studio itself, it does not get any clearer then this.

    High quality headphones required.



    I've garnered some interest in the retro hardware and emulation community and have been asked to do the original Sonic track. I don't think I really will because the absolute requirement of time dedicated to making this which is understated by the fact that I cant even talk about everything I did in order to do this "nothing Illegal I was just asked kindly yet firmly not to share my process for deconstructing Genesis music due to the fears of piracy from other more copywrite stringent games from important people..." and the hardware required to do it which doesn't belong to me. This is the reason why my video on Youtube is allowed to exist.

    With that being said it took about 4 and a half hours, here's the Sonic 1 Special stage OST in perfect clarity. https://vocaroo.com/18Ym618vb71h

    ~Edited on 6-11-22

    My new setup I'm able to record in much higher quality and now without hiss. This new method of recording is allot easier for me and faster. I'm going straight from oscilloscope to Digital over Optical. With my old recordings I wanted to preserve the Ladder effect the Genesis gives however I decided to record it unfiltered because I don't think many people have heard what the ACTUAL music sounds like. So some RGB mod people may know what im talking about but I discovered the Genesis does a decibel cut on all its audio for some reason. I think its to remove any background white noise and interference from the audio. Discovering this I disabled the decibel cut and laid sheets of ferrite over all that could induce static over the motherboard and it has netted some great results however its not particularly the safest thing to do.

    The new recordings can be found here but I will re upload a Youtube video as soon as I have time and all the recordings completed As a reminder the purpose of this project was to record the clearest most accurate music from S3K possible using original hardware.

    https://m.soundcloud.com/philip-mangione-1/tracks
     
    Last edited: Jun 27, 2022
    • Like Like x 7
    • Useful Useful x 3
    • List
  2. saxman

    saxman

    Oldbie Tech Member
    I don't have a device I'm willing to lend out. And I don't know if this helps you at all or not, but I wrote a program called YMX2SYX several years ago. I wrote up a post about it here:

    https://gendev.spritesmind.net/forum/viewtopic.php?t=2627

    While the OPN2 chip isn't used in those synthesizers, the OPP and OPZ chips are capable of reproducing many of the same sounds. If you're after an absolute purist-approach, then perhaps this isn't for you. But otherwise, you could use this in conjunction with one of these synthesizers to reproduce something that (in most cases) is pretty spot on.
     
  3. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,435
    301
    63
    ALWAYS Sonic the Fighters
  4. nineko

    nineko

    I am the Holy Cat Tech Member
    6,105
    341
    63
    italy
    This might be a stupid question, but, why didn't you use a tool like smps2mid?
     
  5. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    Sound accuracy.

    Ill check that out. That's much more reasonable then a $1000 80s synth of questionable life left.

    In a fan of carpathia808 who has a series called Oscilloscope Deconstructed. This is close to the purest form of getting the Genesis music however there is a caveat. What I learned is that the Genesis CPU acts as the Synth and plays FM sound through the Sound chip. This dithers the notes on the same and in some cases multiple channels. Its somewhat constructible by muting the channels but it will never be 100% spot on. Its still pretty close though. So what do I mean by dither? Imagine the note is being muted and unmuted very fast like a switch between 2 notes. This is happening at the CPU frequency so 1 MHz = 1000000 1/s. 7.6 is the "Genesis frequency" x 1000000 1/s = 7600000 1 Per Second. Basically its insanely fast "and to think that modern CPUs make it look like dirt. But the hardware is only so limited so even after the note is played you get degradation by wiring and other factors. My project was to strip all the extra steps out of the equation and make the sound byte go through as little hoops as possible to play.

    What makes this different then playing on a dedicated synth you ask? The genesis CPU is hardwired to dither it vs the option to do it in a dedi synth. PROBELM is that now you have to construct the whole score on different recordings and match the whole recording up because systematically the .VGM caters to the way the genesis does things and its just not plug and play anywhere else. It was just easier to compare the notes using a tuning tool then it was to purely play an Oscilloscope guesstimated tune and hope that its a perfect match to play on the original hardware without changing the actual tune.

    I know that probably raises more questions then answers and I'm not all that great at explaining things however I hope that was at least interesting. If I explained from start to finish everything needed to generate music the way I do it it would be a VERY VERY long conversation and pretty technical too. Lets just say this project got me interested in reverse engineering where's I was oblivious before also another interesting note is that I do not know proper coding so I use 3ds max maxscript to do the heavy lifting. You would be surprised how versatile that scripting language is.

    If anyone is interested in hearing what the audio would sound like passed though a modern sound card and not the Yamaha YM2612 that's quite limited here's some samples.
    Sonic 2 Boss https://vocaroo.com/15aE1kk1zRCY
    Hydrocity Act 1 https://vocaroo.com/152BJNmjMJPL

    I'm going to invest in some audio equipment to get rid of the hiss. I still have it throughout my devices and I think its originating on both the Synth and the sound card.
     
    Last edited by a moderator: May 11, 2022
  6. Gregster

    Gregster

    Oldbie
    45
    2
    8
    My thoughts on this...:
    tested on Audio-Technica ATH-AD700 w/AutoEQ; normal baseline are VGZ's played on Foobar2000 w/foo_gep @ 48KHz
    • mostly clear, but there is that hiss that you mentioned
    • superior stereo separation ... but the L and R audio channels are backwards
    • 'crispier' sound that is also harsh and 'electrical' - beginning of Angel Island Act 1 is very unpleasant in the R channel
    • seems to have more instrument voices playable at once (the Sonic 3 Credits sounds "fuller" on your recording) though I did not do this as an A-B randomized test so this could very well be placebo effect
    Ultimately I will be sticking with VGM/VGZ files for my YM2612 needs, but this was cool to test :)
     
    Last edited: May 11, 2022
  7. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    You had me thinking I just did a diagnostic on the power supply and I found out it's faulty. It's actually loosing voltage on channels 1 3 and DAC giving me a ladder effect sometimes.

    Because I'm stubborn I'm going to have to re-record this whole score now lol. But yeah I found another sound glitch on Icecap act 2 and on other on Mushroom Hill act 2....

    I'll have to ditch the Synth and buy a whole model 1 Genesis, I'll visit a pawn shop or a flea market this weekend hopefully before my new hardware comes in. I am going to take a crack at recording over optical this time.

    Lastly I have L&R backwards? I tested the channels on my Genesis through my TV and the stereo sound is coming through the same speakers.
     
  8. Mastered Realm

    Mastered Realm

    A green crystal Member
    It can get clearer than this. Dustin Odell has been making hardware recordings available for some years now and you can do some small mods to the console to get better sound quality. For example:

    Here's the prototype tracks recorded off a modded Genesis (MegaAMP) with an YM2612:


    Here's the prototype tracks recorded off a modded Genesis (MegaAMP) with an YM3438 instead:


    In addition to the L/R channels being swapped and the hiss issues:

    • the SEGA sound sounds incorrect (probably you recorded it from the Sound Test instead from the actual SEGA screen, which handles the sound differently)
    • there's timing issues on the Sonic 3 title screen theme
    • the very beginning (0.5-ish seconds) of most of the songs were truncated

    Anyway, even though you can get similar results just from recording the tunes of BlastEM (yep, their YM2612 emulation is that good!), I think putting effort on things like this is always appreciated, so, congratulations :)
     
    Last edited: May 12, 2022
    • Like Like x 2
    • Informative Informative x 1
    • List
  9. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    Imma have to deep dive in the L&R issue I'll take your word on that. I think the truncation issue is my fault. I probably forgot to save it in 32bit WAV format for YouTube. Also I have an older outdated Sony Vegas. I record the audio from a DAFM synth but it has no idea where the beginning or end of each song is. I have to guesstimate this part. Lastly I should have been more clear. I said it doesn't get clearer then this. I'm talking into regards of ripping it from original hardware not the revision or anything newer.
     
  10. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    OK Holey Christ you were onto something when you said something sounded off. I just bought a new model 1 on craigslist and immediately re-recorded using the new hardware and there is no more "hall??" effect. Seems that my old hardware was dying and I didn't notice it, I measured each pinout with varying levels of voltage and it never sagged. I'm excited to restart this whole project on Friday when my new Digital receiver arrives and I can finally record without hiss.

    Here's the new sample.
    https://vocaroo.com/1f0GnOOoxdFi
    https://drive.google.com/file/d/1DYBonpCpHhZJRr0dJduA4_IR_G1ukeXR/view?usp=sharing

    *Edit~ Someone just sent me a bunch of VERY USEFUL .VGM rips. This will make my life 9001% easier so thank you for that.
     
    Last edited: May 12, 2022
  11. Clownacy

    Clownacy

    Tech Member
    889
    177
    43
    If we're talking about accurate FM emulators, it shouldn't get any better than Nuked OPN2 which is based on a reverse-engineered die shot of a YM3438. It claims to be cycle-accurate to the real thing.
     
  12. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    I'll have to seriously check that out.
     
  13. Mentski

    Mentski

    Pff. Member
    211
    20
    18
    Parts Unknown
    Being a mysterious face.
    A lot of the sound quality issues of a Mega Drive 1 is all down to the mixing/amp circuit, and it varies hugely among the different VA models, and with age. Never had a "bad" YM2612, personally, so can only vouch for the above.

    Picked up a VA1 a year or so back, and it's known (for all early revisions up to VA2) for having a notably overdriven preamp compared to, say, a VA5/6 (the model with the best circuit, 6.5 was noticeably worse, and 7 is a MD2 in an MD1 case), so fitted one of FirebrandX's M1 Mini Mega amps which will provide a very clean line out direct from the 7 signals usually fed into the mixing circuit (YM L/R, MCD L/R/ 32x L/R, and PSG), uses some electrolytic Nichion caps on the output (rather than being entirely ceramic), and is MD1 specific...

    Apparently there are possible clipping issues using an original MegaAMP in an MD1 which Firebrand addressed in his board, as Ace's board was primarily designed to clean up the sound in an MD2, and the YM3438 on the ASIC has a slightly higher output level.

    Pretty sure Ace has upgraded the MegaAMP since so it might be more suitable for model 1's now, and the M1 Mini Mega is becoming hard to get hold of, so info above may be out of date.
     
  14. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    Im not 100% sure what the differences are between revisions of the Model 1 but I noticed that the new model I picked up says High Definition Graphics on the top where the old one was just blank and I have a Serial port on the back.
     
  15. Mentski

    Mentski

    Pff. Member
    211
    20
    18
    Parts Unknown
    Being a mysterious face.
    Most of the variations are down to discrete components slowly but surely getting integrated into custom silicon. The YM was one of the last survivors. The preamp changed from the VA4 model from a CA1034 to a CA1034p, the VA5 and 6 have identical PCBS with the only difference being the ASIC at location IC4 (which contains the TMSS "Produced by or under licence" splash screen on the 6)

    "High Definition Graphics" appeared on Genesis models up to VA6 (on Japanese models, the equivalent was the "AV Intelligent Terminal" text). A lot of people will tell you that if that it doesn't have that text it's a model with crappy sound, but the real answer is a bit more nuanced than that. Some non HDG models still have the "good" VA6 circuitry, some don't.

    What you really have to be eyeful for is the change in case design. Later model 1s have a different design for the coloured band surrounding the power LED. Early models it's printed (leaving a noticeable black ring around the LED), later it's a separate coloured plastic module. Once you get to model 1s with that newer case design, you're venturing into dangerous territory, and began with the interim revisions known colloquially as VA6.5 and VA6.8 (it's not mentioned on the board itself) where Sega began to cheap out a bit more on their components. 6.5 is the revision where they dropped the serial port (hence the new case) and 6.8 has a surface mounted video encoder, rather than a drop-through.

    This is where things (like the sound) can get a little muddy. Some people will tell you that the 6.5 and 6.8 will sound "just as good as the earlier models" due to having the discrete 2162, but this is the point where Sega are skimping on their components, which means the stuff in the mixing/preamp circuit is beginning to get a little hit and miss (possibly depending on manufacture location), and you're basically playing lucky dip, moreso 30-odd years down the line when the less-hardy capacitors they started using by then have begun to degrade.

    Sounds like you had a 6.5 or 6.8 initially.

    (The final revision, VA7 had the same integrated ASIC as a model 2 so had a YM3438 and the notably shitty preamp circuit, You'd have instantly known if you had one of those, if you were opening it up and probing pins.)

    Bottom line though: None of the Mixing/Preamp circuits in a model 1 with discrete YM are "perfect", and to get an output that is as close to perfect as possible at line level, you'd need to fit an M1 Mini Mega (or possibly a later revision of MegaAMP)
     
    Last edited: May 13, 2022
    • Like Like x 1
    • Informative Informative x 1
    • List
  16. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    this is the greatest news to come home to after work with almost $800 worth of sound equipment somewhere in the concrete jungle
    [​IMG]
     
  17. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    I did my first recording with the new sound equipment. Hiss is completely gone however I'm still learning how to use the new equipment so ill count this recording as a Demo I have to do more comparisons with the notes to ensure I'm not getting processing effects but I believe I may not be.
    https://soundcloud.com/philip-mangi...d&utm_medium=text&utm_campaign=social_sharing

    https://soundcloud.com/philip-mangi...d&utm_medium=text&utm_campaign=social_sharing

    Side note, I noticed my new model Sega has the YM3438 however its pretty much working the same as my old one. I don't see a difference really not even watching the wave forms except maybe its got a little bit more gain.
     
    Last edited: May 18, 2022
    • Like Like x 1
    • Useful Useful x 1
    • List
  18. Mastered Realm

    Mastered Realm

    A green crystal Member
    That is impossible. They fixed the crossover distortion in the YM3438 and it changes how quiet sounds behave.
    Here's a comparison using the cycle-accurate Nuked OPN emulator.
     
  19. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    you are correct. I didn't notice it at first but they are vastly different after doing a few songs I started to really notice the difference after Marble Garden zone act 2 where there is allot of high, low, and mid sections of the song that play sharp notes. Its defiantly different and I didn't expect that.
    https://vocaroo.com/141TIbOZLhlh

    Side note is that I'm recording so clearly now you can see the individual bands to each note in the Spectrogram
    [​IMG]
     
  20. TrooperManiac

    TrooperManiac

    Member
    23
    22
    3
    I believe I have perfected the recording process now. Thanks to many people here I am able to finally get to complete this project. I have the completed recordings on Sound Cloud however I will be remaking a Youtube video as soon as all tracks are completed.

    https://soundcloud.com/philip-mangione-1
     
    • Like Like x 4
    • Informative Informative x 1
    • List