Forums > MaxMSP

Mar 28 2011 | 12:27 am

Hello I have made a little patch to generate a Fibonacci sequence (with help from a two year old thread on the forum about how to set this up) and then map the given numbers to chromatic pitches constrained to one octave (0-11). I’m making a standalone app as a friend who is a composer. Anyway I have noticed that after about 45 or so iterations of creating the next number in the series after 1,836,311,903 Max starts going into negative numbers and acting weird. Similar results are obtained by multiplication as well. Is there a size limit for working with raw numbers in Max? Probably a really basic question that I should know the answer to by now…

Sorry for the long post. Thanks very much.

-B

Mar 28 2011 | 4:02 am

The range of a 32-bit integer is −2,147,483,648 to 2,147,483,647. If you really need Fibonacci numbers beyond 1,836,311,903, see fibonacci.java in the Max java examples.

Mar 28 2011 | 4:16 am

also if you’re just going for successive ratios (getting closer and closer to the golden ratio) you can just set a really-accurate float representation, then use it one place more accurate at a time, so

1.6
1.61
1.618
1.6182

etc. Then whatever you want to do with it should in theory be possible, using floats, though of course I don’t know exactly what you’re doing with the numbers. I think you can also munge two 32-bit numbers to get a 64-bit one with a few tricks, though I don’t recall the exact steps.

Sounds interesting though, I love this stuff…

Mar 28 2011 | 10:27 am

Note that 32-bits is not a specifically Max limitation. It is a limitation of 32-bit integers (sorry about the tautology, but no way around it), which was the largest size register most commercially available computers could offer until very recently.

Even with 64-bit registers you’re going to run out of bits very quickly when calculating Fibonacci numbers (or any other series with exponential growth).

If you want arbitrarily large integer precision, you’ll need to use something like Mathematica

Mar 28 2011 | 12:15 pm

after i´ve written a fibonacci abstraction i´ve never used it again because it
is musically and technically useless.

Mar 28 2011 | 5:13 pm

Thanks for all the replies! Very educational indeed. I do appreciate it.

-B

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP