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):

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">&nbsp;
    _skCC:
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> _skCC_voices-_skCC
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">0102</span></span> <span style="color: #adadad; font-style: italic;">; Channel setup</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">8002</span></span> <span style="color: #adadad; font-style: italic;">; "PSG" parameters</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> _skCC_PSG1-_skCC
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">0006</span></span> <span style="color: #adadad; font-style: italic;">; "PSG" parameters</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">8004</span></span> <span style="color: #adadad; font-style: italic;">; FM parameters</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> _skCC_FM1-_skCC
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">0006</span></span> <span style="color: #adadad; font-style: italic;">; FM parameters</span>
    &nbsp;
    _skCC_PSG1:
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">85</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">03</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">81</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">07</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">8A</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">0A</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">90</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">07</span></span>
    &nbsp;
    _skCC_FM1:
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">EF</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">00</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">89</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">08</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">8B</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">08</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F2</span>
    &nbsp;
    _skCC_voices:
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FA</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">11311330</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">0A0F1F1F</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">05180902</span></span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">060F0602</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">0F074F2F</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">070E0E80</span>
    &nbsp;</pre><!--gc2--><!--Cl9za0NDOgoJZGMudwlfc2tDQ192b2ljZXMtX3NrQ0MKCWRjLncJJiMwMzY7MDEwMgk7IENoYW5uZWwg
    c2V0dXAKCWRjLncJJiMwMzY7ODAwMgk7ICZxdW90O1BTRyZxdW90OyBwYXJhbWV0ZXJzCglkYy53CV9za
    0NDX1BTRzEtX3NrQ0MKCWRjLncJJiMwMzY7MDAwNgk7ICZxdW90O1BTRyZxdW90OyBwYXJhbWV0ZXJzCg
    lkYy53CSYjMDM2OzgwMDQJOyBGTSBwYXJhbWV0ZXJzCglkYy53CV9za0NDX0ZNMS1fc2tDQwoJZGMudwk
    mIzAzNjswMDA2CTsgRk0gcGFyYW1ldGVycwoKX3NrQ0NfUFNHMToKCWRjLmIJJiMwMzY7ODUsICYjMDM2
    OzAzLCAmIzAzNjs4MSwgJiMwMzY7MDcsICYjMDM2OzhBLCAmIzAzNjswQSwgJiMwMzY7OTAsICYjMDM2O
    zA3Cgpfc2tDQ19GTTE6CglkYy5iCSYjMDM2O0VGLCAmIzAzNjswMCwgJiMwMzY7ODksICYjMDM2OzA4LC
    AmIzAzNjs4QiwgJiMwMzY7MDgsICYjMDM2O0YyCgpfc2tDQ192b2ljZXM6CglkYy5iCSYjMDM2O0ZBCgl
    kYy5sCSYjMDM2OzExMzExMzMwLCAmIzAzNjswQTBGMUYxRiwgJiMwMzY7MDUxODA5MDIsICYjMDM2OzA2
    MEYwNjAyLCAmIzAzNjswRjA3NEYyRiwgJiMwMzY7MDcwRTBFODAK--><!--egc2--><!--g2--></div><!--eg2-->

    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,014
    3
    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.