Programmatical or sequenced animation/keyframing

Morning everyone!

Just thought I’d ask here because whilst I’d normally do a bit of a search for a tutorial, in this case I am not actually sure, what it is I’m looking for so I don’t really know what to use as a search term.

Basically, to explain the concept I have a scene with a lot of lights. In fact, here’s a mockup (sorry about the face):

The lights at the back are modelled based on the light tubes you get in office lights etc, and I wish to animate these in time to the music - so the lit tube will appear walk up the stack in time with the background music. In reality we’re just changing which tube is lit, working in groups of 4 because 4 beats in a bar of music etc etc.

Now I can do this, and I have done this manually, by effectively working out the tempo against the key frame and just basically changing the emission values for each tube on every ‘beat’. However it quickly gets cumbersome with a lot of lights.

It gets worse because I’m going to want to add moments where the lights go out of sync and start flashing erratically (as if broken).

Is there a way in blender to do this programmatically or more efficiently? Imagine if you were animating lights in an amusement arcades and the pinball machines had lights running around the outside of the enclosure, as an absolute animation idiot is there a better/more efficient way to go about this kind of work?

Thanks in advance
I’ve no idea what such a technique would be called so googles not helping :smiley: you’ll have to forgive me

Google bake sound to f curve
You can do multiple bakes based on the sound frequency - to isolate instruments.

Things like the lights around pinball machines are probably easiest in Geometry nodes - but the math / logic is beyond me… Or ‘old school’ you can have a pattern of lights that follow a curve modifier.

In the shaders there is a random socket on the Add > Input > Object info node.
So you can flash…

Random Color

The separate XYZ nodes is giving 3 different random outputs.
There is at least another dozen different thing you can be doing. Look for xmas lights / outdoor lights tutorials for ways to do patterns…

Hi thanks for your reply.

It’s taken me some head scratching but thanks for the bake sound to f curve idea, I’ve managed to sort of get something initially working so it’s something to play with, its still frying my brain but I am getting there :slight_smile:
Thank you very much