# Waveform

As a newbie I was frustrated by the wave node. It's a simple mathematical function: give it an X and it will spit out a Y. But I wanted and expected to actually see the different kind of waves.

Of course you can see them by hooking a range node to the wave node, turning the X and Y values into points, and connect those points. This gives you a decent approximation, but it was not immediately obvious how to do this at first. It's a pain to have to do it each time. And, as a purist, I don't want an approximation with hundreds or thousands of tiny line segments; I want the real thing!

Hence, the waveform node. This draws the same four wave types as the wave node (sine, square, triangle, and sawtooth) across whatever X values you want. And it produces clean, efficient, precise paths.

This is actually rather hard to do. It's mathematically impossible to draw a true sine wave using bezier curves, but you can come close enough that no one can tell the difference. The other three waves are simpler but a tad tricky because of various corner cases. For easy viewing, waveform produces continuous paths even for the discontinuous square and sawtooth waves; it would not be hard to remove the vertical segments if need be.

I am not sure how useful this node really is, though sine waves can be quite beautiful when rotated or overlaid in various ways. It can also help you more quickly understand the best min, max, period, and range of X values to use with the wave node when doing animations or music synthesis. You could also make a nifty oscilloscope with this node if you wanted.

Requires my make_curve.py custom node (included). The zip file also contains a little animation I made using sine waves.

Enjoy!

John

- waveform_screenshot.png 309 KB
- waveform.zip 1.91 MB

# 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