Commit Graph

1213 Commits

Author SHA1 Message Date
Frank
f1088bb5c0 (experimental) loop2 to get fresh audio just before drawing
* introducing usermod::loop2() - runs just before strip.service()
--> expecting to reduce lagging between audio and visual to an absolute minimum.
2024-09-21 20:41:05 +02:00
Troy
9e65ab3be4 Stop issue playlist continuing when disabling AutoPlaylist
If you use the "music" playlist on boot, it'll keep it going even when you manually override to something else.  This seems to fix this condition.
2024-08-14 11:53:35 -04:00
Frank
7f9da309c9 const const const
adding hints for the compiler for optimization.
In case your custom build complains about "const", just remove the keyword. based on e82f38e277, but going further :-)

* "const" class functions : function does not modify any class attributes ( --> "this" becomes const)

* __attribute__((pure)) :  function return value depends only on the parameters and/or global variables. The function does not modify any global or static variables.
* __attribute__((const)) : function only examines arguments (no globals), and has no effects except the return value. This slightly more strict than "pure"
* hot: tells the compiler "this functions is called very often"
* cold: the opposite of hot
2024-08-07 14:58:38 +02:00
Frank
ecb8817c90 Update audio_source.h - swapped channel bug still exists in 2.0.17
Actually we could even check for " < 5.0.0 " - arduino 2.0.x is in maintenance mode now, and I see little chance that a fix will appear before 3.0.0.
2024-07-30 16:03:19 +02:00
Frank
982a4bb155 Merge pull request #139 from MoonModules/upstream_patch_clusterf
AC minor patch cluster
* Anti-Aliased Lines and Circles
* replacing deprecated functions in ws.cpp
* using global brightness in analogue clock overlay
* fix for palette names (custom palettes)
* bugfix for UI: when resizing the window, it always jumped to the Colors tab
* UI: add webpage shortcuts for tabs
2024-07-13 01:13:53 +02:00
Troy
1c33a4bbea Remove references to AC101 mic mode (not implemented) 2024-07-10 19:08:58 -04:00
Troy
f7e2f14ca4 Minor tab and comment clean-up. 2024-07-10 19:03:38 -04:00
Troy
1fe871c42c Fully working with analog loopthru 2024-07-10 18:54:02 -04:00
Troy
c069385600 Merge branch 'MoonModules:mdev' into AC101-Support 2024-07-10 15:32:43 -04:00
Frank
4d03af6466 mic quality dropdown, cleanup
* mic quality: When set to "low noise" or "perfect", only minimal smoothing is performed on the "Mic Volume" input.
Every filter adds a delay, so this option can lead to better on-spot responses from effects.

* cleanup: removed a few unused variables and unused code.
2024-07-05 17:53:43 +02:00
Frank
bd997f7056 added Blackman window 2024-07-05 15:37:03 +02:00
Frank
cba883c663 parameter tuning
*some filter parameter tinkering
* restore FFT_MajPeakSmth in UDP SoundSync receiver
2024-07-05 15:12:41 +02:00
Frank
160e66a766 user-selectable FFT window functions
experiments: user-selectable FFT "windowing" options

https://en.wikipedia.org/wiki/Window_function#Cosine-sum_windows
2024-07-04 21:44:09 +02:00
Frank
9b14de06b2 fix build error on -S2, -C3 2024-07-04 20:13:57 +02:00
Frank
7d04660b91 postProcessFFTResults adjustments for FastPath
samples arrive 2x as fast in fast mode - adjust filters accordingly
2024-07-04 20:06:13 +02:00
Frank
7883474404 postProcessFFTResults minor refactoring
* limiter on/off : made the logic a bit clearer.
* use a simpler way of writing filters: a = n*a + (1-n)*b --> a = a+ n*(b-a)

no functional impact.
2024-07-04 18:37:31 +02:00
Frank
eaf6117f31 Merge branch 'mdev' into Full_audio_FastPath 2024-07-04 17:55:12 +02:00
Troy
28cb5c88b6 Skeleton, not working yet. 2024-07-03 16:20:44 -04:00
Frank
27dd6bddac AudioReactive:digitalmic:pin[] --> uxp
before: String buffer usage: 2805 of 4037 bytes
after:    String buffer usage: 2566 of 4037 bytes
2024-07-01 22:56:18 +02:00
Frank
31a12f5098 AudioReactive -> ux
before: String buffer usage: 3530 of 4037 bytes
After:    String buffer usage: 3183 of 4037 bytes
2024-07-01 21:10:45 +02:00
Frank
a317af42fc trying to make effects respond to changes quicker in fastpath mode
filter parameter tuning
2024-07-01 16:37:44 +02:00
Frank
e98858c751 audio FASTPATH, part 2
* introducing sliding window FFT, which effectively doubles the rate of samples - and FFT results - produced per second. As a side-effect, it also makes FFT a bit less noisy.

