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

Adds an API parameter to allow the user to skip to the next preset in a playlist at any time #3946

Merged
merged 15 commits into from
May 3, 2024

Conversation

freakintoddles2
Copy link

@freakintoddles2 freakintoddles2 commented May 1, 2024

Why is this needed?

There is no good way to create a playlist, and then skip to the next preset in that playlist whenever you'd like, especially if you ever need to modify that playlist. This would be nice to have especially when building a fixture that will primarily be controlled by a remote control (IR/wizmote) since it will make it easy to have a simple button to skip through a selection of presets in a playlist.

Many users have expressed an interest in this and so I decided to implement it as my first PR to WLED

Updates made

Initially I created a separate function in playlist.cpp which was essentially a copy of most of the code inside handlePlaylist() but then I realized I could just update handlePlaylist() to accept an optional boolean parameter skipNext which would then trigger the existing code to go to the next preset within handlePlaylist().

This reduced the overall code changes and I think provides a more elegant solution since it makes it compatible with any playlist even if the playlist uses shuffle mode.

I also added a new API command np (stands for Next Preset) to both the JSON and HTTP APIs (http is important IMO because it's simpler for novice/non-coders to understand and use).

Updated to allow a user to optionally skip to the next preset in the playlist anytime they desire.
Updated to add the optional skipNext bool to handlePlaylist() which allows people to skip to the next preset when desired
added new NP command to API to allow user to skip to next preset in a playlist. Example use is win&NP in a preset.
adds support for np boolean parameter to skip to next preset
wled00/json.cpp Outdated Show resolved Hide resolved
reworked approach based on feedback
reworked approach based on feedback
reworked approach based on feedback
reworked based on feedback
reworked based on feedback from original PR
reworked based on PR feedback
@freakintoddles2
Copy link
Author

freakintoddles2 commented May 1, 2024

Not sure if I need to do anything to indicate this, but it's ready to be re-reviewed with the suggested changes.

@blazoncek
Copy link
Collaborator

blazoncek commented May 1, 2024

You mentioned that the "fix" was simple. This take is far from it. 😄

My suggestion:

  • just add JSON (and perhaps HTTP) and set "skip to next" variable (bool)
  • in handlePlaylist() read that variable and unset (false) it when moving to next item

That's 4 files changed: wled.h, set.cpp, json.cpp and plalist.cpp. Nothing else.
handlePlaylist() is executed in each iteration of loop().

Once you've done that follow: https://github.com/Aircoookie/WLED/wiki/How-to-properly-submit-a-PR

@freakintoddles2
Copy link
Author

freakintoddles2 commented May 1, 2024

You mentioned that the "fix" was simple. This take is far from it. 😄

My suggestion:

  • just add JSON (and perhaps HTTP) and set "skip to next" variable (bool)
  • in handlePlaylist() heed that variable and unset (false) it when moving to next item

That's 4 files changed: wled.h, set.cpp, json.cpp and plalist.cpp. Nothing else. handlePlaylist() is executed in each iteration of loop().

Once you've done that follow: https://github.com/Aircoookie/WLED/wiki/How-to-properly-submit-a-PR

@blazoncek I think my original PR is along the lines of what you are suggesting and only touched four files (I was following your guidance from Discord) but then I changed the approach based on the feedback from softhack above. Is there some version of what you are saying that addresses his concerns?

@blazoncek
Copy link
Collaborator

@blazoncek I think my original PR is along the lines of what you are suggesting and only touched four files (I was following your guidance from Discord) but then I changed the approach based on the feedback from softhack above. Is there some version of what you are saying that addresses his concerns?

Unfortunately that's not the case. Json.cpp and set.cpp only need to set global doAdvancePlaylist and there is no need to add parameter to handlePlaylist() as you can access globals from within.

What @softhack007 said was that you must not call handlePlaylist() from within json.cpp as that is invoked from async web callback. That is also what I am saying above - let the flow continue, don't interrupt it.

Example:
json.cpp

doAdvancePlaylist = root[”np”].as<bool>();

handlePlaylist()

if (millis()-presetCycleTime > ... || doAdvancePlaylist) {
  doAdvancePlaylist = false;
...
}

And that's all there is to it.

@softhack007
Copy link
Collaborator

softhack007 commented May 2, 2024

deserializeState(...)

doAdvancePlaylist = root[”np”].as<bool>();

handlePlaylist()

if (millis()-presetCycleTime > ... || doAdvancePlaylist) {
  doAdvancePlaylist = false;
...
}

And that's all there is to it.

I fully agree - that's what I had in mind, too.

@freakintoddles2
Copy link
Author

ok thanks I'll update and resubmit once I get a chance.

wled00/json.cpp Outdated Show resolved Hide resolved
@freakintoddles2
Copy link
Author

freakintoddles2 commented May 2, 2024

@blazoncek @softhack007 ok I believe this is now updated with all requested changes. I read through https://github.com/Aircoookie/WLED/wiki/How-to-properly-submit-a-PR and figured out how to push changes from platform.io into this PR, but I just can't tell if I've missed any instructions. Please forgive any mistakes as this is my first attempt submitting a PR to WLED.

Copy link
Collaborator

@blazoncek blazoncek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your solution will achieve that doAdvancePlaylist will not become false but IMO it is not the the best way.
Overloaded operator | is technically the same as if (!root["np"].isNull())) doAdvancePlaylist = root["np"];

