## Creating a circular LFO

Sep 28, 2012 at 5:13pm

# Creating a circular LFO

Hello, I am trying to create a circular LFO that I can eventually use to modulate parameters in Live, however I am having some simple mathematical difficulties and am confused as to what the best way to achieve this within max would be.

Basically I just want an oscillator that traces the contour of a circle over and over again. My goal ultimately is to be able to hook this up to two parameters so say you hook up the X coordinate being drawn to effect the gain of an EQ point, and the Y coordinate being drawn to the frequency of the EQ point- you get an automatic version of grabbing an EQ point and moving it around in a circle.

If anybody could point me in the right direction of any objects I should start playing with to achieve this or any simple mathematical formulas for tracing the contour of a circle on an x y grid that would be extremely helpful.

Thanks!

#64538
Sep 28, 2012 at 5:38pm

Maybe I’m not understanding you, but I think what you want is a cosine and a sine.

#232792
Sep 28, 2012 at 5:53pm

it is easier if you leave out that “tracing” stuff, and only have a circle GUI which is driven by in fact two simple cosine LFOs (and not the other way round)
for the GUI i would draw a little dot using the “paintoval” message to an [lcd] object, and for the number-LFOs [line] and [cos] are your friends.

-110

p.s. this is the gen forum :)

#232793
Sep 28, 2012 at 6:34pm

Hi Roman,

That makes perfect sense, but how can I setup the two cosine LFOs to work in sync to ‘draw’ the circle? I know that my way of thinking about drawing the circle is somewhat backward however I am not sure how else to know that I have gotten them in sync and that they aren’t just wobbling around all over the place if that makes any sense…

#232794
Sep 28, 2012 at 7:09pm

So far I’ve gotten this far, but cannot figure out how to configure it to actually draw perfect circles… any ideas?

– Pasted Max Patch, click to expand. –

(edited by admin – use ‘copy compressed’)

#232795
Sep 28, 2012 at 7:29pm

Like this?
Tip – use Edit/Copy Compressed!
Cheers
Roger

– Pasted Max Patch, click to expand. –
#232796
Sep 30, 2012 at 3:05am

how to get them in sync? … by using the same [line] object for both LFOs.

in your case: * -1 (or + 0.5, % 1.) for the second cosine should do it.

btw, you are right, of course there is the problem that [line] will have a certain
interval, for example 25 milliseconds – and that doesnt give you a perfect circle
when just writing those coordinates to an lcd (depending on the way you
want to represent it graphically. for a bigger dot it might be no problem.)

so if that is an issue here, i´d pull back my suggestion to write the “cosines”
directly to the GUI but use carthesian(the line´s 0-1 output)-to-polar mapping instead.

actually, you could go one step further and make a signal-rate LFO – and a line-based
one with some 40 ms grains in parallel which is just doing the graphics.

-110

#232797

You must be logged in to reply to this topic.