As sliding window FFT requires double the number of FFT runs, the feature is only enabled on esp32 and esp32-S3.
2024-07-01 16:29:09 +02:00
Frank
61afb26d21 Update audio_reactive.h - fix compile error 2024-07-01 15:53:20 +02:00
Frank
2987f0d045 SR_STATS: filter time
adding "Filtering Time" to SR statistics (info page)
2024-07-01 15:46:51 +02:00
Frank
9803cecee2 new idea to reduce stack buffer usage
the JS string can be shortened, by putting the usermod into a variable `ux` that is used instead of repeating the string 'Aduioreactive'.

For now its just an experiment, to see if the idea works on several browsers.
2024-07-01 02:46:14 +02:00
Frank
f3cbe75506 remove support for old ArduinoFFT library < 1.9.2
there is no reason any more to still use the old arduinoFFT library version.
2024-07-01 02:39:44 +02:00
Frank
4f9f250a1d only run FFT.dcRemoval() when no filtering was applied
FFT.dcRemoval() may introduce unwanted artifacts into the FFT result.
2024-07-01 02:29:14 +02:00
Frank
f432cb20dc remove experiments:freqRMS option
the default value seems to work well.
2024-07-01 02:14:00 +02:00
Blaz Kristan
c5283da32a Fix for #3878 2024-06-26 21:38:02 +02:00
Blaz Kristan
3df3b9acaf ArduinoFFT update
shadow variables
2024-06-26 21:35:19 +02:00
Frank
c876267c95 Update audio_reactive.h - debug fix 2024-06-24 17:14:09 +02:00
Frank
899899094f sound sync: use last remaining gap to transmit soundPressure
* use last remaining two bytes in audioSyncPacket for transmitting soundPressure
* 0x0 is treated as "legacy value" --> soundPressure = volumeSmth;
* decodeAudioData: ensure receivedPacket struct members  are correctly aligned -
strictly speaking it is not safe to cast a uint8_t* as it does not offer any alignment guarantees.
* remove 8266 special handling in audioreactive::setup()
2024-06-24 17:01:43 +02:00
Will Tatam
827cdc2f5b AutoPlaylist - prevent swapping playlist after silence ended when Suspended 2024-05-26 13:47:52 +01:00
Frank
2144613423 compatibility with upstream arduinoFFT 2.x
its still recommended to use the softhack007 version - -> optimized for ESP32 boards, and  reduced memory footprint
 https://github.com/softhack007/arduinoFFT.git#develop @ 1.9.2
2024-05-11 13:57:49 +02:00
Frank
7b58727254 bugfix for sound sync - fftResult[] did not use 255
transmitData.fftResult[] and fftResult[] are both uint8, no need to constrain the value.
2024-05-08 21:39:38 +02:00
Frank
5a377103b5 small accuracy improvement
(int)currentResult is a truncation, so we need to add 0.5 for proper rounding.
also changed inefficient "constrain" into faster max(min( ...))
2024-05-08 21:04:07 +02:00
Frank
adf5afe84a include the GPLv3 permission statement in some MM-specific files
Please note that these statements are included for clarification purposes only.
WLED-MM specific source code is always provided under GPLv3, see LICENSE.
2024-05-08 12:52:07 +02:00
Frank
daec240c52 small improvement for athom music 2024-05-04 13:55:25 +02:00
Frank
ecf7acbc76 AR pin config: SCK == 1 --> PDM microphone 2024-05-04 13:36:56 +02:00
Frank
fc66dcc0ce squeezing a few KB out of builds that are close to 100% flash usage 2024-05-04 01:44:14 +02:00
Frank
714d4850af minor cleanup
* startup message from UM autoplaylist
* zeroCrossingCount added to sound simulation
* debug messages cleanup
2024-04-30 12:47:45 +02:00
Frank
3567243d18 small improvements for audioreactive
* added ESP_INTR_FLAG_IRAM to reduce lost samples (only on ESP32 without PSRAM) --> may cause crash if used wrongly
* FFT_MajorPeak stabilized, by ignoring extreme results
2024-04-28 18:52:19 +02:00
Frank
0f677c35f5 typo 2024-04-18 21:09:28 +02:00
Frank
7dc6659e70 audioreactive: better do DC removal after FFT.complexToMagnitude(); 2024-04-18 13:36:00 +02:00
Frank
0e0728b15d audioreactive: workaround for ArduinoFFT bug 93
This fix works around a problem that was solved in upstream ArduinoFFT 2.0.2
2024-04-18 12:57:29 +02:00
netmindz
0f79e9b7ff Merge pull request #124 from netmindz/auto-playlist
New Usermod - Auto Playlist
2024-04-16 22:38:56 +01:00
Frank
d42148d994 Info page optimizations
* reduce from 3 lines to two lines
* don't add to info when usermod is disabled in UM settings
* show current playlist id
2024-04-16 17:57:31 +02:00
Frank
acfbe890b3 suspend playlist engine while auto-change is active
* adding suspendPlaylist() to playlist engine code
* autoplaylist usermod calls suspendPlaylist() before switching to another preset
* fix a potential overflow on `lfc` (uint8_t -> uint16_t)
2024-04-16 13:25:21 +02:00
Troy
11315a81b5 unsigned wraparound prevention 2024-04-14 15:32:13 -04:00
Troy
dfab0ca402 Accepting more Softhack007 suggestings 2024-04-14 15:21:07 -04:00