wled00/json.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@softhack007 softhack007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me now 👍

Copy link
Collaborator

@blazoncek blazoncek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too.
I'm sorry this took so many iterations, but I think it was worth it.

@blazoncek
Copy link
Collaborator

@freakintoddles2 if you would be so kind, could you update WLED Docs, as well? Please.

@blazoncek blazoncek merged commit 5ab1b14 into Aircoookie:0_15 May 3, 2024
18 checks passed
@freakintoddles2
Copy link
Author

@freakintoddles2 if you would be so kind, could you update WLED Docs, as well? Please.

Sure - I'll look at how to do that next

DedeHai added a commit to DedeHai/WLED that referenced this pull request May 5, 2024
commit ba337ab
Merge: 0b45f66 3f9a6ca
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun May 5 21:57:32 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 0b45f66
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun May 5 21:56:19 2024 +0200

    bugfix, sprayEmit() would not return and get stuck

    - forgot default return value...

commit 2558156
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun May 5 11:19:02 2024 +0200

    code cleanup, removed some unused stuff

commit ac5399a
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun May 5 08:18:43 2024 +0200

    Added advanced particle size control and new Blob FX

    - advanced size control allows for growing, shrinking, wobbling
    - render function updated to support asymmetric rendering
    - various code improvements and bugfixes
    - some FX parameter tuning
    - bugfix: removed sli() sei() calls in render function that caused random flickering on S3/C3 (may add that back in but only for ESP8266 to reduce fragmentation)
    - removed some debug / test stuff

commit 3f9a6ca
Author: Frank <frank.moehle@outlook.de>
Date:   Sat May 4 14:34:23 2024 +0200

    AR: fix for arduinoFFT 2.x API

    in contrast to previous 'dev' versions, the storage for windowWeighingFactors is now managed internally by the arduinoFFT object.

commit cd5494f
Author: Frank <frank.moehle@outlook.de>
Date:   Sat May 4 13:36:56 2024 +0200

    AR pin config: SCK == 1 --> PDM microphone

commit 5ab1b14
Merge: fa76431 379f181
Author: Blaž Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 23:25:36 2024 +0200

    Merge pull request Aircoookie#3946 from freakintoddles2/0_15

    Adds an API parameter to allow the user to skip to the next preset in a playlist at any time

commit 379f181
Author: Todd Meyer <todd.a.meyer@gmail.com>
Date:   Fri May 3 11:51:47 2024 -0700

    Further simplification

commit dd19aa6
Author: Todd Meyer <todd.a.meyer@gmail.com>
Date:   Fri May 3 08:47:14 2024 -0700

    Forgot F[], added it

commit 6df3b41
Author: Todd Meyer <todd.a.meyer@gmail.com>
Date:   Fri May 3 08:30:37 2024 -0700

    Updated based on more feedback

commit fa76431
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 16:08:20 2024 +0200

    Changelog update

commit 6504fb6
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 15:46:16 2024 +0200

    Minor MQTT optimisation.

