> For the complete documentation index, see [llms.txt](https://codalin.gitbook.io/nodalin-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codalin.gitbook.io/nodalin-docs/nodes-reference/streams/wave.md).

# Wave

<table data-header-hidden><thead><tr><th width="141.6597900390625"></th><th></th></tr></thead><tbody><tr><td><div><figure><img src="https://937151318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44MuVIHBk5o5yfcGn64w%2Fuploads%2FazbCWKHOk3622ENkWcuF%2Fimage.png?alt=media&amp;token=11d8c833-2c73-45bd-b0f1-93226d8ebdf6" alt="" width="76"><figcaption></figcaption></figure></div></td><td>Generates oscillating waveforms you can use to animate or modulate properties. Outputs a value of the datatype <code>number</code>.</td></tr></tbody></table>

## Waves in a Nutshell

If terms like *sine*, *cosine*, *oscillation*, or *LFO* sound intimidating or unfamiliar, don’t worry — here’s the simple version.

A Wave node constantly outputs a value that goes up and down over time. It increases until it reaches a maximum, then decreases until it reaches a minimum, and repeats this motion forever. That up-and-down motion forms what we call a *wave*.

<div data-with-frame="true"><figure><img src="https://upload.wikimedia.org/wikipedia/commons/4/41/AC_wave_Positive_direction.gif" alt=""><figcaption></figcaption></figure></div>

A wave’s behavior is defined by a few key properties:

* Amplitude: how large the wave is (how far it moves from its center).
* Frequency: how fast the wave completes a cycle (how quickly it goes up and down).

The math behind waves goes back more than two thousand years, but for Nodalin you only need the basic idea above.

To keep things intuitive and beginner-friendly — and to avoid confusion with audio synthesis terms — the Wave node uses `size` instead of amplitude, and `duration` instead of frequency. They work the same way, but the names emphasize what they *do*.

### Use cases

* Animate the size of a Square node with a smooth sine wave
* Rotate shapes by using a triangle wave as an angle source
* Multiply a Wave node with a Number node to adjust or scale its amplitude

<table><thead><tr><th width="154.53125">Property name</th><th width="404.95703125">Description</th><th>Compatible datatype</th></tr></thead><tbody><tr><td>size</td><td>Amplitude → The distance from the center-line (equilibrium) to a peak or trough.</td><td>number</td></tr><tr><td>duration</td><td>Frames per wave cycle</td><td>number</td></tr><tr><td>phase</td><td>Phase offset</td><td>number</td></tr><tr><td>offset</td><td>vertical offset</td><td>number</td></tr><tr><td>stream</td><td>Stream of values to pass as input to the wave</td><td>number</td></tr><tr><td>wavetype</td><td>sin, cos, square, triangle, sawtooth, and random</td><td>text</td></tr></tbody></table>

<figure><img src="https://upload.wikimedia.org/wikipedia/commons/7/77/Waveforms.svg" alt="" width="375"><figcaption><p>Common wave types: Sin, Square, Triangle and Sawtooth</p></figcaption></figure>

### Example Projects

There are tens of example projects that use the Wave node, but here are a few simple examples to get you started:

[**Voxel Voidin**](https://app.nodalin.xyz/project/d3a82798-2e81-46c9-a5af-d23dd1bb227a)\
A simple demonstration on how you can use a couple of Wave node to create a perfect cyclic motion.A single Counter node (next chapter) is connected as stream to both Wave nodes assuring the are in perfect sync.\
\
[**5th Wave**](https://app.nodalin.xyz/project/d86b7cbe-3a57-4c27-8628-e53e58d33ad6)\
Using a couple of Wave nodes with different durations and phase to create organic motions.

## Tips

#### Offset is your friend.

If you want a Wave node to oscillate without dipping into negative values — for example, when driving a shape’s size — set a small size value and a meaningful offset.

Example:

If your shape should stay around 150px but pulsate slightly, set the following properties:

* Size: 50
* Offset: 150

The wave now oscillates between 150 – 50 = 100 and 150 + 50 = 200, giving you a smooth pulse without shrinking to zero.

#### Try combining Waves.

You can create far more complex motions by chaining Wave nodes:

* Connect one Wave node into another’s stream input
* Use one Wave to modulate another node’s duration, creating time-stretching / time-compressing effects

#### Feedback loops are allowed — and powerful.

You can create recursive, self-modifying oscillations by feeding a Wave node’s output back into one of its own properties.

A simple way to do this:

1. Connect a Wave node to a Number node
2. Feed the Number node back into the Wave node’s size, duration, or offset

It may seem unusual, but several of our example projects use this technique to create complex evolving motions.&#x20;
