How To Generate Very Slow Travelling Waves?

233 views
Skip to first unread message

Mathieu

unread,
Dec 4, 2015, 12:54:54 PM12/4/15
to Lightjams
You can easily generate a travelling wave by using the source's delay. However, the maximum delay is 0.23s. per cell. So if you have a 10x10 grid, the maximum delay for the last cell is 2.3 seconds.

What if you want the wave to go slower?

Here's a trick using the somewhat hidden t variable. It represents the global time in radian*second. This means we can use it with a function like map.sin (you can also use the other map.X functions, like map.triangle, etc.) to generate a wave.

For example, try this formula for the source's power:

map.sin((t/twopi*100)/20+px)

Then enable the shader mode for your source, set the range to 100% and delay to 0.

(t/twopi*100)/20: Corresponds to the speed. In this case, one cycle takes 20 seconds.If you divide by 30, one cycle will take 30 seconds.

+px: Controls to the delay. px is the horizontal position of a cell in percent. So the last cell has a px of 100%, which results in a delay of one full cycle.


Try map.sin((t/twopi*100)/20+3*px) to generate 3 waves.

I've included a little sample project to ease exploration.



Enjoy!

Mathieu
slow-travelling-waves.ljp

booiji...@gmail.com

unread,
Apr 30, 2019, 8:03:25 AM4/30/19
to Lightjams
Hello Mathieu,

I'm using your traveling wave for a project where multiple lamps are hanging in the air. It works perfectly and I adjusted it to my specifics.

Now I want to make one full wave through the lamps, in total 12 lamps, that have cold and warm Leds in them. With the wave they change from cold to warm in a continuous cycle.

As an addition I would like to have a small pause of a few seconds between every cycle. I have been playing with increasing the size of the grid so it takes more time before the wave hits the fixtures but this is not perfect and because the grid gets bigger the wave almost overlaps all my fixtures. 

This is my current formula:
map.triangle((t/twopi*100)/120+-0.75*PX)

I tried to ad a delay() but I'm not sure where to add it in the formula, do you have an idea?

Hope to hear from you.

Rick

Mathieu

unread,
May 1, 2019, 4:11:26 PM5/1/19
to Lightjams
Hi,

Here's a sample project showing a travelling line that makes a pause. See the notes in the project for more details.
test travelling line.ljp

booiji...@gmail.com

unread,
May 2, 2019, 5:27:05 AM5/2/19
to Lightjams
Hi there,


So from sawtooth(10): the '10' is the time, in seconds?

Now I try to change the pause time, what do the -50 and 250 mean relating to the formula and field? I have been changing them to decrease my pause to a few second but a lot of things happen except for what I want.
Is the -50,250 related to the seconds? Field size or?
The formula: scale(value, min, max, toMin, toMax)
Filled in:        scale(sawtooth(10),0.-50 (is this the min),250 (is this the max?))

Now I try to work with triangle( ), If I insert this in the formula: 'mem(0,scale(triangle(10),0.-50,250))' It returns from the end of the grid after every cycle instead of starting over in the start like the sawtooth does.
Can you explain why I can not change the wave shape like this?

Can you explain why I need to add a second source with the restrain()?

Is there from Lightjams a guide for all the formulas, what they can do, what all the commands are and how to combine them?

I'm just jumping into it but cannot  find a logic between all the things...

Thanks in advanced.


Op woensdag 1 mei 2019 22:11:26 UTC+2 schreef Mathieu:

Mathieu

unread,
May 2, 2019, 6:23:30 AM5/2/19
to ligh...@googlegroups.com
Hi,

The documentation for the formulas is here: https://www.lightjams.com/commandline.html

>> -50 and 250 mean relating to the formula and field

It scales the sawtooth to be outside the grid for some time to create the pause. So when the value is -less than 0, the wave is before the start of the grid and when it's over 100%, it's on its way to get out of the grid. The scale function can take only 3 parameters to mean scale from a percent range. So scale(....,0,100, -50,250) is equivalent to scale(..., -50, 250). It's an old shortcut I use but if you prefer, use the long form.

It's already generating a triangle wave. The sawtooth is generating a position that the 2nd source uses to generate the wave value at every cell. Since the wave value is based on the distance to the sawtooth, it generates a triangle wave. A 2nd source is used to avoid computing the same sawtooth for each cell (performance optimization).

Jeremy Koz

unread,
Oct 11, 2019, 2:05:01 AM10/11/19
to Lightjams
For the wave I want to create a rainbow hue. How do I make it so the colours are following one another?

Mathieu

unread,
Oct 11, 2019, 8:08:09 AM10/11/19
to Lightjams
Hi,

If you put hue attributes on a grid and use the formula shown in this discussion, you'll get a kind of slow rainbow wave.

Reply all
Reply to author
Forward
0 new messages