commit 2ff49cf
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 15:45:15 2024 +0200

    Fix for Aircoookie#3952
    - included IR optimisations & code rearrangement

commit fa1aa1f
Merge: 85b95a2 22f6128
Author: Blaž Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 09:56:14 2024 +0200

    Merge pull request Aircoookie#3944 from paspiz85/pas4

    Using brightness in analog clock overlay

commit 85b95a2
Merge: 4df936a 736a8b1
Author: Blaž Kristan <blaz@kristan-sp.si>
Date:   Fri May 3 09:53:00 2024 +0200

    Merge pull request Aircoookie#3945 from w00000dy/Webpage-shortcuts

    Add Webpage shortcuts and Fix resizing bug

commit 5e38039
Author: Todd Meyer <todd.a.meyer@gmail.com>
Date:   Thu May 2 14:36:18 2024 -0700

    Updated based on more feedback

commit 4df936a
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Thu May 2 10:33:10 2024 +0200

    Fix for unfortunate prior CRLF coversion.

commit 736a8b1
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Thu May 2 10:31:50 2024 +0200

    Fix for rotating tablet into PC mode.

commit 22f6128
Author: Pasquale Pizzuti <produzionepp@infotelsistemi.com>
Date:   Thu May 2 09:04:07 2024 +0200

    using global brightness

commit db475b6
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:09:17 2024 -0700

    Update playlist.cpp

commit 6daf7f6
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:07:52 2024 -0700

    Update wled.cpp

    reworked based on PR feedback

commit 16086c0
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:05:26 2024 -0700

    Update wled.h

    reworked based on feedback from original PR

commit e88c81a
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:04:02 2024 -0700

    Update set.cpp

    reworked based on feedback

commit a2b9aed
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:03:16 2024 -0700

    Update playlist.cpp

    reworked approach based on feedback

commit caa4fe1
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:02:27 2024 -0700

    Update json.cpp

    reworked approach based on feedback

commit 25fb878
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Wed May 1 10:01:30 2024 -0700

    Update fcn_declare.h

    reworked approach based on feedback

commit 77167a2
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed May 1 13:53:59 2024 +0200

    Found and fixed crashes, it was wrongly assigned pointers

commit 3527144
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed May 1 12:08:03 2024 +0200

    Fixed another memory / pointer bug, but there is still one left...

    -also some minor fixes

commit 06ae14c
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed May 1 07:07:48 2024 +0200

    added 'perpetual' flag to particles

commit a1d6ffa
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Tue Apr 30 16:49:52 2024 -0700

    Update json.cpp

    adds support for np boolean parameter to skip to next preset

commit 3b89814
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Tue Apr 30 16:33:30 2024 -0700

    Update set.cpp

    added new NP command to API to allow user to skip to next preset in a playlist. Example use is win&NP in a preset.

commit 071e0be
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Tue Apr 30 16:23:43 2024 -0700

    Update fcn_declare.h

    Updated to add the optional skipNext bool to handlePlaylist() which allows people to skip to the next preset when desired

commit bed364d
Author: freakintoddles2 <todd.a.meyer@gmail.com>
Date:   Tue Apr 30 16:21:40 2024 -0700

    Update playlist.cpp

    Updated to allow a user to optionally skip to the next preset in the playlist anytime they desire.

commit d2984e9
Author: Woody <xaver@holzapfel.net>
Date:   Tue Apr 30 18:57:53 2024 +0200

    add Webpage shortcuts, resolves Aircoookie#2362

commit fd9570e
Author: Pasquale Pizzuti <produzionepp@infotelsistemi.com>
Date:   Tue Apr 30 17:52:35 2024 +0200

    using color_fade

commit ff10130
Author: Woody <xaver@holzapfel.net>
Date:   Tue Apr 30 16:53:47 2024 +0200

    Fix resizing bug
    The bug was that when resizing the window, it always jumped to the Colors tab instead of staying on the currently selected tab.

commit c7d292a
Author: Pasquale Pizzuti <paspiz85@users.noreply.github.com>
Date:   Tue Apr 30 14:09:12 2024 +0200

    using brightness in analog clock overlay

commit 5472f76
Merge: a6bf5b6 9f99a18
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Apr 30 07:50:44 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit a6bf5b6
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Apr 30 07:41:04 2024 +0200

    added walls to ghostride, fixed some bugs

