From f1fe6296e7a5fd5dd11ff7dfccfafe0eb1943fb9 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Fri, 20 Jan 2023 19:58:40 +0000 Subject: [PATCH] Fix audio responsive hue --- wled00/FX_fcn.cpp | 4 ++-- wled00/util.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 2dd65379..10df295f 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1247,13 +1247,13 @@ uint8_t * Segment::getAudioPalette(int pal) { xyz[6] = rgb.g; xyz[7] = rgb.b; - rgb = getCRGBForBand(4, fftResult, pal); + rgb = getCRGBForBand(128, fftResult, pal); xyz[8] = 128; xyz[9] = rgb.r; xyz[10] = rgb.g; xyz[11] = rgb.b; - rgb = getCRGBForBand(8, fftResult, pal); + rgb = getCRGBForBand(255, fftResult, pal); xyz[12] = 255; // anchor of last color - must be 255 xyz[13] = rgb.r; xyz[14] = rgb.g; diff --git a/wled00/util.cpp b/wled00/util.cpp index 9c0d30fc..72eb3b26 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -531,7 +531,7 @@ CRGB getCRGBForBand(int x, uint8_t *fftResult, int pal) { } } else if(pal == 72) { - int b = map(x, 0, 255, 0, 8); // convert palette position to lower half of freq band + int b = map(x, 1, 255, 0, 10); // convert palette position to lower half of freq band hsv = CHSV(fftResult[b], 255, map(fftResult[b], 0, 255, 30, 255)); // pick hue hsv2rgb_rainbow(hsv, value); // convert to R,G,B }