• ### fractals with expr?

does anybody know how to write for example this formala into the expr object: c=(((c²+c)²+c)²+c)²+c ? its the fourth iteration of a fractal. this is the first iteration: c=c and this is the second c=c²+c. my second question is if there is a formula to get the first, secont, third iteration etc.. i hope my mathematical terms are correct and understandable

• Posts 23 | Views 10763
• @Jona Looks like Mandelbrot to me....... mandelbrot.zip
But no, I forgot all that 40 years ago.
Apparently - "The recursive equation behind this fractal is z<sub>n+1</sub> = z<sub>n</sub> + c, where both variables are complex numbers."

David.

• @Jona Hi, we came up with this a while ago in this thread:
https://forum.pdpatchrepo.info/topic/10798/setting-expr-formula-dynamically

Maybe it would be useful for what you are trying to do also. Here is a patch that I think does what you described. One note: inside the patch the states of the iterations are saved to a globally accessible table (10 values), but it doesn't work because if you address it at index 0, it doesn't always give you the last state. It would be excellent if the indexes 0 1 2 ecc.. would always return the last state, second to last, third to last ecc..but I don't know how to do it.

fractals.iterations.zip

• @whale-av thanks for the patch. yes thats mandelbrot. @weightless thanks for the link and the hints. i will have a look.

• @Jona If you are interested for your Midi Sequencer, there was a whole batch of fractal work done by Ben Bogart and Michael McGonagle in 2003....... that is now lost in the black hole of extended...
Pd/extra/chaos......
David.

• @whale-av that is the idea. perhaps i should install extended or just copy the chaos folder into pd vanilla to explore those patches.

• @whale-av @Jona I've found a library called "chaos" in Deken, and the objects seem to be those listed here https://github.com/pd-l2ork/pd/tree/master/externals/bbogart/chaos

Are these the same objects that were in extended?

• @weightless very nice, that seems to be the library that @whale-av mentioned.

• i think this patch could output the 5th mandelbrot iteration? each expr object should add one iteration. mandelbrot.pd

• i don't understand why the iterations are 'hardcoded'. wouldn't it be simpler to just send the output of the expr to its input (via [float] and bang (and maybe [until]) and shouldn't the numbers be complex ones? that would be something like next_zr=(zr * zr) - (zi * zi) + cr and next_zi=2 * zr * zi + ci for the typical mandelbrot set series. (afair...)

• @mnb thanks for the hints. you are right, the iterations should work like that:
and i am also sure you are right with the complex numbers as well. i read somewhere that i have to use the x y values of a circle as the input for the expression to create mandelbrot figures, but it didnt work out so far i just start to understand the fractal and the expr thing.

• i have some interesting results with the chaos library. this one is from the lorenz object. still i like to understand how to make expressions like that.

• @Jona Did you see this thread? There are some interesting patches in there.

https://forum.pdpatchrepo.info/topic/4646/complex-differential-equations-calculated-by-pd/25

• @weightless thanks, very interesting thread. i tried the manit patch, this is a result: but its not easy to find nice variations. in this regard the lissajous formala is very thankful. there is an interesting remark from @katjav: "I found it impossible to find an interesting fractal 'by hand' though. Everytime when a pattern sounds interesting, it's flying to the stars and reset, being not part of the Mandelbrot set. The logistic map function is much easier to handle, like Elaine mentioned in her thesis." i have to admit perhaps my idea to create easily musical patterns from fractals was a little bit naive, but who knows.

• @Jona I tried to implement the manit patch into your sequencer too but couldn't get it to show anything! Would you mind sharing the patch?

Perhaps there are other, more varying formulas that lend themselves better to musical explorations in this fashion. In Elaine's paper it is discussed how to use complex chaotic functions, so perhaps the manit patch could be adapted for other formulas?

• @weightless here is the patch: manit-seq.zip

• @Jona Thanks a lot! I will have a look and maybe learn something from how you plot the values with the data structure.

• @weightless this is the part of the patch that plots the values. it chooses the \$0-draw element of the \$0-array array and then sets the x and y value. each step bangs every existing element. c is the color of the element. if you have a question about the plotting i will try to answer.

• and i'm not exactly sure if the 'classic mandelbrot-set series' yields any musically interesting results, but
i am quite sure that it only produces usable results for carefully chosen values of c (on the border of the mandelbrot set where it neither converges nor diverges, at least not so quick...).

maybe simple real-valued recursive functions are more fun. the idea is to blow up a value (multiplying, adding constants, whatever), then wrap it to a range, and feed it to the next iteration. like the classic gingerbreadman, hopalong etc. fractals. linke in the attached example. fractalmelody.pd

• @mnb thanks, nice patch. that sounds very interesting. i will have to learn about that.

• @mnb the recursion trick with the sine function is nice. i tried to create a longer slow development with your formula (its quite repetetive in the beginning):

Posts 23 | Views 10763
Internal error.

Oops! Looks like something went wrong!