Skip to content
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

braids decimation with envelope & AD_VCA #54

Closed
boochow opened this issue May 25, 2023 · 1 comment
Closed

braids decimation with envelope & AD_VCA #54

boochow opened this issue May 25, 2023 · 1 comment

Comments

@boochow
Copy link

boochow commented May 25, 2023

Hello! I am currently porting braids onto KORG drumlogue and have a question about this code

eurorack/braids/braids.cc

Lines 285 to 288 in d1d8839

if ((i % decimation_factor) == 0) {
sample = render_buffer[i] & bit_mask;
}
sample = sample * gain_lp >> 16;

When decimation_factor = n, the code multiplies gain_lp to sample n times, so the value of sample goes to sample * pow(gain_lp, n), then when (i % decimation_factor) == 0 becomes true, the new value is loaded from render_buffer.
Is this the intended behavior?
I mean, why the code wasn't like this?

    if ((i % decimation_factor) == 0) {
      sample = render_buffer[i] & bit_mask;
    }
    int16_t decimated_sample = sample * gain_lp >> 16;
@pichenettes
Copy link
Owner

You're right, this is a stupid bug and you can fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants