# Accumulation

This page will present you all the functions that can be used to pile up things: sounds, patterns, etc... Each function will be presented following the same model:

**Type signature**: how the function is declared on the**Haskell**side.**Description**: verbal description of the function.**Examples**: a small list of examples that you can copy/paste in your editor.

## #

Superposition### #

overlayThe `overlay`

function is similar to `cat`

, but combines two patterns, rather than a list of patterns. For example:

...is the same as...

### \<>

`\<\>`

is the same as overlay described above but in operator form. For example:

### #

stack`stack`

takes a list of patterns and combines them into a new pattern by layering them up - effectively playing all of the patterns in the list simultaneously:

This is particularly useful if you want to apply a function or synth control pattern to multiple patterns at once:

### #

superimpose`superimpose`

plays a modified version of a pattern 'on top of' the original pattern, resulting in the modified and original version of the patterns being played at the same time. For example this:

...is the same as this:

### #

layerThe `layer`

function allows you to layer up multiple functions on one pattern. For example the following will play two versions of the pattern at the same time, one reversed and one at twice the speed.

If you want to include the original version of the pattern in the layering, use the `id`

function:

### #

steps`steps`

is like `step`

but it takes a list of pairs like `step`

would and it plays them all simultaneously.

## #

Building iterations### #

iter`iter`

divides a pattern into a given number of subdivisions, plays the subdivisions in order, but increments the starting subdivision each cycle. The pattern wraps to the first subdivision after the last subdivision is played. Example:

This will produce the following over four cycles:

### #

iter'`iter'`

does the same as `iter`

but in the other direction. So this:

Produces this pattern: