Circle_Wave Node

john's Avatar

john

16 Apr, 2023 12:49 AM

NOTE: See below for an even better node: arc_wave.

A Nodebox user, edgeofinnerspace, asked how to wrap a sine wave around a circle. An excellent question!

Nodebox doesn't have a node that will do this cleanly. You could use the shape_on_path node with a sine wave shape generated by my waveform node, but this does not produce good results because the shape is only distributed around the circle; the shape itself (the sine wave) does not curve.

So I made a new node, circle_wave, that does.

Circle_wave takes four parameters:

  • Radius. The radius of the circle
  • Total Waves. The number of waves to wrap (an integer)
  • Amplitude. The height of the sine wave
  • Resolution. The fineness of the points (an integer starting at 1).

The resolution defines the number of individual points used to form the connected path. A resolution of 1 uses 360 points, 2 uses 720 points, etc. The higher the number, the cleaner the line (less bumps), but the longer the processing time. I find that a resolution of about 5 or so (1800 points) produces reasonable results for a small radius (say 200). Even with higher resolution the processing time will be almost instant for a single circle, but might matter more if you are plotting hundreds of circle waves.

I have only just started to play with this node, but it looks like a lot of fun. As you change the four parameters you can see some surprising effects. It could produce some interesting animations.

I just published version 3.2 of my library. It looks like I already have the first new node for my 3.3 release!

