Effects with hardware envelopes don’t work with lower volumes

What is Arkos Tracker? Forums Arkos Tracker forum General discussion Effects with hardware envelopes don’t work with lower volumes

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30653
    prodatron
    Participant

    If an effect uses hardware envelopes, the following code will deactivate this…

    {!{code}!}czoyNjY6XCJQTFlfU0VfUFNFU19NYW5hZ2VWb2x1bWVGcm9tQV9IYXJkOgogICAgICAgIDtEZWNyZWFzZXMgdGhlIHZvbHVtZSwgY2h7WyYqJl19ZWNrcyB0aGUgbGltaXQuCiAgICAgICAgc3ViIChpeCArIFBMWV9TRV9Tb3VuZEVmZmVjdERhdGFfT2Zmc2V0SW52ZXJ0ZWRWb2x1bXtbJiomXX1lKQogICAgICAgIGpyIG5jLFBMWV9TRV9QU0VTX01WRkFfTm9PdmVyZmxvdwogICAgICAgIHhvciBhClBMWV9TRV9QU0VTX01WRkFfe1smKiZdfU5vT3ZlcmZsb3c6CiAgICAgICAgbGQgKGl5ICsgMCksYQogICAgICAgIHJldFwiO3tbJiomXX0={!{/code}!}

    …as soon as InvertedVolume is >0. Because this will result in 15 or lower, which will reset flag 4 in the volume register.

    This is the code, which is calling this:

    {!{code}!}czoxMTQ6XCI7U2V0cyB0aGUgdm9sdW1lIHRvICZxdW90O2hhcmR3YXJlJnF1b3Q7LiBJdCBzdGlsbCBtYXkgYmUgZGVjcmVhc2VkLgp7WyYqJl19bGQgYSwxNgpqcCBQTFlfU0VfUFNFU19NYW5hZ2VWb2x1bWVGcm9tQV9IYXJkXCI7e1smKiZdfQ=={!{/code}!}

    So you wrote “It still may be decreased”, but as soon as it is <16 it will not play the hardware envelope, so the effect will sound (very) different.
    But is this an intention?
    Or maybe I missed something?

    #30654
    prodatron
    Participant

    (sorry again with correct code)

    If an effect uses hardware envelopes, the following code will deactivate this…

    ;After the filtering. Useful for hardware sound (volume has been forced to 16).
    PLY_SE_PSES_ManageVolumeFromA_Hard:
    ;Decreases the volume, checks the limit.
    sub (ix + PLY_SE_SoundEffectData_OffsetInvertedVolume)
    jr nc,PLY_SE_PSES_MVFA_NoOverflow
    xor a
    PLY_SE_PSES_MVFA_NoOverflow:
    ld (iy + 0),a
    ret

    …as soon as InvertedVolume is >0. Because this will result in 15 or lower, which will reset flag 4 in the volume register.

    This is the code, which is calling this:

    ;Sets the volume to “hardware”. It still may be decreased.
    ld a,16
    jp PLY_SE_PSES_ManageVolumeFromA_Hard

    So you wrote “It still may be decreased”, but as soon as it is <16 it will not play the hardware envelope, so the effect will sound (very) different.
    But is this an intention?
    Or maybe I missed something?

    #30656
    Targhan
    Keymaster

    Hi,

    This is the intention. The hardware envelope will stop being “hardware” and will become a software sound. This is the only way you can do a real fade-out/in.

    I used this in Orion Prime, and even Madmax on some Atari ST Games, and it works fine, though it is of course not ideal. You could change the code to bypass the volume change if the bit 4 is set if you prefer this alternative, but I prefer the way I implemented it.

    #30657
    prodatron
    Participant

    Hi Targhan,
    thanks, that’s interesting!
    I will play around with it a little bit again, maybe it is really better to do it in this way.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.