To create multiple copies of something in Apparatus, you use a "spread". Toby recorded a tutorial video about how to use spreads. It is a fine introduction for most practical purposes, and you should watch it!

https://player.vimeo.com/video/140149972

The rest of this note is targeted at CS-type people, who are curious about questions like: What are spreads, really? And how do they relate to more traditional CS concepts?

I will be speedy! I'm most interested in getting these thoughts out here quickly. Please let me know if something is unclear.

Spreads as parallel worlds

Here's a little story about some spreads. It shows, in miniature contrived form, all the mechanics that define how spreads work. Along the way, I'll introduce a model of "parallel worlds" – the best I know yet for understanding why spreads do what they do.

1

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1ec233e3-5040-4655-9d04-a20b499fba8c/a.png

Here is a rectangle in Apparatus. In the spreadsheet, its X and Y parameters are set to numbers, positioning the rectangle.

2

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8b9e4f45-42e9-416b-b06d-65b6976c4783/b.png

Here X is set to spread([0,1,2]), which means "a spread of the numbers 0, 1, and 2". This makes three rectangles with three different X positions.

What's happening here? One way to think about it is that the "spread" function creates three parallel worlds. In one world X is 0, in another it is 1, and in a third it is 2. The way the rectangle is drawn depends on X, so the rectangle looks different in the three worlds. Ultimately, Apparatus shows all these parallel worlds together in the same picture. This is how spreads let you make multiple copies of a shape.

The green "swatch" next to X marks that it is spread – it takes on different values in different worlds. The green swatch next to Rectangle marks that it too is spread. The "link" icon inside of the swatch means that it varies across the same three parallel worlds created by the use of spread in X. (X is its "spread origin".) We will see later why this is important.

3

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5a30cffc-5589-4f56-aafd-2fe120970384/c.png

Here Fill Color is computed with a formula involving X. Within a single world, the X in this formula is just an ordinary number – not an array of numbers or a special object. But since X varies between worlds, Fill Color will vary too. In the end, it will be a spread, spread in the same way as X. (This is why it gets a green link swatch, like Rectangle.)

In effect, we have performed a functional-programming "map" operation on the values in the X spread, but this happens implicitly.