Synced animations

Hi, is there anyway to sync LED animations? If I start different animations at different times, they all run indepependently of each other whereas I’d like them all to sync up and operate on the same cycle.

thx

2 Likes

Curious about this as well. It would be nice if there were a way to keep LED animations phase-aligned.

1 Like

Hey guys,

Maybe using the system timer might be useful for this purpose? I wanted to try this out to learn how it works, and I managed to create a custom animation (saw up) with resync. I’m not sure if this will be useful, but here’s what I’ve got so far:

I’ve uploaded it to my profile cloud (if that helps) grid-editor://?config-link=v14X21qlKGmAEYKdnapy

Apologies for any code mistakes—I’m still very new to using the grid editor!
Cheers

I’ve updated it with a global shape variable so we can select the animation waveform (on System Setup)

shp =
0 - Saw Up
1 - Saw Down
2 - Pulse
3 - Sine

Cheers

3 Likes

Any possibility of just posting the relevant code snips here? The grid:// link doesn’t work. Also, if it’s posted in a public profile, I don’t see anything relevant. Lots of random stuff in there.

Much appreciated!

hey, sure!

I can post here, is there any way to share it like a file? it would be cool.

-- On System SETUP
ms = 10
shp = 3
ramp = -1
function reset(x)
    if x > 0 then
        ramp = -1
        timer_start(16, ms)
    elseif (x <= 0) then
        ramp = -1
    end
end
-- On System UTILITY 
ms = math.max((ms + 10) % 40, 10)
-- On System TIMER 
timer_start(16, ms)
ramp = (ramp + 1) % 128
function wave(r, t)
    return t == 1 and 127 - r or t == 2 and (r < 64 and 127 or 0) or
        t == 3 and math.floor((math.sin((r / 127) * 2 * math.pi - math.pi / 2) * 63.5) + 63.5) or
        r
end
for i = 0, 15 do
    led_value(i, 1, element[i]:button_value() > 0 and wave(ramp, math.min(shp, 3)) or 0)
end
-- on every button you want the animation - I have BU16 
reset(val)

Shp global variable range is 0…3, (saw up, saw down, pulse, sine).

The problem I see, there is not much room for coding more things due to the 400 character limit.

Hope this helps,
Cheers!

1 Like

You can save the profile in the Grid Editor. Just make sure to save it in the 'Community ’ section of the cloud profiles. I believe the link you shared would work if it were under the correct section. Your link is sharing a ‘My configs’ profile which would be private :slight_smile: :

1 Like

thanks!

Yes, I’ve tried uploading it to the cloud, making it public, etc. But I can’t get it in the community section. Maybe there is a step that am I missing?

Thank you again!

Unsure. I don’t have any profiles to share. Mine are all hyper-specific to my setup so I’m not familiar with the process of posting them publicly.

1 Like