commit 33ede41
Author: Damian Schneider <daedae@gmx.ch>
Date:   Mon Apr 29 19:46:19 2024 +0200

    Replaced Ghost Rider FX with PS version

    - new FX is kept close to original animation but added more user settings

commit 2e0cb3a
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Apr 28 19:29:57 2024 +0200

    Fixed some nasty memory bugs, fixed some FX parameters

    - fixed memory alignment bug in PS pointer assignment by making sure only multiples of 4 are allowed for particles and sources
    - added saturation back to particle struct, as it was aligned to 10 bytes anyway.
    - fixed a bug where a null pointer could be accessed
    - fixed rendering out of frame particles if buffer allocation failed
    - improvements on ESP8266

commit 3eb94eb
Merge: 53607d6 8110259
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Apr 28 11:30:44 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 53607d6
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Apr 28 11:25:57 2024 +0200

    added individual size particle rendering plus some fixes

    - advanced particles can now be rendered to individual sizes. It is computationally intensive but it works well for up to 15 very large particles and more smaller ones
    - added collision handling for individual sizes (walls and collisions)
    - fixed bugs in particlebox
    - fixed fire not transitioning properly (flickering) when frame skip is active
    - removed 'wraparound' function as it can easily be done by casting to an unsigned and then modulo
    - fixed ballpit particles wandering left and right very fast if wrapX is set

commit 7abc440
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Apr 27 13:40:38 2024 +0200

    removed zero inits

    - removed zero initialisations in FX, segment.data is set to zero by alloc function

commit 54e94dd
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Apr 27 13:18:30 2024 +0200

    Bugfixes, improvements and added wall roughness setting

    - fixed bug in PS fuzzy noise which made it asymmetric for some reason, seems to work better now
    - added particle size option to attractor but had to remove speed setting (now fixed emit speed)
    - some parameter tuning of FX
    - improvements to code size in render function
    - added smear option to blurring (not tested much, may be buggy without smear)
    - speed improvement to caldForce_dv, added zero checking.

commit a22466a
Merge: 3386a84 004b1c3
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Apr 26 08:56:07 2024 +0200

    Merge branch 'FXparticleSystem' of https://github.com/DedeHai/WLED into FXparticleSystem

commit 3386a84
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Apr 26 08:55:17 2024 +0200

    added local render blurring, boosting FPS, work in progress

    - changed fast-add function to use pointers
    - added fast-scaling function
    - added simple (but fast) 2D blurring function
    test shows that local blurring of full frame is almost double the speed (40FPS now is 80FPS).
    lots of comments still there

commit 004b1c3
Merge: e43f3bd e83d3cb
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Apr 25 15:50:07 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit e43f3bd
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Apr 24 17:33:02 2024 +0200

    bugfix in wrap function and firwork FX

commit 2e7fbc0
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Apr 24 06:39:30 2024 +0200

    debugging going on

commit 7b68946
Author: Damian Schneider <daedae@gmx.ch>
Date:   Mon Apr 22 18:52:13 2024 +0200

    in the middle of fixing FX to use new PS functions

commit e017814
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Apr 20 15:34:16 2024 +0200

    added more tests, non compiling at the moment

commit 856527b
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Apr 20 12:10:24 2024 +0200

    work in progress, added test function to increase particle size, also added wobbling test

commit 4146ff4
Merge: 50489f7 d126611
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Apr 16 19:32:14 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 50489f7
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Apr 16 19:29:05 2024 +0200

    work in progress, added motion blur and line attracto (non working)

commit f7337b9
Merge: 5e2dca3 d18f078
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Apr 7 13:39:23 2024 +0200

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 5e2dca3
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Apr 6 07:15:51 2024 +0200

    Fixed Speed limit

    limiting speed was incorrect, leading to overflows. fixed this.
    also fixed bugs in GEQ, removed some debug stuff, added FPS limit to fire (just en experiment)

