MartinusMagneson's picture
+2

I have noticed for quite som time that the perlin noise isn't really that random. It seems to be the same everytime the composition is restarted. Furthermore it seems very much like it's centered around 0, instead of being all over the place (which is desireable for me at least). A last issue with it is that two Noise nodes will produce the same result in a composition. Is all of this by design? In that I'll have to use the timebase (add to time) to get different results? These are the Vuo products of a composition running two times:

While these are the products of Processing running a similar sketch:

Processing seems to mix thing up a bit, so that you'll get a different result every time. It is also not centered around 0, but wil move (seemingly) randomly around in the drawing space without a seed.

Comments

True ! I've always wondered

Bodysoulspirit's picture
Submitted by

True ! I've always wondered myself if there could not be a more random random ;)

Ann centered around zero or not would be great if was an option, sometimes I'd really want things to go over the place like a snake, and a snake doesn't come back to zero ;)

1 Answer

jstrecker's picture
+1

There are different kinds of noise. The Perlin noise you're generating in Vuo is different from the kind of noise you're generating in Processing.

Perlin noise is maybe easier to understand if you look at what it was originally developed for: natural-looking textures. Here is what that looks like (generated by the Make Noise Image node):

The algorithm for making the image involves dividing the image into a grid (a.k.a. lattice). At each of the grid points (the blue points in the image below), the image is 50% gray. That's just how this particular kind of noise works.

OK, so that's Perlin noise as an image, but you asked about Perlin noise as a sequence of numerical values — that is, the output of the Make Gradient Noise node when Gradient Noise is set to "Rectangular (Perlin)".

Pretend the Perlin noise image is a topographical map, where the light parts are hills and the dark parts are valleys. In 1 dimension (Make Gradient Noise's output port has type Real), numerical Perlin noise is like you're walking in a straight line across that terrain and recording your elevation. Every time you cross one of those grid points where the image is 50% gray, you're at elevation 0.

In 2 dimensions (Make Gradient Noise's output port has type 2D Point), like in your example, it's like you have two people walking across, and you're using the first person's elevation for the x-coordinate and the second person's for the y-coordinate.

Again, you're hitting that 0 elevation every time you cross one of those grid points. Because that's how Perlin noise was designed.

The Position input port controls how far along the person is in their walk. If you want the walk to look different each time you run your composition, you should start at a different position each time (add the output of Make Random Value to Position). If you don't want the walk to keep crossing elevation 0, you can add the outputs of multiple Make Gradient Noise nodes at different scales (multiply each Position input by a different number).

Now, the kind of noise that is more what you'd think of as "random" is white noise. Here is what it looks like as an image (generated by the Make Random Image node):

This image does not look like a topographical map. This is not a terrain someone can walk across. Unlike Perlin noise, which changes smoothly over time, white noise jumps to a different value with each pixel.

Just like there is the Make Noise Image node for images and the Make Gradient Noise node for numbers, there is the Make Random Image node for images and the Make Random Value and Make Random Value with Seed nodes for numbers.

When we talk about a computer giving us a random number, almost always we're talking about what is called pseudorandom numbers. They look convincingly random enough for most uses, but in truth they're generated by an algorithm, so in a way they're predictable. The way people used to get random numbers before they had personal computers was to look them up in a table. Someone would publish a really long list of random numbers, and you would say, OK, I'm gonna pick the the 100th, 101st, and 102nd numbers in the list to be my random numbers. In computers, pseudorandom number generation is sort of like that. There's not literally a table, but you can image a really, really long list of numbers, and you're picking from that list. If you start at the beginning of the list each time, you get the same sequence of numbers. So what you can do is tell the pseudorandom generator to start at a different point in the sequence each time. That point is called the seed.

The Make Random Value node automatically picks a different seed every time. The Make Random Value with Seed node does not. It has a Seed input, in case you do want your composition to generate the same pseudorandom number sequence every time.

The Position input of Make Gradient Noise is sort of like the Seed input of Make Random Value with Seed, and sort of different. With the Seed, you just set it once, whereas the Position you set a different value each time you generate a new noise value. But the Seed and Position are alike in that you have to use different values if you want a different sequence of outputs.

Coming back to your Processing example, finally. It looks like you're doing some kind of random walk…? I'm not sure what kind of noise it's based on, but you could do something vaguely similar in Vuo by feeding the output of either Make Random Value (below) or Make Gradient Noise into a couple of Count nodes, one for the x-coordinate and one for the y-coordinate.