Hello, I'm new here, and though I've been lurking here for a long time, I decided to join after I saw Felik's post in ValleyBell's S&K MIDI tool thread:
This seemed like a fun quick hack and the only alternative was college work, so I gave it a try.
Thus, I present to you my Sonic 3 & Knuckles Collection (PC) HQ Audio hack.
It allows you to replace any of the built-in MIDI music tracks with your own custom file in the MP3/OGG/MP2/MP1/AIFF/XM/MOD/IT/S3M/UMX/MTM or any format supported by vgmstream (see below). Any tracks you don't specify just fall back to the standard MIDI track. It basically just emulates the standard MIDI engine, but plays your HQ files instead.
It also scales up the tempo of your music during speed mode and special stages.
Download link: http://www.mediafire.com/?eabcdhbhza6ozan
Quick video demo: http://www.youtube.com/watch?v=DJcw0hJzzfs
bass_vgmstream (for developers, in case anyone wants to use vgmstream in BASS): http://www.mediafire.com/?b5lhg1nvd5g4b61
Some technical data for anyone who might be interested:
A custom MIDIOUT.DLL dll should expose a C function GetMidiInterface that takes no parameters.
It should return a pointer to a MidiInterfaceClass:
virtual bool initialize(HWND hwnd) = 0; // hwnd = game window
virtual bool load_song(unsigned char id, unsigned int bgmmode) = 0; // id = song to be played + 1 (well, +1 compared to the sound test id, it's the ID of the song in the MIDIOUT.DLL's resources); bgmmode = 0 for FM synth, 1 for General MIDI
virtual bool play_song() = 0;
virtual bool stop_song() = 0;
virtual bool pause_song() = 0;
virtual bool unpause_song() = 0;
virtual bool set_song_tempo(unsigned int pct) = 0; // pct = percentage of delay between beats the song should be set to. lower = faster tempo
Just derive from that class and overwrite the virtual methods. The game doesn't notify you when the user closes it, which may cause a problem. I hooked WM_DESTROY to mitigate that.
- Added support for FLAC
- Added fade-outs
- Added error messages
- Added config options: "FadeOutDuration" & "ShowErrorMessages"
v1.2 (not a critical upgrade, just more formats and bloat):
- Now using vgmstream to play a large number of game music formats: 2dx, aax, acm, adpcm, aix, adp, ads, adx, afc, ahx, aifc, agsc, amts, as4, asd, asf, ast, asr, ass, aud, aus, baka, bh2pcm, bg00, bgw, bmdx, brstm, brstmspm, ccc, cfn, cnk, dcs, de2, dsp, dtk, dvi, dxh, eam, emff, enth, fag, filp, fsb, gbts, gca, gcm, gcw, genh, gms, gsb, hgc1, hps, hwas, idvi, idsp, ikm, ild, int, lps, isd, ivaud, ivb, joe, kces, kcey, kraw, leg, lwav, logg, matx, mcg, msvp, mwv, mi4, mib, mic, mihb, mpdsp, mus, musc, musx, mss, ndp, npsf, nwa, omu, p2bt, pcm, pnb, pos, psh, psw, raw, rkv, rnd, rrds, rsd, rsf, rstm, rwar, rwav, rws, rwsd, rwx, rxw, sad, sap, sd9, sdt, seg, sfl, sfs, sl3, sli, smp, snd, sng, spd, sps, spsd, spw, ss2, ss3, ss7, stma, str, strm, sts, ssm, svag, svs, swav, swd, tec, thp, tk5, tydsp, um3, vag, vas, vb, vig, vgs, vpk, vs, vsf, waa, wac, wad, wam, wavm, wii, wp2, wsd, wsi, wvs, xa, xa2, xa30, xmu, xsf, xss, xvas, xwav, xwb, ydsp, ymf, zsd & zwdsp
- Added "IgnorePauseCommands" config option
- Using static linking for the VC++ runtime now. This should avoid problems where people do not have the MSVC++ 2010 runtime installed (msvcr100.dll) as it is built into the program.
- General support for looping tracks
- Fixed a bug where an event track would loop like normal music
- Fixed a bug where tracks did not report to the game that they have finished playing and need the music to kick back in