commit 0a251ae
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Apr 4 17:51:32 2024 +0200

    another huge update, many improvements, fine-tune collision, fire and some other FX

    -removed classic fire render as palette now looks much better
    -tweaked fire parameters to more awesome
    -added (optional) turbulence to fire using perlin-noise
    -ported spray FX to use PS-class
    -now definitely fixed asymmetrical collision issue: do not use bitshifts on negative numbers!
    -changed piling behaviour of particles, full rework. looks way more natural now and works much better
    -changed bouncing behavour: they now bounce at full diameter, making them stay fully in frame when laying on the floor
    -replaced all relevant bitshifts with divisions for higher accuracy throughout the PS
    -added new modes to particle box FX
    -changed a lot of FX parameters (finetuning)
    -changed all config strings to proper settings (matrix only)
    -fixed newly introduced bugs
    -added speedup/slowdown to vortex FX (aka candy, aka rotating sprays)
    -some renaming
    -fixed bugs… lots of bugs
    -merged rendering functions, removed obsolete stuff

commit 32343ea
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Apr 2 20:26:24 2024 +0200

    updated fire, added some functions to PS, ported attractor FX

    - added turbulance to fire (after hours of fine-tuning) it now looks even more awesome
    - added attractor animation back in and improved it with more functionality
    - fixed the attractor function in the PS
    - renamed FX: 'candy' is now called 'vortex'
    - added new force function to apply a force immediately (and handle the timing in the FX)
    - added update function to PS for size update to handle dynamic segment size change
    - made waterfall width dynamic on segment width
    - removed some debug stuff
    - added #defines for maximum number of particles/sprays
    - updated fire parameter to make it look better on ESP8266
    - some little bugfixes

commit 59f2b9a
Author: Damian Schneider <daedae@gmx.ch>
Date:   Mon Apr 1 19:04:28 2024 +0200

    more bugfixes, some animation tuning, added volcano back in

    - fixed animation transitions with proper pointer setting in each FX call
    - added color by age setting to particle system
    - maybe fixed collision having a tendency to go to the left
    - fixed bugs in fireworks FX
    - added fire spread width as a slider
    - changed max number of particles and sprays based on some ram calculations
    - some other random fixes

commit 136f40f
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 31 17:42:48 2024 +0200

    More Bugfixes, more converted FX

commit 5f824c3
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 31 09:50:46 2024 +0200

    many (many!) bugfixes, added fire FX back in (and improved it a lot) added local renderbuffer for huge speed boost

    -lots of bugfixes in Particle system
    -added local rendering buffer (renders to buffer in heap)
    -added fast and accurate color-add function
    -bugfixes in render function
    -added improved 'sticky' particles in collision (unfinished business)
    -added ballpit animation back
    -lots of tweaks to fire FX and fire rendering functions, looks even better now (still unfinished)
    -added palette render option to fire

    still many debug print outputs around, needs cleanup at one point

commit 03967a9
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Mar 29 20:25:13 2024 +0100

    put particle system in a class. work in progress.

    another huge update to the particle system.
    went through the whole code, rewrote many of the functions. many improvements over the previous code. fixed many bugs (and even an ancient one in rendering function). spent many hours optimizing the code for speed and usability.
    still a work in progress, debugging is ongoing. more updates to come.

commit 162bdaa
Merge: c6d5d3e 85a51e6
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 24 13:07:57 2024 +0100

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit c6d5d3e
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 24 12:02:55 2024 +0100

    updated PS Fireworks with many changes and fine-tuning of parameters

    -removed spiral explosions
    -added more versatility to circular explosions
    -removed user selectable amount of rockets
    -tuned explosion size of circular explosions to match random explosions (more or less, may need improvement)
    -changed order of sliders in volcano animation

commit 500b847
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Mar 23 20:11:48 2024 +0100

    bugfix

commit 35c2157
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Mar 23 20:11:23 2024 +0100

    Big update: lots of little fixes and big speed boost on fire animation

    -fixed fire burning more on the left side
    -fixed crash in particle attractor
    -added many improvements for ESP8266
    -improved particle rendering efficiency
    -efficiency improvements in general
    -changed the way fire is rendered, now more than 2x faster
    -re-tuned fire to new rendering, also seperately tuned it for ESP8266
    -changed all random8() to random16() as it runs faster on ESPs
    -some reformating
    -some renaming of effect stuff
    -fine tuning on falling particle effect
    -improvements to collision handling (faster and better)
    -added a (temporary) function for speed tests, will be removed again

