Sonic 2 music editing

Discussion in 'Discussion and Q&A Archive' started by Pocket, Mar 25, 2014.

Thread Status:
Not open for further replies.
  1. Pocket

    Pocket Newcomer Trialist

    Joined:
    Feb 5, 2014
    Messages:
    3
    I'm working on a sonic 2 hack that has some stuff, but the only thing I need help with is editing the music. Everything else I'm ok with. I really need some help with it.

    /monthly_03_2014/post-2925-0-39692300-1395715983_thumb.jpg

    /monthly_03_2014/post-2925-0-19073000-1395716003_thumb.jpg
     

    Attached Files:

  2. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    Could you be a little bit more specific? saying just to edit the music without saying exactly how could confuse someone. do you mean editing the pitch, tempo, porting songs over? Well In any case seeing as you don't know how to do this, may want to go to retro and look in the Wiki section for things like this. it's not hard at all figuring this stuff out.
     
    Last edited by a moderator: Mar 25, 2014
  3. Pocket

    Pocket Newcomer Trialist

    Joined:
    Feb 5, 2014
    Messages:
    3
    I just need to be able to port different music in the the levels.
     
  4. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    This is why this place is so...well you fill in the blank.

    Go port the Sonic 1 Driver over. And for God's sake, learn some assembly before you ask questions. Learn the basics and then port the driver. If you don't want to learn and just expect things to happen or get step by step instructions, then you're really in the wrong place. We promote creativity, not laziness. Go read Retro's assembly guide, and then sound driver porting guide.
     
  5. Flamewing

    Flamewing Elite Hacker Member

    Joined:
    Aug 28, 2011
    Messages:
    37
    Location:
    France
    Oh, for f***s sake, not the 'port the S1 driver' crap again; using it in S2 is begging for lag. Swapping to the S3&K driver would be better, because you don't make the game slower for it.

    Not to mention that it doesn't help at all with his clarification of the question: if you just want to edit which song gets played in each zone, you just need to edit the music list that associates a song with each zone — I am posting from my phone, so I can't give the name easily; but it is referenced near the Level label, near a LevelBGM label (or something close to this).
     
  6. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Flamewing beat me to it, and I couldn't have said it better, but I feel like posting anyway. Stop giving newbies the harmful advice to use the Sonic 1 driver. Sure it's simpler to use, but at what cost? Z80 banks never killed anyone, and if the Sonic 2 driver isn't perfect (even if the compression can be disabled, but that's another story) there's always the Sonic 3 & Knuckles option, as mentioned right above.
     
  7. Flamewing

    Flamewing Elite Hacker Member

    Joined:
    Aug 28, 2011
    Messages:
    37
    Location:
    France
    Now that I am home and at my computer, here is the correct reply: the actual label was Level_GetBgm, and the tables you want to look for are MusicList and MusicList2. You just change the IDs of the musics in these lists to change which music plays in each zone.
     
  8. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    [​IMG]

    Well done, sir, you are the only person in this thread who's actually taking this on board appropriately, without going off topic, and without bashing anyone. You deserve a thumbs up!

    I think a scientific approach is in order here.

    I took the liberty of performing a "Processing Time" test, by using the remaining cycle time as a base, adding the cycles used by the instructions that check for V-blank to occur (Since V-blank is the timing mechanism used for the games).

    Here is a standard frame ROM: Download. On a standard frame with almost nothing going on, the CPU stands to performing approximately 1F000 cycles for NTSC, and approximately 25000 cycles for PAL (I say approximately because the instructions for displaying the cycle time on screen have not been accounted for, however, you are looking at probably 100 - 200 more if that were removed.

    Here is Sonic 1 as stock: Download. Debug mode is enabled by default, and the coordinate values in the top left screen have been swapped with remaining cycle time values. The top is the current cycle time of the last frame, the bottom is the average cycle time based on the last 10 (hex) frames. An average counter has been added to this one because of the frequent small (but sudden) changes in processing time during the game.

    Here is Sonic 1 as stock, but with the Sound driver not running at all: Download. Now, you'll notice the remaining cycle time has increased, but interestingly enough, it has only increased by approximately 1000 cycles. Meaning, the sound driver's processing time takes roughly 1000 cycles.

    To summerise, the sound driver takes 3.2% of the total processing time allowed in a frame for NTSC, and takes 2.7% of the total processing time allowed in a frame for PAL.

    ---

    tl,dr; you two are completely overreacting, and being somewhat bias. A little research wouldn't have hurt, nor would being a little polite about the situation. I'm surprised at you especially Nineko, you were in the last thread where I pointer out the loss of processing time isn't as much as most people assume, clearly, you didn't pay attention to anything I posted before hand.

    I don't discourage using the Sonic 3 & Knuckles sound driver, I do think it is a good idea, but I think the way you guys are trying to promote it is completely bad form. If you had said something on the lines of "using the Sonic 3 & Knuckles sound driver would save you 600 bytes of RAM space" or "The Sonic 3 & Knuckles sound driver is compact and seperated from the main CPU, making interrupting the music less likely", then I'd say that'd be a completely reasonable enough excuse. But no, you used the one excuse you know very little about and tried to promote the driver based on that one and only reason.

    I know you've done a lot of work to make the Sonic 3 & Knuckls sound driver easy to use flamewing, so much so that even now people refer to the driver as "flamewing's driver", but you (as well as Irixion) won't progress very well by telling people what they can and cannot use in their projects. That's like me coming into your house and telling you how to use your TV, you just don't do that. Recommend sure, but don't stuff it down their necks, geez.

    I recommend having a look here. There's a lot of information about the sound driver you're using and how to port music in general.
     
  9. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    As always, I highly respect what you say, you know I consider you one of the best people around here, and I really like how you took the time to perform those tests. Personally, though, I still think 3% isn't low enough to be labeled as negligible, especially while we're trying to reach for optimity in as many other routines as possible, which leads us to the Sonic 3 Object Manager being ported by some people, or SpirituInsanum optimising the collapsing platform, and so on. Some of those optimisations are even more negligible, but they're still nice to have. I am not trying to enforce the Sonic 3 & Knuckles driver to everyone; but as I said the last time, I don't like that newcomers are being told only a partial truth ("use this and don't ask why"), with this exagerate bias towards the Sonic 1 driver, it kinda reminds me of what Microsoft does with Internet Explorer. Now that your post above finally sets some numbers in stone I hope both sides (pro Sonic 1 and against Sonic 1) can finally start being more objective when someone seeks for advice. If you notice, I am polite by default, I only tend to react when I see something unfair; in those cases, I react accordingly. "Go port the Sonic 1 driver" without any rationale around it triggered me, and I assume the same applies to Flamewing as well.
     
    Last edited by a moderator: Mar 26, 2014
  10. Flamewing

    Flamewing Elite Hacker Member

    Joined:
    Aug 28, 2011
    Messages:
    37
    Location:
    France
    Nineko is partially correct about my motivation -- Irixion flat out instructs him to port the S1 driver over without bothering to try to see what exactly was wanted (his post came one hour after Pocket's clarification, so there was ample time to see that), and the advice given was completely useless for the problem. So it is a twofer.

    It is good to have some hard numbers on the effect of the S1 sound driver in terms of processor usage; and it is interesting to watch those average cycle counters roll by as you move about the level. You left me curious as to what are the average remaining cycles in S2 and in S3&K, given that they also need to handle Tails (and that S3&K has many engine improvements).

    But I dispute that 3.2%/2.7% is small -- the $600 bytes saved by using S2 or S3&K drivers amount to about 2.3% of total RAM, and not only you don't discount that as being negligible, but you tout it as a good reason for using those other drivers. And yes, I know that there is far less free RAM (in %) in general than there are free cycles (in %) in general, but the worse case usage of processing power can exceed one frame with ease, and it happens in many places on S1 and S2.
     
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I don't remember the exact steps, but I have had success with porting Sonic 1 music to Sonic 2 using Flamewing's SMPS2ASM and a Saxman compressor such as KensSharp. Of course, that was just replacing a track, I'm not too sure about adding music.
     
  12. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Noooooooo, I'm redhotsonic!  Change your character into a different colour!  I have copyright documents over making him red (I wish).
     
  13. Pocket

    Pocket Newcomer Trialist

    Joined:
    Feb 5, 2014
    Messages:
    3
    I'll just change it to green then
     
  14. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    He was only Joking you know. you don't have to feel all intimidated if you originally wanted it like that. also seeing as others have already suggested using the S3&K Sound driver, I would say trying to use the S2 Clone driver seeing as it more flexible in porting music over since it's based off the sonic 1 sound driver but as iv'e seen it only works for the HG disassembly of sonic 2. of course thats up to you, just a suggestion from me.
     
  15. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    You do realise that the pompously labeled "Clone Driver" *is* nothing else but the Sonic 1 driver itself, right? The only added bonus is that the package it comes with already has all the Sonic 2 songs converted to the Sonic 1 format, but that's about it, really. At least, afaik. Since he plans to port new songs into his hack anyway, using the "Sonic 1 Driver" or the "Oh My God I Am Having An Orgasm Clone Driver" is virtually the same thing from his point of view.
     
    Last edited by a moderator: Mar 28, 2014
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I'd imagine that converting music from Sonic 1 format to Sonic 2 format is much less difficult than replacing the entire sound driver, and reprogramming the game to use it.
     
Thread Status:
Not open for further replies.