John

  1. 1 Posted by edgeofinnerspac... on 18 Apr, 2023 07:10 PM

    edgeofinnerspace's Avatar

    well, i may be feeding you ideas for that third dot release. i really appreciate all your insight. it is deep and it is wide. you are probably already one of the most valuable resources - i have in the short amount of time since i discovered your posts and node box your info has been more useful than any other words or software i've found. which matters a lot when you are a creator in a consumer society. you deserve much more recognition.

    i will give you a hint. well, a couple. insider info! i have another collection i'm drafting called "MandalaBox" which maybe i already mentioned. but this node right here. this is gold. this goes ack to when i was trying to figure out how to show my sheet music and guitar tabs as geometry and color instead of staffs and lines with fret numbers. i used to compose a lot of music but with no instrument in hand. i could work it out using the guitar tab feature in the program but i still cant read sheet music. however, the very first time i tried playing guitar (stairway to heaven) i was instantly more drawn to the music i heard in my head even over the song i was attempting to fingerpick the intro to. so i hopped on my computer in search of software to "type" those notes i was hearing onto the screen (i was thinking a word processor in my head but for the notes i heard) and that search led me to the only software i'd ever used.

    i was able to write and playback notes for all the instrument parts that i heard for the songs. and i would always see the fret numbers and lines denoting the guitar strings and think: "no way someone could ever play this stuff." and of course, sometimes, it would be years later that i would finally be good enough to get through one of my own songs on guitar! but having the software playing all the other instrument parts behind me kept me motivated! needless to say, for years, i composed and practiced along to my own stuff. haha.

    but i digress, my point is i guess if there is one, the music in my head and that im sure other composers would hear in their own when working on an idea, few realize, is STILL OUTSIDE OF TIME AND SPACE! i started composing and (as i am sure most others are) was a bit fearful of trying to go outside of 4/4 until i realized that last point.

    the music in my head was oblivious to numbers OR time. in order to be true to what i heard, i had to also discern its time signature. (and let me tell you a musical idea is much like a needy child but this child raises the parent. you dont know what it needs. the IDEA knows what it needs.) when i stepped into the true rhythm of the ideas, y writing took off and rarely happened in 4/4. this is why i always wrote without an instrument. because my ego would always mess it up and i would then struggle to remember the original tune. almost as if i had scared it away.

    i've always wanted to translate it back to a fundamental representation visibly because i just want to SEE what these odd time signatures would look like. and i know there is a way because cymatics is already doing this. and that obscure world is the true underlying structure of all this. i just always got stuck trying to unravel the mystery of how is rhythm (which i assume i could represent as one bar encircles a center point with each beat or kick drum for example, and snare, or hi hat, etc, as a point further or closer to the origin.) could be shown in the same output as that same bar of harmony (which i thought would be also, a bar of harmony with each note higher or lower, further or closer from the origin) and one bar of the melody too,

    i can see from the above you could use something like points, lines, clouds (of color) and shapes one top of those points, straight lines connecting points, and circular waves (scalar waves) as non linear points.... but, *out of breath* thats where my head always started spinning.

    ok your reward for making it through all that: soe of my old compositions. and this is fun too because i always composed in MIDI! (nedless to say, i got very excited when i saw the article and downloads for the midi stuff in the node box docs - only to find the rectangular output like you see on a piano roll notation)

    "The Fallen Apart (Music Box March)" and "The Ruins Inside" are unfinished.
    The first one sounds like a waltz (3/4) but that part is actually 11/8. the chorus riff is a 5/4 which is the heavier sounding chord progression. The second has a verse riff is

    | 13/8 | 13/8 | 13/8 | 12/8 || and the 'prechorus' riff is | 6/4 || followed by a chorus whic h is:

    | 13/8 | 11/8 | 13/8 ||

    "Recollect to Reinforce" is fun it is:
    VERSE
    | 13/8 |
    PRECHORUS
    | 7/8 | 4/4 ||
    CHORUS
    | 4/4 ||

    enjoy.

    oh and here is one on youtube (still comes directly from the midi events)
    https://youtu.be/rw006Q-s8t4

  2. 2 Posted by edgeofinnerspac... on 18 Apr, 2023 07:16 PM

    edgeofinnerspace's Avatar

    i'm separating these because uploading gave me some trouble.

  3. 3 Posted by edgeofinnerspac... on 18 Apr, 2023 07:19 PM

    edgeofinnerspace's Avatar
  4. Support Staff 4 Posted by john on 19 Apr, 2023 09:54 PM

    john's Avatar

    Edgeofinnerspace, all,

    After further thought, I realized I could make a more general purpose node: arc_wave (demo and screenshot attached).

    arc_wave replaces circle_wave. It does the same thing, except it allows you to specify the starting angle and degrees of an arc for your waves to follow.

    If you set the degrees to 360, it will make a circle wave just like the old circle_wave node. As an added bonus, you could also set a starting point and direction (-360 or 360). Visually this would look the same, but might matter in certain applications.

    OR you could choose to wrap your sine wave around a shorter arc. This opens many more possibilities. I will put arc_wave in the next rev of my library instead of circle_wave.

    Enjoy!

    (I will respond to Edge's other comments in a separate note.)

  5. Support Staff 5 Posted by john on 19 Apr, 2023 10:17 PM

    john's Avatar

    Edgeofinnerspace,

    Thanks for your comments and amazing music - I found it all fascinating.

    I don't know much about music theory and have never actually used a MIDI synthesizer, so can't be of too much help with you there. But I am experienced at data visualization and absolutely agree with you that you could use points, lines, colors, shapes, and circular waves to visualize the patterns in your head. Nodebox is the ideal tool for that.

    My wife plays guitar and she listened to your music with interest. She says even the musicians who use the traditional rectilinear way of representing music understand that it is flawed and limited. The cyclical nature of music might indeed be better suited to represent musical rhythms; the only reason it's not used is that it's harder to draw, and print, and place on music stands.

    But it's easy to draw circles - and circular paths - in Nodebox. There's an interesting parallel to math: polar notation where you use radius and angle instead of x and y. In fact I used polar notation to construct my circle_wave and arc_wave nodes.

    I hope you will continue to experiment with this and explore different ways to draw aspects of your music. You might also explore animation as a way to develop even richer visualizations.

    Keep creating!

    John

  6. 6 Posted by edgeofinnerspac... on 07 May, 2023 04:43 PM

    edgeofinnerspace's Avatar

    Yea, I still have a lot of trouble understanding how to even get the animation or frame node to work correctly, or rather, how to implement it correctly. And the count nodes. I don't know that I wold ever have time to pursue the musical notation like I want to using this node. But i am definitely using it for something else! No spoilers though. :P

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • circle_wave_screenshot.png 298 KB
  • circle_wave_node_demo.ndbx.zip 1.54 KB

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

15 Jul, 2024 07:37 PM
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