Formula to move a source forward every Xth beat

71 views
Skip to first unread message

Mathieu

unread,
Oct 5, 2025, 6:48:57 PMOct 5
to Lightjams
Here's a handy formula to move a source forward on every Xth beat. 

let( beatDivisor, 4, // move forward every Xth beat
signal, music.1.beat, // the input for the beat detection, like an audio band
xtopercent(floor(counter( 0,
(grid.lastx+1)*beatDivisor-1,
onbeat(trigger(signal,0,10,30,0.2)), // clean the signal with the trigger and detect beats
0,
grid.onactivated // reset the counter when the grid is activated
)/beatdivisor)))

Use this formula for the X slider of a source. Replace the music.1.beat by your signal.

Jeff Drees

unread,
Oct 18, 2025, 11:08:26 AMOct 18
to Lightjams
Hey Matt and all, 

I am long time user of lightjams. I read all of the posts here, thanks to everyone using lightjams and solving problems together. Thank you Matt for always coming through with solutions. 

This brings up a common issue I have. How would I fade this function between steps? I know I could use the grid fade feature but I want to be able to change the fade on the fly, ideally connecting it to my global fade sliders that are connected to midi controls. Is there a way to use the fade function on the grid activation and have the formula for the x moving reset the grid with each step? I am specifically trying to fade hue. 

I think one solution, that I see you suggest often, would be to have each set of hue attributes in their own grid and create attribute and then make a sequencer by moving a source along the x axis. Then each activation slider for each separate grid would be connected to my global fader slider. Would that be the same issue I am having now? 

One solution I see would be a new feature. My idea is to make the grid fade feature at the top of each grid more like the other features of lightjams. Have it able to controlled by a formula, midi, etc. I know that would be a fair bit of coding and a lot of debugging though.  

Thanks, 
Jeffrey Drees 

Here are some examples of how I use lightjams if anyone is interested. 

Mathieu

unread,
Oct 18, 2025, 11:49:14 AMOct 18
to Lightjams

Hi Jeff,

You can set the fade in and out time of a grid with a formula by using the grid.fadeintime(time) and grid.fadeouttime(time) functions. This way, you can use the value of a midi control to set the fade times. You need to use these functions in a source that is on the grid you want to control.

Let me know if this is what you were looking for.

Daniel Profir

unread,
Oct 26, 2025, 10:28:38 AM (10 days ago) Oct 26
to Lightjams
Hi all,
I’m new user of Lightjams and I try to learn how to use this complex program. This forum helped me a lot to start to make the lights ‘dancing’.  I done some testing projects. I appreciate some suggestions, critics too. 
I uploaded few samples on YouTube and few people view them. I don’t know how many supposed to be (in 4 days was 3.9k). Also this is first time when I use YouTube. 


Please let me know your thoughts. And I am sure I will have a lot of questions to ask in the future.

Have a nice day/night :)
Daniel  

Mathieu

unread,
Oct 27, 2025, 9:25:37 AM (9 days ago) Oct 27
to Lightjams
Hi Daniel,

You are really good actually! It's pretty entertaining to watch.

Daniel Profir

unread,
Oct 29, 2025, 3:47:47 AM (8 days ago) Oct 29
to Lightjams
IMG_9947.png
Thank you. 
It looks like people are interested in this. 


Reply all
Reply to author
Forward
0 new messages