node random - blossommerz/locus-hub GitHub Wiki

Home > Input > Random

< Previous: Color | Next: Button >

Node Library

Random node icon   Random (node)

A seeded random number - the random cousin of the Slider.

Random node diagram

Random produces a value drawn from the same kind of series a Slider uses: it snaps to Min + k x Step within [Min, Max]. The Seed chooses which value comes out - change the seed to reroll - so the result is stable until one of its inputs changes rather than flickering on every recompute.

It has two outputs, and the difference is the key to random patterns:

  • Value is a single number: one draw for the whole node graph.
  • Per-Point is a spatial field: a fresh draw at every site it's sampled, one pick per lattice position. Each draw is keyed to the site's index - its place in the lattice's emission order - not its coordinates, so a site's pick stays glued to that site even as you move, scale, or rotate the whole field. This is how a _rand scatter gives every cell of a pattern its own random tile that survives being transformed.

Category: Input | Add menu: Input > Random

Inputs

  • Seed (number): which value to draw; change it to reroll. A list of seeds draws one value per seed, see below.
  • Min / Max (number): the ends of the range.
  • Step (number): the increment the draw snaps to.

Outputs

  • Value (number): one draw, shared everywhere it's wired. Snaps to the Min + k x Step series; change Seed to reroll.
  • Per-Point (field): a value field, not a plain number: a distinct draw at every site it's sampled, each one snapped to the same Min + k x Step series. Because it's a field, it only connects to field-aware inputs (the ones that sample per site - see the tip); wire it into an ordinary number input and it won't read as a number. Every draw is keyed to its site's index, so the field is deterministic - the same site always gets the same pick until Seed, Min, Max, or Step changes, and the pick follows the site through any transform.

A list of seeds gives a list of values

Seed takes a list as well as a single number. Feed a list in and Random draws one value per seed and hands back the whole list, still snapped to the same Min + k x Step series.

This is the second way to get a value that varies per item, and unlike Per-Point it produces an ordinary list rather than a field, so it connects to anything that reads a list. A Series of seeds through Random gives a list of random numbers; that list through Item at Index picks a different item per position, which is how a collection gets a random color per item.

Use Per-Point when you want a draw per lattice site that survives transforms, and a seed list when you want a draw per item in a list.

Tip

Wire Per-Point into a field-aware input - one that's sampled once per site - to vary each copy independently: a Place/PlaceVariant Index, a Rotate Angle, a Circle Radius. Wire Value in for one shared random number.

< Previous: Color | Next: Button >

Related

⚠️ **GitHub.com Fallback** ⚠️