commit 306a850
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Mar 21 22:42:45 2024 +0100

    slight speed improvements in fire, like 1-2FPS

commit 913e910
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Mar 21 15:55:40 2024 +0100

    Particle FX Rename, default parameter tuning, bugfix

    -Now shorter names, 'PS' in front to filter the list
    -Tuned default parameters to make them look better by default
    -Bugfix in particle system (removed duplicate application of velocity)
    -reduced PS fire RAM usage (less particles, less base flames, no noticeable difference)
    -some variable renaming

commit 7026159
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Mar 19 20:17:13 2024 +0100

    Cleanup & Bugfixes plus major improvements for ESP8266

    -added particle reductions for ESP8266 for all FX
    -Removed collisions from Particle Perlin Noise FX, slows things down and does not contribute to a better effect experience
    -lots of optimizations for ESP8266, all FX now work (at least on 160MHz but still slow)
    -Some bugfixes
    -removed unused variables to make compiler happy

commit ff9d2eb
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 17 21:59:42 2024 +0100

    FX update

    - changed firework exhaust to low saturation
    - updated rotating particle spray animation

commit a56d888
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Mar 20 19:39:26 2024 +0100

    added rotating GEQ, work in progress

    -animation works but sliders are too sensitive. need to adjust the ranges

commit 7991776
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 17 15:41:46 2024 +0100

    GEQ  FX parameter tuning

commit ecc64ae
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Mar 16 11:43:22 2024 +0100

    Particle GEQ fixes, it now actually works

commit 87adbed
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Mar 15 20:52:47 2024 +0100

    added particle GEQ effect (untested)

commit bdfb1a9
Merge: 3678aa9 7b366d4
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Mar 12 21:48:34 2024 +0100

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 3678aa9
Merge: ac09218 88b30e7
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Mar 12 21:47:28 2024 +0100

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit ac09218
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Mar 12 20:45:52 2024 +0100

    cleanup

    removed / added comments

commit 4930cda
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Mar 12 20:17:02 2024 +0100

    cleanup session

    -removed particle box 'rocking boat' (buggy) and replaced with random sloshing.
    -removed comments
    -changed some variables into 32bit for speed boost on ESP32
    -added link to KB at the top of FX.cpp

commit 9c6d6f1
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Mar 10 22:35:13 2024 +0100

    cleanup

    -removed wrap_update function, now integrated into move_update
    -added more 'out of bounds' checking in fire functions, may speed it up a little

commit b99a62f
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Mar 8 19:23:52 2024 +0100

    removed comments, added comments

commit 66ac5ac
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Mar 8 18:14:59 2024 +0100

    Revert "fixed touch buttons for ESP32 S2 and S3"

    This reverts commit 0904155.

commit 62a975d
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Mar 8 18:14:52 2024 +0100

    Revert "some tuning for touch buttons on S2/S3"

    This reverts commit d21ad8e.

commit d01a151
Author: Damian Schneider <daedae@gmx.ch>
Date:   Mon Feb 26 18:20:07 2024 +0100

    add todo

commit 6740cb6
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 22 19:16:42 2024 +0100

    chaned rotating spray default parameters

commit 1a7ef9b
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Feb 21 20:26:17 2024 +0100

    updated rotating particle spray with more user options

commit d21ad8e
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Feb 21 18:38:34 2024 +0100

    some tuning for touch buttons on S2/S3

    now better fits the default threshold value of 32

commit 0904155
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 18 15:52:36 2024 +0100

    fixed touch buttons for ESP32 S2 and S3

    touch is implemented differently on S2 and S3, these changes make touch buttons work on S2 and S3

commit a775970
Merge: 241b080 21173dc
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 18 11:29:00 2024 +0100

    Merge remote-tracking branch 'upstream/0_15' into FXparticleSystem

commit 241b080
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 17 16:50:16 2024 +0100

    added particle WrapUpdate function, added spray FX, some bugfixes

commit 11a84c1
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 17 14:23:05 2024 +0100

    removed TODOs

commit 74ed705
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 17 14:19:56 2024 +0100

    updated particle attractor animation parameters and added more user options to perlin noise

commit 32979e5
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 17 12:50:20 2024 +0100

    lots of bugfixes

