Fix audio responsive hue

This commit is contained in:
Will Tatam
2023-01-20 19:58:40 +00:00
parent 78bc566b06
commit f1fe6296e7
2 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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
}