don't click here

S&K sound $CC

Discussion in 'Engineering & Reverse Engineering' started by Hayate, Dec 21, 2009.

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

    Hayate

    Tech Member
    I don't know about you, but to me it sounds like it's in two parts: "part A" which doesn't loop and "part B" which does. Now, Varion Icaria (or whatever his name is these days) helped me port it to S1, and I wanted to separate these parts out into two separate sound effects. But try as I might, it won't budge.

    For reference, here's the data represented as ASM (with pointers fixed for the S1 sound driver and an unsupported coordination flag, $FCxxxx, removed):

    Code (ASM):
    1.  
    2. _skCC:
    3.     dc.w    _skCC_voices-_skCC
    4.     dc.w    $0102   ; Channel setup
    5.     dc.w    $8002   ; "PSG" parameters
    6.     dc.w    _skCC_PSG1-_skCC
    7.     dc.w    $0006   ; "PSG" parameters
    8.     dc.w    $8004   ; FM parameters
    9.     dc.w    _skCC_FM1-_skCC
    10.     dc.w    $0006   ; FM parameters
    11.  
    12. _skCC_PSG1:
    13.     dc.b    $85, $03, $81, $07, $8A, $0A, $90, $07
    14.  
    15. _skCC_FM1:
    16.     dc.b    $EF, $00, $89, $08, $8B, $08, $F2
    17.  
    18. _skCC_voices:
    19.     dc.b    $FA
    20.     dc.l    $11311330, $0A0F1F1F, $05180902, $060F0602, $0F074F2F, $070E0E80
    21.  
    Now there are lots of weird things about this sound effect. The first is that in S&K, in LRZ where you meet the robot that breaks the ground and plays this effect, part A plays once, then there's a pause, then the effect plays normally (I.e. how it would in the sound test). I have basically been trying to replicate this A-silence-A-B effect, but haven't succeeded. In S1, playing this while there's music playing (namely, Marble Zone's music) sometimes skips part A, and there doesn't really seem to be a pattern to it.

    The next weird thing is that there is apparently a PSG channel - but no PSG sound is produced. Also, there's no $F2 in the "PSG" data. The sound as it's written above actually plays an extra part A after it finishes looping, so I changed the $8A to an $F2 (basically truncating the "PSG" data to 4 bytes), which resolved this problem (though I have no idea how S&K plays it properly with this data).

    There's also two notes played by the FM channel; $89 and $8B, both with duration $08. I tried changing this to a single note (of either value) but there's no noticeable change.

    Changing the duration of the note doesn't seem to do much. However, if the "PSG" channel is completely removed (by changing the channel setup to $0101 and removing the next 6 bytes), the effect gets a lot shorter - but /still/ plays both part A and part B, though the looping no longer works.

    Because of all the above, I have a hunch that the "PSG" data is actually some form of metadata used to make the looping work, but there aren't any coordination flags in it.

    I've also tried placing the $E7 no-attack coordination flag before the PSG data, the FM data (after the EF00, that is) or both, but this only seems to screw up the sound and still doesn't get rid of part A.

    Is there anyone around who actually understands the sound-effect-specific parts of the sound driver and can help with this?
     
  2. Varion Icaria

    Varion Icaria

    He's waiting.... Tech Member
    1,019
    11
    18
    S4: Cybernetic Outbreak
    Well if the PSG is indeed metadata then the coordination flag FC that used to be there is what triggers it aswell as tells where to loop from. As for splitting I'm not fully sure what I can do to help with that. Porting the effect was easy enough though :P.
     
Thread Status:
Not open for further replies.