In the long term I’ll eventually be looking at using Mandelbrot/Julia sets in order to generate sound and synthesis but as a starting block and a general maths/max/programming muse I’m looking at how I can efficiently generate the set using Max objects…
I have a skeleton patch which performs a single iteration but the problem is in the feedback – the inevitable stack overflow that occurs when running stupid calculations with infinite feedback loops even when you have breakout conditions e.g. z>4 or n>100. I know I can use triggers and timing to solve the problem but in my eyes that defeats the point – I’d still like to run the routine waaay into ‘the red’ so to speak such that I can generate high resolution sets in the fastest allowable time…
Hard to say without seeing your patch…
Anyway, you get stack overflow if you feed your result back in a "hot" inlet. A strategy to avoid this can be to feed it in a "cold" inlet, and having an Uzi set to a large enough number triggering your computations one after another. The drawback of this solution is that you can’t interrupt the shooting, and this can be quite time-consuming. But the point is, there is no such thing as easy-to-control iterations in Max.
A possible (although somewhat cumbersome) alternative is to use bach.iter with a long enough input list, instead of Uzi. bach lists can have virtually unlimited length, and bach.iter allows to stop the iteration "on the fly" – if you’re curious, give a look at http://www.bachproject.net
I second that, I worked for a couple hours to make a prime factorization patch in Max, it works fine, but due to the iteration, at high enough numbers I get stack overflows. (Was pretty smooth up until 600000!)
Anyway, the advice is good, there are certain things you just don’t want to iterate (recursively) at certain speeds in max.
Writing in C or Java would be a more elegent solution – writing objects in code is something I never covered at uni mind and have no notes about how to go about it… Guess I’ll have to do some research!!
Oh I have some experience in C, but never looked at Java. And I’ve coded a neat looking set in AS2 recently. I tried using [flashserver] to link my AS2 code with Max but it was pretty lethargic – wasn’t running anywhere near as quick as I would’ve liked.
Likesay I think I just need to look up how to write Max objects in C :)
Plenty of code samples online for making cool sets, you can adapt to js pretty easily. w3schools.com is great for all things web, and has a large section on js as well.
For a fun fractal overview, check this out…oh yeah!
Nice one for the advice guys
Forums > MaxMSP