SteveEisner / WLEDtubes

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
25 stars 2 forks source link

BPM -> WLED effect speed #17

Open SteveEisner opened 2 years ago

SteveEisner commented 2 years ago

Should translate this to automatically set WLED speed

jwardle commented 2 years ago

Just Googled for this feature - would be great if BPM could be translated to effect speed when playing music. It would be useful also if this could be triggered on/off by certain presets, as one may not want BPM reactive patterns for all effects/presets.

SteveEisner commented 2 years ago

I think it should be possible to do on a per-mode basis: set the speed to 128, time the "period" of the FX mode, then set to another speed & re-time. If the period changes proportionally, the effect is probably F(time) and could be mapped to a tempo. I've added a method in this branch to set the speed of a mode automatically based on the current tempo. But I don't have the appropriate timing factors measured yet so it's always setting to 128 ;(

SteveEisner commented 2 years ago

of course, could also look at each mode's code to find its period :)