Update ES8388Source::initialize and ES7243::initialize method signatures to match I2SSource::initialize so that when initialize is called on a AudioSource pointer the child class's method is used.
* remove "not supported" warning on -S2
* minor tweaking of beat detector
* optimized parameters for arduinoFFT
* fixed a few implicit "double" promotions
* minor UDP protocol optimizations
* small optimization for fft task create / suspend
* completely remove analogmic settings for -S3/-S2/-C3 where analog is not supported
changes were already tested extensively in the MM fork.
* audioreactive driver update
- Better handling of PDM and I2S Line-in
- Bugfixes for ES7243 (allocateMultiplePins)
- More error messages for ES7243
- sample scaling (needed for sources that use full scale of samples)
* audiorective update
* align SR_DEBUG with WLED_DEBUG
* optional bandpass filter (needed for PDM mics)
* sample scaling for PDM and Line-In
* small improvements for analog input
* bugfixes and small performance improvements
* code for FFT task refactored, for better readablity. Introduces separate functions for filtering and post-processing
* small improvement for beat detection
* default mic settings can be configured at compile time
* correct mic type if MCU does not support PDM or ADC
* hide analog PIN config if not supported by MCU
* audioreactive updates
- minor updates to source code (see discussion in PR #2907)
- usermod readme improvements
* small readme update
* one think I overlooked
* ok, another edit. Now its final. Hopefully.
* small upps
wrong parameter order in debug message.
* Grouping um settings, add pre and post Info, update SR & 4LD settings
Settings_um.htm:
- modify addField (grouping)
- addInfo (pre and post texts)
Add preInfo to audio reactive and 4ld usermod
Extra:
platformio: wemos_shield: add audio reactive usermod and update to alt display
* um settings: cpp: lowercase, js: initcap
* um settings: txt only pre, txt2 only post and initCap as function
* Fix rotary encoder info string
Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
it's possible that volume samples become negative. In this scenario, our simple noise gate does stupid things, and it looks like "effects temporarily lost the sound".
This fix improves the situation, and makes sure that volume samples are always >= 0.
16kHz might be a good compromise on small MCU's:
- GEQ will show frequencies up to ~6Khz
- FFT process may use up to 32millis (-> 100% CPU load). Try to stay below <60% so FreeRTOS can schedule all tasks properly.
- more CPU time is left for other WLED, so it maintains LED FPS and stays responsive on web UI.
Only run FFT when the result will be used.
Please note that this also means that `FFTTime` shown in Info is only meaningful when there is sound input and not silence.
--> To get exact FFT times, the optimization can be disabled by compiling with `-D SR_DEBUG`
I2S microphones were not working any more in with the newest framework - only delivers silence.
Ther reason is stupid bug in espressif I2S "compatibility" driver: RIGHT and LEFT channel are swapped, so when only asking for LEFT, we get silence from RIGHT.
Workaround: simply change LEFT to RIGHT, until the problem is fixed in ESP-IDF --> Fix tested on "classic ESP32", but still need to check behavior on -S3.
Code compiles also on -S3, -S2, and -C3.
smaller changes:
- a few changes to use new APIs (MCLK, rouing and sample resolution)
- a few additional debug messages
- put correct value into _pinConfig.mck_io_num
- the connected() method only get called once a Wifi STA connection is established. UDP Sound Sync should also work when sender is in AP Mode.
- added a few comments that should help to understand the code structure.
- Info Page: add a small horizontal line below usermod specific part. Improves readability.
- updated 2D mapping mode of some 1D soundreactive effects
- alllow some effects to fade slowly, even slower that possible with SEGMENT.fade_out(). Looks nice.
not sure why - most effects only fade when using SEGMENT.fade_out(), while some need SEGMENT.fadeToBlackBy().
- save 1K of RAM by optimizing out
fftBin[].
- moved several copies of the peak reset code into a single function
- moved peak detection out of getSample().
- call peak detection function as last step of FFTcode. More optimal, and we can be sure that fresh FFT result are available.
Peak detection/reset are now called from both tasks, so I had to move some peak-related vars out of AudioReactive class and make them global (static).
- put variables with same context next to each other.
- removed a few vars that are not needed any more.
- replaced "16" by a more descriptive constant
... found that stupid commit messages get more attention ;-)
- use 22050 Hz for sampling, as it is a standard frequency. I think this is the best choise.
- redesigned the GEQ channels (fftResult[]) for 22Khz, based on channels found on old HiFi equalizer equipment. 1Kzh is now at the center; Bass/Trebble channels are using 1/4 on left/right side respectively - similar to real equalizers. Looks nice :-)
- adjusted effects that use FFT_MajorPeak so that the maximum frequency is supported.
- new feature: "Input Level" (info page) can be used as global "GEQ gain" - only when AGC is ON (was already possible when AGC=off)
- some parameter tweaking in FFT function
- hidden feature: FFT decay is slower when setting a high "dynamics Limiter Fall time" (steps: <1000, <2000, <3000, >3000)
- FFT_MajorPeak default 1.0f (as log(0.0) is invalid)
- FX.cppp: ensure that fftResult[] is always used inside array bounds