From eabd6f60ef1427999f40fb43fc719f1c0247f033 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:07:14 +0200 Subject: [PATCH] soudsim bugfix FFT_MajorPeak was just going from 0..255. Now it simulates the full range from 21hz ... 8Khz --- wled00/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/util.cpp b/wled00/util.cpp index cf04aa5d5..b8dea2555 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -503,8 +503,8 @@ um_data_t* simulateSound(uint8_t simulationId) } samplePeak = random8() > 250; - FFT_MajorPeak = volumeSmth; - maxVol = 10; // this gets feedback fro UI + FFT_MajorPeak = 21 + (volumeSmth*volumeSmth) / 8.0f; // walk thru full range of 21hz...8200hz + maxVol = 31; // this gets feedback fro UI binNum = 8; // this gets feedback fro UI volumeRaw = volumeSmth; my_magnitude = 10000.0 / 8.0f; //no idea if 10000 is a good value for FFT_Magnitude ???