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

ZamHeadX2 array indices swapped #98

Closed
Hamster128 opened this issue Oct 26, 2023 · 2 comments
Closed

ZamHeadX2 array indices swapped #98

Hamster128 opened this issue Oct 26, 2023 · 2 comments

Comments

@Hamster128
Copy link

Hamster128 commented Oct 26, 2023

Hi,

I just build your ZamHeadX2 plugin, and on the way to understand the parameters, i think i came across a bug. It seems that the dimensions of the fir_left/right arrays are swapped:

void ZamHeadX2Plugin::reload()
elev 0 - 24
azim 0 - 49

clv_configure("convolution.ir.preset", elev, azim);

.
.
.

LV2convolv::clv_configure (const char *key, const char elev, const char azim)

ir_presetx = atoi(elev); // 0 - 24
ir_presety = atoi(azim); // 0 - 49

.
.
.

LV2convolv::clv_initialize (

fir_coeffs_lr[2 * i] = fir_left[ir_presetx][ir_presety][i];
fir_coeffs_lr[2 * i + 1] = fir_right[ir_presetx][ir_presety][i];

here we have fir_left[ 0 - 24 ][ 0 - 49 ] [i]
but it was defined with swapped ranges:
static const float fir_left[50][25][200] = {

zamaudio added a commit that referenced this issue Oct 27, 2023
Fixes #98 - array indices swapped.

The array indices weren't actually swapped, but
the ranges were defined incorrectly resulting in only
some of the filters being used, rather than filter
coefficients being mixed up/corrupted.
@zamaudio
Copy link
Owner

zamaudio commented Nov 5, 2023

Thanks for bug report, will address soon.

@zamaudio
Copy link
Owner

zamaudio commented Nov 5, 2023

Fixed in 4.2

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