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

Rounding issue when setting SampleTune #10

Closed
skratchdot opened this Issue Aug 17, 2011 · 0 comments

Comments

Projects
None yet
1 participant
@skratchdot
Copy link
Owner

skratchdot commented Aug 17, 2011

Samples with a sampling rate of 48000 are incorrectly imported with a SampleTune value of 1.46 (while the ESX imports them with the value 1.47).

This is due to a rounding issue. When importing new samples into the program, the SampleTune value needs to be set. The formula currently being used is:

SampleTune = 12 * ( log(sampleRate/44100) / log(2) );

When importing a sample with a sampleRate of 48000, this yields: 1.4670696

Instead of rounding down, this should use: RoundingMode.HALF_EVEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment