LFO?

Congarou's Avatar

Congarou

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?

Thanks!

  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.

    Thanks,

    John

  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!
    Best!

  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!

    John

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

Generic

? 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

26 Jan, 2025 02:09 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM

 

21 Jan, 2025 09:36 AM
21 Jan, 2025 02:00 AM
16 Jan, 2025 08:30 PM
15 Jan, 2025 06:37 AM
04 Jan, 2025 04:09 AM
03 Jan, 2025 05:32 PM