[Tutorial] Porting SMPS songs with an AMPS-like format

Discussion in 'Tutorials' started by yami, Jun 27, 2022.

  1. yami

    yami the homing attack addict Member

    Sep 24, 2020
    29yami’s Basic SMPS Porting Guide (Crossposted from MDDC)
    With MD Music Player, SMPS Research Pack v5, and SMPSPlay.
    It also helps to read the documentation for AMPS, specifically Section 11.1

    I’m gonna be porting a song from the Treasure (Dynamite Headdy) sound driver to Sonic 1’s sound driver which won’t be that hard, because both drivers are on the 68k, and not on the Z80 like Sonic 3 and Knuckles, or (for example) The Hybrid Front.

    Step 1: Finding your music and/or necessary info.
    What I do when I’m trying to port music is find a game’s music folder in SMPSPlay, and then listen to the music from the application, then once you find a song you like, note down the song's filename and copy it. I’m gonna be using Bishoujo Senshi Sailor Moon’s Unused song (Sound Test 04), which is also going to be in my Sonic 1 hack. The filename is “04 Unused.tra”

    Usually, in the SMPS Research Pack, the SMPS type is signified by its extension, like how Sonic 1’s specific SMPS music has the .smp extension, or how Sonic 3 and Knuckles’ music has the .s3k extension. However, the other SMPS types use a different naming system corresponding to their driver type, which are:

    Step 2: Converting the song to assembly.
    Now open your MDMusicPlayer folder, and paste the music file in the “music” folder. Now inside the “bin” folder, open the exe called “smps2asm.exe”. This will open a window where you’ll see 3 bars that say:
    What you want to do here, is in the filename window, copy and paste the filename with the extension into the top bar. Mine is “04 Unused.tra” Next, you’re going to have to type the name of the driver that the music is from. Since mine uses the Treasure driver, I’d choose DyHe. However, when porting other songs, make sure to read the “DefDrv.txt” in the corresponding folder from the SMPS Research Pack. Now, you need to come up with a project name. It could be anything, as long as it doesn’t start with a digit and only contains alphanumeric characters.

    After you’re done setting the stuff up, press enter, and then you should see some lines that say something along the lines of:
    If not, that most likely means that you did something wrong, and should check your name/file setup. Make sure that the Music/Sound Driver is called for correctly in the program, as I had that issue a few times when I was going through with this process at an earlier time.

    Step 3: Including the song in an MD Music Player ROM.
    After converting a song, I like to make sure it’s included in the MD Music Player files so that I can listen to it, and make sure that it sounds about right to how I want it to sound.

    You can do this, by modifying the names in the “music.asm” file to be something like:
    Mine for the example song looks like:
    If I remember correctly, up to 28 characters can show on one line in the unmodified MDMusicPlayer ROM, so be careful about the number of characters you use if you want them all to show correctly.

    Step 4: Tweaking the song through code.
    One of the first things you’ll notice is that when you go to build the song, there will be some errors about the DAC channel. This is common since the drum samples are not guaranteed to be the same between each game.

    If you’re curious about the DAC samples from the MD Sonic games, Sonic Retro has a table that has the DAC Sample info for them.

    My process for the example song would be:
    That’s it for DAC editing because the song only uses those samples (which safely use Sonic 1’s DAC without having to add new ones)

    Now, you’ll also notice that you get an error about there not being an “m02” which is a PSG modulation envelope. If you want to port those, by all means, go ahead but I don’t know how to port those yet. What I did on my port was replace the 02 with a 00, effectively getting rid of the check for the modulation envelope.

    The last thing is to pitch down the PSG an octave for the correct sound. Some hacks did this, and some didn’t. However, this is very simple. Just add an “-$0C” (0C is 12 in hex) after the first numbers.

    It should look something like this:

    That’s it! Your song should be done!
    It should sound like this, of course with the DAC samples of your choice instead of the Cosmic Carnage ones that I used.

    If you know anything else, please feel free to share your knowledge!
    This might also go hand in hand with MDDC's FM Voices/Instruments thread!
    Last edited: Jun 27, 2022