Congarou's Avatar


25 Feb, 2023 01:34 PM

Hi y'all!
I'd like to make a sort of lfo to output an oscillating (various wave) value within a range.
In particular I would like to make a line that "scan" the whole canvas.
How can I do that?


  1. Support Staff 1 Posted by john on 25 Feb, 2023 08:56 PM

    john's Avatar

    Hi Congarou,

    Nodebox has a node for this: wave.

    It can produce sine waves, square waves, triangle waves, and sawtooth waves. You define min and max values for the amplitude, the period, then an offset along the X axis. For any given offset, wave will return the height of the wave, which you can then plug into other nodes to draw shapes or make sounds.

    In my Cartan Node Library I have another node, waveform, that takes the same values but, instead of a single offset, lets you provide start and end values for X. It then produces a path for that segment of the wave. By setting the start and end appropriately you can make the wave span the entire canvas or beyond.

    Is that what you were asking for? If so, please confirm. If not, please explain in more detail what you are trying to do and I will try to help.



  2. 2 Posted by Congarou on 09 Mar, 2023 12:28 PM

    Congarou's Avatar

    Hi John!
    Sorry for the late reply!
    Thats exactly what I was looking for, but I would need to reset the wave, so the image is moving from left ot right of the screen and when it reach the end it restart from the beginning.
    Hope it's clear:
    Thanks a lot!

  3. Support Staff 3 Posted by john on 10 Mar, 2023 12:46 AM

    john's Avatar

    Hi Congarou,

    There are several different ways of making a waveform move across the screen. The attached demo shows two of them.

    In the first (top) case I simply use the frame node to move the start and stop points of a waveform to the left while simultaneously scooting the wave itself to the right. When you hit Play you will see the wave moving from left to right across a space defined by the values in the two subtract nodes (in this case -200 to 200).

    You can change any of the waveform settings as the movie is playing to see the effect: min, max, period, and type (sine, square, triangle, sawtooth).

    The second (bottom) example shows how to create a line with single wave (a "blip") that moves across an oscilloscope screen. I do this by splicing a horizontal line segment before and after a single wave, moving the combined path horizontally to the right, and using the mask node to only show the area inside the screen. You can adjust the speed by multiplying the frame node.

    To make this look right you will need to chop your wave neatly so that it starts and ends on the horizontal signal line. You will also need to use line segments longer than the width of the screen and a mod value greater than the screen width plus the wave width to ensure a smooth motion without any visible jumps when each cycle repeats. Experiment with the settings to get a feel for this.

    Please let me know if this is what you need!


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

13 Jul, 2024 06:05 AM
11 Jul, 2024 03:48 PM
28 Jun, 2024 01:51 PM
27 Jun, 2024 02:56 PM
27 Jun, 2024 01:57 PM


26 Jun, 2024 08:17 PM
26 Jun, 2024 11:35 AM
24 Jun, 2024 02:42 AM
24 Jun, 2024 12:46 AM
23 Jun, 2024 08:07 AM
08 Jun, 2024 09:05 AM