Live data from Hacker News

Using prime numbers to make better backgrounds

designfestival.com

21–30 of 57 posts

Re: Using prime numbers to make better backgrounds

#21

This is very well explained, but not all that novel. Brian Eno used to generate long soundscapes like this, using loops of mutually prime lengths of time. Edit: See also - http://en.wikipedia.org/wiki/Ambient_1:_Music_for_Airports http://en.wikipedia.org/wiki/Generative_music

It also is the core of "method ringing", a kind of bell ringing from the 17th century and persisting today. Imagine some folks clanging away at 10 bells in a church tower for hours on end, never repeating, and never developing a melody. Each person is operating a single bell and repeating their pattern with a unique period.

http://en.wikipedia.org/wiki/Change_ringing

Re: Using prime numbers to make better backgrounds

#22

This is very well explained, but not all that novel. Brian Eno used to generate long soundscapes like this, using loops of mutually prime lengths of time. Edit: See also - http://en.wikipedia.org/wiki/Ambient_1:_Music_for_Airports http://en.wikipedia.org/wiki/Generative_music

The experimental-music band Bull of Heaven recently released a prime-looping generative piece that they project will last 8,462,937,602,125,701,219,674,955.2362595095 years before repeating.

http://bullofheaven.com/media/260.html

Re: Using prime numbers to make better backgrounds

#23
post #21

This is very well explained, but not all that novel. Brian Eno used to generate long soundscapes like this, using loops of mutually prime lengths of time. Edit: See also - http://en.wikipedia.org/wiki/Ambient_1:_Music_for_Airports http://en.wikipedia.org/wiki/Generative_music

It also is the core of "method ringing", a kind of bell ringing from the 17th century and persisting today. Imagine some folks clanging away at 10 bells in a church tower for hours on end, never repeating, and never developing a melody. Each person is operating a single bell and repeating their pattern with a unique period. http://en.wikipedia.org/wiki/Change_ringing

Hah, that trumps my example by 200 years. Well done.

Re: Using prime numbers to make better backgrounds

#24
post #5

Cool, but these numbers don't have to be primes. They just have to be coprimes (like (8,9)). The least common multiple of two coprimes 'a' and 'b' is a*b. http://en.wikipedia.org/wiki/Coprime

Not for the cicada example, but yes for the web aspect.

In the cicada example the point is that one predator would evolve to align its boom cycle so that it had a common divisor with the cycle of the cicada.

Since the predator's cycle is variable, it is evolutionarily optimal if the cicada only comes out every prime number of years.

Re: Using prime numbers to make better backgrounds

#26
For those of you that have Firefox 4, it might be fun to play around with the new "-moz-element()" function that allows you to embed one (or more!) html elements as a background image, using this to create a series of prime-spaced overlapping colors.

A fairly pedestrian example that I whipped up: http://web.njit.edu/~md224/backgroundtest.html (Firefox 4 only!)

Re: Using prime numbers to make better backgrounds

#27
post #21

Earlier quoted context omitted.

It also is the core of "method ringing", a kind of bell ringing from the 17th century and persisting today. Imagine some folks clanging away at 10 bells in a church tower for hours on end, never repeating, and never developing a melody. Each person is operating a single bell and repeating their pattern with a unique period. http://en.wikipedia.org/wiki/Change_ringing

Hah, that trumps my example by 200 years. Well done.

Except for the small detail that it isn't true. In change ringing, what you do is to cycle through some subset of the permutations of N bells. So you might begin 123456 123465 124365 and so on. The whole thing is made up of blocks of N bells in each of which each bell is rung once. Therefore, all bells have (on average) the same period: one ring, on average, out of every N.

The bells are hung in such a way that they naturally want to swing with equal periods, so you don't have to disturb one too much to make it ring one place earlier or later in the cycle. (A bell is never moved by more than two places.)

I don't see any reason why a peal of bells couldn't be set up to produce the effect jws described, but it wouldn't be at all the same thing as change ringing.

Re: Using prime numbers to make better backgrounds

#29
post #6

They're also useful for reverb effects, in very much the same way. See http://www.npr.org/2010/08/03/128935865/queens-brian-may-roc... (under "On The 'Stomp-Stomp-Clap' Section Of 'We Will Rock You'") Also, I think the technique will work as long as the numbers are relatively prime, which may be a bit easier to design around.

Holy shit, Brian May's one more Ph.D. away from being Buckaroo Banzai!

Re: Using prime numbers to make better backgrounds

#30

This is the perfect Hacker News article. I learned something new and mathematically-interesting about the natural world, the author came up with a clever hack to enliven backgrounds, and we learn how to apply that to improve our own designs.

Totally agree. There have been quite a few articles recently that fall into this category.

pquerna's recent post about OpenSSL memory in node (and elsewhere) is another that comes to mind. http://news.ycombinator.com/item?id=2411144

keep 'em coming I say!

Post reply on HN