commit b96ad99
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Feb 13 17:00:42 2024 +0100

    changed particle pile demo into waterfall plus some tweaks

commit 46aef89
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Feb 13 06:47:35 2024 +0100

    Bugfix in particle push, now piling is working again

    particle pile-up did not work correctly, now fixed

commit dc5c58e
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 10 18:25:37 2024 +0100

    Fixed some bugs in particle system, runs much smoother now

    also tweaked some of the FX

commit 7c49f88
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 10 13:32:23 2024 +0100

    removed option for fastcolor add

    it made very little difference in performance, but for ESP8266 it may matter so it is set permanently there. graphically the difference is also very small (sometimes a particle gets brighter or less saturated)

commit da94d31
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 10 11:32:07 2024 +0100

    Improved collision handling (faster, less oscillations), changed variables to 32bit for faster calculation

    32bit variables are faster on ESP32, so use them whenever a variable is used a lot, it saves one instruction per access.

commit 8fe044e
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 10 08:14:34 2024 +0100

    added fix for piling oscillations

    untested, need to verify it works

commit f1ffbe0
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 10 07:35:45 2024 +0100

    improved collision efficiency

    improved efficiency for stackup (pushback), added code to correctly determine direction if particles meed (probably overkill but now its there)

commit e945faf
Author: Damian Schneider <daedae@gmx.ch>
Date:   Fri Feb 9 20:30:26 2024 +0100

    collision detection is now a function plus some improvements & fixes

commit d00126b
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 22:34:36 2024 +0100

    added option to use fast color add, may improve performance a little

    also fixed a bug in fire animation

commit 7d6965d
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 21:50:51 2024 +0100

    bugfixes in impact animation

commit 18c79ce
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 21:19:30 2024 +0100

    Added saturation to be set for each particle individually

    at the expense of more ram usage, animations now have more options for color control (already used in fireworks now)

commit a147a4b
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 20:40:21 2024 +0100

    added angle emitter, added fireworks effect using it

commit 7bc59c6
Merge: 7bcfcb4 6dcd959
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 18:34:16 2024 +0100

    Merge branch '0_15' into FXparticleSystem

commit 7bcfcb4
Author: Damian Schneider <daedae@gmx.ch>
Date:   Thu Feb 8 18:33:00 2024 +0100

    bugfixes, attracot now works

    still unknown, why more than 256 particles are needed in memory allocation to not make it crash, but it works for now

commit cc98036
Author: Damian Schneider <daedae@gmx.ch>
Date:   Wed Feb 7 19:48:54 2024 +0100

    added particle attractor, added two new FX but still buggy

    particle attractor animation does not work, somthing wrong with pointer allocation, it worked with static variables

commit 820d8dd
Author: Damian Schneider <daedae@gmx.ch>
Date:   Tue Feb 6 12:44:48 2024 +0100

    added preliminary functions and FX

commit 3b82219
Merge: a7ef020 0003845
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 12:46:26 2024 +0100

    Merge branch '0_15' into FXparticleSystem

commit a7ef020
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 12:40:37 2024 +0100

    updated particle box and firework effects

    particle box now is more random in random mode (still a work in progress)
    firework is now more configurable by sliders

commit 520a6d5
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:39:01 2024 +0100

    Update platformio.ini

commit 6165083
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:20:42 2024 +0100

    added latest version of functions

    this somehow also got lost from an earlier commit

commit c42e759
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:17:08 2024 +0100

    reformat

commit 3e8d079
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:15:58 2024 +0100

    added collision handling back in

    update from another commit that got lost

commit c320b0a
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:13:54 2024 +0100

    cleanup

commit 2db3123
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:04:04 2024 +0100

    removed comments

commit 45f2616
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sun Feb 4 10:02:46 2024 +0100

    added particle FX animations

    not yet final version but working

commit 538ffdb
Author: Damian Schneider <daedae@gmx.ch>
Date:   Sat Feb 3 10:45:34 2024 +0100

    Adding Particle System functions

    Basic Particle system defining particle structs, some emitters and particle to LED rendering
softhack007 pushed a commit to MoonModules/WLED that referenced this pull request May 5, 2024
Adds an API parameter to allow the user to skip to the next preset in a playlist at any time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants