From d0927a5142d73810f11c3f60ab9fb1a15a390e68 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:29:29 +0200 Subject: [PATCH] akemi and GEQ didn't like map2 --- wled00/FX.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index f599c511..ba2f1c3c 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7889,7 +7889,7 @@ uint16_t mode_2DGEQ(void) { // By Will Tatam. Code reduction by Ewoud Wijma. remaining--; //consume remaining // Serial.printf("x %d b %d n %d w %f %f\n", x, band, NUM_BANDS, bandwidth, remaining); - uint8_t frBand = ((NUM_BANDS < 16) && (NUM_BANDS > 1)) ? map2(band, 0, NUM_BANDS - 1, 0, 15):band; // always use full range. comment out this line to get the previous behaviour. + uint8_t frBand = ((NUM_BANDS < 16) && (NUM_BANDS > 1)) ? map(band, 0, NUM_BANDS - 1, 0, 15):band; // always use full range. comment out this line to get the previous behaviour. // frBand = constrain(frBand, 0, 15); //WLEDMM can never be out of bounds (I think...) uint16_t colorIndex = frBand * 17; //WLEDMM 0.255 uint16_t bandHeight = fftResult[frBand]; // WLEDMM we use the original ffResult, to preserve accuracy @@ -7899,7 +7899,7 @@ uint16_t mode_2DGEQ(void) { // By Will Tatam. Code reduction by Ewoud Wijma. // get height of next (right side) bar uint8_t nextband = (remaining < 1)? band +1: band; nextband = constrain(nextband, 0, 15); // just to be sure - frBand = ((NUM_BANDS < 16) && (NUM_BANDS > 1)) ? map2(nextband, 0, NUM_BANDS - 1, 0, 15):nextband; // always use full range. comment out this line to get the previous behaviour. + frBand = ((NUM_BANDS < 16) && (NUM_BANDS > 1)) ? map(nextband, 0, NUM_BANDS - 1, 0, 15):nextband; // always use full range. comment out this line to get the previous behaviour. uint16_t nextBandHeight = fftResult[frBand]; // smooth Band height bandHeight = (7*bandHeight + 3*lastBandHeight + 3*nextBandHeight) / 12; // yeees, its 12 not 13 (10% amplification) @@ -8088,7 +8088,7 @@ uint16_t mode_2DAkemi(void) { for (int x=0; x < cols/8; x++) { uint16_t band = x * cols/8; band = constrain(band, 0, 15); - uint16_t barHeight = map2(fftResult[band], 0, 255, 0, 17*rows/32); + uint16_t barHeight = map(fftResult[band], 0, 255, 0, 17*rows/32); CRGB color = SEGMENT.color_from_palette((band * 35), false, PALETTE_SOLID_WRAP, 0); for (int y=0; y < barHeight; y++) {