summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-10-27 18:34:57 +1100
committerDamien Zammit <damien@zamaudio.com>2023-10-27 19:05:18 +1100
commit5dd4b19a33fff5e8d8a797f3f75d2d022b3e4c6f (patch)
treef32da3faaad4b320f23fd65dc0d59e135648a345
parent856349c3083f0857ae2aa3d1a5584fee24e93421 (diff)
ZamHeadX2: Fix mapping of FIR filter selectionfix-zamtube
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.
-rw-r--r--plugins/ZamHeadX2/ZamHeadX2Plugin.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
index 3685e7e..3d5edbc 100644
--- a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
+++ b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp
@@ -78,15 +78,15 @@ void ZamHeadX2Plugin::initParameter(uint32_t index, Parameter& parameter)
parameter.symbol = "az";
parameter.unit = " ";
parameter.ranges.def = 0.0f;
- parameter.ranges.min = -90.0f;
- parameter.ranges.max = 270.0f;
+ parameter.ranges.min = -120.0f;
+ parameter.ranges.max = 120.0f;
break;
case paramElevation:
parameter.name = "Elevation";
parameter.symbol = "elev";
parameter.unit = " ";
parameter.ranges.def = 0.0f;
- parameter.ranges.min = -45.0f;
+ parameter.ranges.min = -30.0f;
parameter.ranges.max = 90.0f;
break;
case paramWidth:
@@ -181,13 +181,12 @@ void ZamHeadX2Plugin::reload()
int az = 0;
int el = 0;
- el = (int)((elevation + 45.) * 24. / 135.);
- if (el >= 24) el = 24;
+ el = (int)((elevation + 30.) * 49. / 120.);
+ if (el >= 49) el = 49;
if (el < 0) el = 0;
- az = (int)((azimuth + 90.) * 49. / 360.);
- if (az >= 49) az = 49;
+ az = (int)((azimuth + 120.) * 24. / 240.);
+ if (az >= 24) az = 24;
if (az < 0) az = 0;
- if (az > 24) az = 49 - az;
snprintf(elev, 3, "%d", el);
snprintf(azim, 3, "%d", az);
if ((az != azold) || (el != elold)) {