Creating a circular LFO

whitelobster's icon

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!

Christopher Dobrian's icon

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

Roman Thilenius's icon

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 :)

whitelobster's icon

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...

whitelobster's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

(edited by admin - use 'copy compressed')

roger.carruthers's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

Roman Thilenius's icon

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