Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance API to choose a random filtered effect (1D, 2D, sound reactive) #3605

Closed
aeronauth opened this issue Dec 21, 2023 · 6 comments
Closed
Labels
enhancement fixed in source This issue is unsolved in the latest release but fixed in master

Comments

@aeronauth
Copy link

It would be great if HTTP/JSON API could start a random effect with filter flags (1D, 2D, sound reactive x2) to limit the random effect to these filters.

With that, one can use a push button to randomly go trough all matrix effects only, another button to randomly go trough all sound reactive effects only, ....

As a effect might be 2d and sound reactive at the same time, that flags might be implementend for combination use.

I know that it's possible to create alot of presets and use them in playlists, which can be used by the buttons, but i think there should be a more convenience solution.

@blazoncek
Copy link
Collaborator

Unfortunately that may be impossible to implement without severely impacting performance as this data (1D, 2D, ...) is embeded in string. Parsing it takes time.
Best approximation is to use "fx":"X~Y~r" where you select X and Y to encompass certain effect range.
See KB

Unfortunately I was over-voted when I tried to group certain effects together and the SR effect numbering prevailed.

@dosipod
Copy link

dosipod commented Dec 23, 2023

How about adding the ability to access FX numbers directly from a playlist as it is limited at the moment to preset numbers
image

@dosipod
Copy link

dosipod commented Dec 24, 2023

And I just tested your command listed about for "fx":"XYr" as in {"fx":"124180r"} or {"seg":{"fx":"124180r"}} if that is what you meant and it does not work
image

This will work but only at random so range is not respected
image

@blazoncek
Copy link
Collaborator

I am sorry for the confusion. The "X~Yr" API only works for presets (notice the lack of second ~).
Unfortunately effects have hardcoded limits for random selection.
I may add custom limits in the future.

@czesiu20
Copy link

Unfortunately that may be impossible to implement without severely impacting performance as this data (1D, 2D, ...) is embeded in string. Parsing it takes time. Best approximation is to use "fx":"X~Y~r" where you select X and Y to encompass certain effect range. See KB

Unfortunately I was over-voted when I tried to group certain effects together and the SR effect numbering prevailed.

Limiting the range of effects would be very useful. I had to implement my own function to handle Music+/- buttons of my 38-key and 24-Key Music IR remotes.

case IR38_MUSIC_P    : changeEffect(relativeChange(effectCurrent, -1, 128, MODE_COUNT-1)); break;
case IR38_MUSIC_N    : changeEffect(relativeChange(effectCurrent,  1, 128, MODE_COUNT-1)); break;

Currently it is not possible to achieve in a JSON file.

However, my solution is not completely satisfactory because I encountered another problem. Adding a new option to the list of remotes in the GUI is not trivial and I had to replace the existing one.

@blazoncek blazoncek added the fixed in source This issue is unsolved in the latest release but fixed in master label Jan 12, 2024
@blazoncek blazoncek added this to the 0.15.0-alpha candidate milestone Jan 15, 2024
softhack007 pushed a commit to MoonModules/WLED that referenced this issue Feb 12, 2024
@blazoncek
Copy link
Collaborator

Available in 0.15.0 beta 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fixed in source This issue is unsolved in the latest release but fixed in master
Projects
None yet
Development

No branches or pull requests

4 participants