From d381108dc07915a37faf846f495ef1f4f38bc2ca Mon Sep 17 00:00:00 2001 From: Arcitec <38923130+Arcitec@users.noreply.github.com> Date: Wed, 14 May 2025 00:27:29 +0200 Subject: [PATCH 1/4] AR: add compile-time flag for "Automatic Gain Control" option Automatic Gain Control is a very important aspect of the audioreactive plugin, and is vitally important when the external music volume constantly changes. It makes sense to allow users to choose their preferred AGC behavior at compile-time, since they can already set the Gain and Squelch via flags. Adds `SR_AGC` as a flag, which defaults to 0 (off). --- usermods/audioreactive/audio_reactive.cpp | 5 ++++- usermods/audioreactive/readme.md | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/usermods/audioreactive/audio_reactive.cpp b/usermods/audioreactive/audio_reactive.cpp index 4b3520562..e7e79846a 100644 --- a/usermods/audioreactive/audio_reactive.cpp +++ b/usermods/audioreactive/audio_reactive.cpp @@ -65,11 +65,14 @@ static bool udpSyncConnected = false; // UDP connection status -> true i // audioreactive variables #ifdef ARDUINO_ARCH_ESP32 + #ifndef SR_AGC // Automatic gain control mode + #define SR_AGC 0 // default mode = off + #endif static float micDataReal = 0.0f; // MicIn data with full 24bit resolution - lowest 8bit after decimal point static float multAgc = 1.0f; // sample * multAgc = sampleAgc. Our AGC multiplier static float sampleAvg = 0.0f; // Smoothed Average sample - sampleAvg < 1 means "quiet" (simple noise gate) static float sampleAgc = 0.0f; // Smoothed AGC sample -static uint8_t soundAgc = 0; // Automagic gain control: 0 - none, 1 - normal, 2 - vivid, 3 - lazy (config value) +static uint8_t soundAgc = SR_AGC; // Automatic gain control: 0 - off, 1 - normal, 2 - vivid, 3 - lazy (config value) #endif //static float volumeSmth = 0.0f; // either sampleAvg or sampleAgc depending on soundAgc; smoothed sample static float FFT_MajorPeak = 1.0f; // FFT: strongest (peak) frequency diff --git a/usermods/audioreactive/readme.md b/usermods/audioreactive/readme.md index bd253c82c..5ee575fff 100644 --- a/usermods/audioreactive/readme.md +++ b/usermods/audioreactive/readme.md @@ -60,8 +60,9 @@ You can use the following additional flags in your `build_flags` * `-D SR_SQUELCH=x` : Default "squelch" setting (10) * `-D SR_GAIN=x` : Default "gain" setting (60) +* `-D SR_AGC=x` : (Only ESP32) Default "AGC (Automatic Gain Control)" setting (0): 0=off, 1=normal, 2=vivid, 3=lazy * `-D I2S_USE_RIGHT_CHANNEL`: Use RIGHT instead of LEFT channel (not recommended unless you strictly need this). -* `-D I2S_USE_16BIT_SAMPLES`: Use 16bit instead of 32bit for internal sample buffers. Reduces sampling quality, but frees some RAM ressources (not recommended unless you absolutely need this). +* `-D I2S_USE_16BIT_SAMPLES`: Use 16bit instead of 32bit for internal sample buffers. Reduces sampling quality, but frees some RAM resources (not recommended unless you absolutely need this). * `-D I2S_GRAB_ADC1_COMPLETELY`: Experimental: continuously sample analog ADC microphone. Only effective on ESP32. WARNING this *will* cause conflicts(lock-up) with any analogRead() call. * `-D MIC_LOGGER` : (debugging) Logs samples from the microphone to serial USB. Use with serial plotter (Arduino IDE) * `-D SR_DEBUG` : (debugging) Additional error diagnostics and debug info on serial USB. From ab28b6d58fad3636dbbe9bc0e83ad314d9b4a3d5 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 7 Jun 2025 11:08:11 -0400 Subject: [PATCH 2/4] Update crude parallel I2S detection My ESP32s are now reporting a maximum of 32 buses. --- wled00/data/settings_leds.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index d5151231e..66bc2f000 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -353,7 +353,7 @@ }); const S2 = (oMaxB == 14) && (maxV == 4); const S3 = (oMaxB == 14) && (maxV == 6); - if (oMaxB == 19 || S2 || S3) { // TODO: crude ESP32 & S2/S3 detection + if (oMaxB == 32 || S2 || S3) { // TODO: crude ESP32 & S2/S3 detection if (maxLC > 300 || dC <= 2) { d.Sf["PR"].checked = false; gId("prl").classList.add("hide"); From ea231cbea8405c7b95f76491eb1b11a36e6214e8 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Tue, 10 Jun 2025 19:29:53 +0200 Subject: [PATCH 3/4] Fixed "Flow Stripe" FX and added palette support --- wled00/FX.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index c76c9e6b9..13734b1a8 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -4817,7 +4817,7 @@ static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness vari ////////////////////////////// // Flow Stripe // ////////////////////////////// -// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline +// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline, fixed by @DedeHai uint16_t mode_FlowStripe(void) { if (SEGLEN <= 1) return mode_static(); const int hl = SEGLEN * 10 / 13; @@ -4825,16 +4825,16 @@ uint16_t mode_FlowStripe(void) { uint32_t t = strip.now / (SEGMENT.intensity/8+1); for (unsigned i = 0; i < SEGLEN; i++) { - int c = (abs((int)i - hl) / hl) * 127; + int c = ((abs((int)i - hl) * 127) / hl); c = sin8_t(c); c = sin8_t(c / 2 + t); byte b = sin8_t(c + t/8); - SEGMENT.setPixelColor(i, CHSV(b + hue, 255, 255)); + SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(b + hue, false, true, 3)); } return FRAMETIME; } // mode_FlowStripe() -static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;"; +static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;!;pal=11"; #ifndef WLED_DISABLE_2D From 42bf8fb40d2e45088b3a411f13abf652ec736454 Mon Sep 17 00:00:00 2001 From: netmindz Date: Sat, 14 Jun 2025 20:02:01 +0000 Subject: [PATCH 4/4] Update pr-merge.yaml --- .github/workflows/pr-merge.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pr-merge.yaml b/.github/workflows/pr-merge.yaml index db5937dff..5f216100c 100644 --- a/.github/workflows/pr-merge.yaml +++ b/.github/workflows/pr-merge.yaml @@ -28,9 +28,6 @@ with: ref: ${{ github.event.pull_request.head.sha }} # This is dangerous without the first access check - name: Send Discord notification - shell: bash - env: - DISCORD_WEBHOOK_BETA_TESTERS: ${{ secrets.DISCORD_WEBHOOK_BETA_TESTERS }} # if: github.event.pull_request.merged == true run: | - curl -H "Content-Type: application/json" -d '{"content": "Pull Request ${{ github.event.pull_request.number }} merged by ${{ github.actor }}"}' $DISCORD_WEBHOOK_BETA_TESTERS + curl -H "Content-Type: application/json" -d '{"content": "Pull Request ${{ github.event.pull_request.number }} merged by ${{ github.actor }}"}' ${{ secrets.DISCORD_WEBHOOK_BETA_TESTERS }}