Lottie animation controlling parameters?
-
@Chazrox Exactly, that's because I have the timer code (last line at the bottom). If you remove it, then the lottie knob no longer controls the synth. I left it in so you could see it working first so you can remove it and see what happens.
-
-
@Chazrox Functionally yes, but visually no. Your code does not change the lottie image. And you mentioned removing the timer but in my code it does not functionally work without it. That's all.
-
@Mickolos Why do you need two knobs?
-
@d-healey 1 = because if I link my lottie knob to the parameter I want it to affect then it stops controlling the lottie. 2 = I could not get Cristoph Hart's code he posted here in 2019 to work for me. So I thought if I could get the get a knob that is controlling the parameter to mirror the position of the lottie knob, then hide the non-lottie knob it would be good enough for me. I understand this is a bit of a hack, it's just what worked for me so I thought I'd share it in case someone found it useful.
-
@Mickolos said in Lottie animation controlling parameters?:
because if I link my lottie knob to the parameter I want it to affect then it stops controlling the lottie.
Use the knob's callback along with
setAttribute
instead of parameter/processor ID.I have a video here about using lottie with a hidden knob
And this video all about knobs
-
@d-healey I did. The lottie video is great but does not show how to link a knob to an actual parameter. And I watched the other video which is good for connecting knobs together but I could not figure out how to combine code from each, believe me I tried, I spent about 5 hours on it. - Again, as I said this is just a hack I found. My coding skills are not yet developed enough to decipher code from multiple videos and combine them into a specific feature I'm working on. But I'm making decent progress so I'll revisit the playing with sliders video again when my understanding of it improves in the future.
-
@Mickolos The solution is much simpler than the code you've already written :) It's basically just adding one line.
This is your knob callback
inline function onknbLottieControl(component, value) { pnlLottie.setAnimationFrame(value); }
Within this same callback you use
setAttribute
to control your module.inline function onknbLottieControl(component, value) { pnlLottie.setAnimationFrame(value); WaveformGenerator1.setAttribute(WaveformGenerator1.WaveForm1, value); }
The only extra thing you need to do is get a reference to the waveform generator within
on init
- HISE will create this for you if you right-click on the waveform generator module's header and select create generic script reference. Put this near the top of your script:
const var WaveformGenerator1 = Synth.getChildSynth("Waveform Generator1");
-
@d-healey I had to add ``` for the Knob to control the "processorid" - "paramaterid".. to get things to work :)
Wave_Knob.changed(); // update value
-
@Brian said in Lottie animation controlling parameters?:
I am currently experimenting with controlling Lottie animations using sliders, but once I set up the knob to control a parameter I lose the connection with the Lottie animation. I am sure there is a way to have all three of these elements linked but it's beyond my current coding skills.
Here is a test project ( latest Scriptnode build and rLottie DLL needed):
Got it — thanks for explaining what’s happening. From what you describe, it sounds like you’ve successfully set up a slider/knob to control a parameter, but in the process the link to the Lottie animation playback got overridden (likely because only one connection is being made at a time instead of merging them).What you probably need is a single control signal that both the Lottie animation and your knob/slider can “see.” In Scriptnode (and similar node-based systems), this usually means:
Don’t directly replace the Lottie’s input with the knob.
Instead, use a merge/multiply/mix node (or equivalent) to combine the knob value with the animation’s internal time parameter.
Feed that merged output into the Lottie node, so the animation continues to play but is also scaled/offset by your slider.
Another approach:
Use the knob to control animation progress directly (frame / totalFrames), bypassing “playback.” That way the knob defines where in the animation you are, and you don’t depend on Lottie’s internal clock.
If you want both free playback and manual knob scrubbing, you’ll need logic that chooses between “auto-time” and “knob-time” (for example, a switch or crossfade).
If you share your node setup (or a screenshot), I can suggest the exact node combination to keep all three elements linked.