Waveform

john's Avatar

john

18 Jul, 2019 10:05 AM

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

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

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

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

24 Aug, 2019 03:14 AM
11 Aug, 2019 01:17 PM
08 Aug, 2019 04:13 AM
02 Aug, 2019 09:27 PM
18 Jul, 2019 10:05 AM

 

12 Jul, 2019 10:39 PM
08 Jul, 2019 12:47 AM
06 Jul, 2019 02:12 AM
29 Jun, 2019 10:13 PM
29 Jun, 2019 10:17 AM
26 Jun, 2019 08:54 AM