-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release is abrupt during attack phase #265
Comments
For what I can gather from |
I think I know! There is a discontinuity between the formula used to turn the envelope into amplifier factor during attack (see if (adsr->envelope_state == ATTACK)
return ((Sint64)input * ((Sint32)adsr->envelope / 0x10000) / 256) * (Sint32)(adsr->volume) / MAX_VOLUME; and the formula used during release else
return ((Sint64)input * (cyd->lookup_table[(adsr->envelope / (65536*256 / LUT_SIZE) ) & (LUT_SIZE - 1)]) / 65536) * (Sint32)(adsr->volume) / MAX_VOLUME; When release occur right in the middle of the attack the amplifier factor suddenly jumps to another value! I don't know what could be the proper fix, and I might not see the big picture well enough to find it. |
It seems to me the simplest trick to solve that would be to re-ajust |
Given the way
where
|
If I'm correct the correct translation formula is
now time to try! P.S: sorry for the multiplicity of posts. I prefer to update my progress frequently to not duplicate effort, in case someone else is looking at this too. |
Multiple messages are fine, great that you are finding the solution! |
It works! :-) :-) :-) I still need a bit more time to create a proper PR but here comes the question, what to do about backward compatibility? |
Perhaps this can be postponed for 1.8 as it's clearly a middle sized
improvement. People can use older versions for compability.
la 23. helmikuuta 2019 klo 10.27 Nil Geisweiller <[email protected]>
kirjoitti:
… It works! :-) :-) :-)
I still need a bit more time to create a proper PR but here comes the
question, what to do about backward compatibility?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCK6RtEd68a0jzywoyBlgQOsbf_1UjAks5vQPtqgaJpZM4bKN9i>
.
|
How to reproduce
What should be expected
The note volume should decrease at the speed set to
REL
regardless of the ADSR phase.The text was updated successfully, but these errors were encountered: