# Arpeggiator

> Play held notes one at a time, locked to the transport: up, down, up-down, down-up, random, as played or as chords, over 1–4 octaves, with latch.

Source: https://docs.tune.toys/nodes/midi.arp/

Arpeggiator plays the notes you hold one at a time, in time with the transport. Hold a chord and it climbs, falls, bounces or wanders through it, across up to four octaves, or replays the whole chord on every step.

## What it does

The arpeggiator keeps the notes held at its input, up to 32, tracked per source and channel so two keyboards never release each other's notes. On every step it plays the next note of the chosen order. Up and Down sort by pitch; Up-down and Down-up bounce without repeating the top and bottom; Random draws from a seed made from the node's path; As played keeps the order you pressed them in; Chord plays every held note together. Octaves repeats the pattern that many octaves up before it starts again.

Steps are locked to the transport's beat: a new chord starts on the next step, and live playing, take replay and offline renders agree note for note. Releasing a key only changes which notes are held. Every note the arpeggiator starts, it releases itself after Gate length of its step, or at once when the transport stops or jumps or an all-notes-off arrives, so a note never hangs. Other messages, such as pitch bend, sustain and controllers, pass through.

## When to use it

Use it to turn a held chord into a moving part, or with latch to keep a pattern running while your hands do something else. For a fixed melody, use [Step sequencer](https://docs.tune.toys/nodes/midi.step/).

## Ports

<!-- ports:start -->

| Port   | Direction | Signal | Lanes            |
| ------ | --------- | ------ | ---------------- |
| `midi` | Input     | MIDI   | 16 MIDI channels |
| `midi` | Output    | MIDI   | 16 MIDI channels |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter        | Label          | Range     | Default | Unit | Scale  | Notes                                                                                                                                                                                               |
| ---------------- | -------------- | --------- | ------- | ---- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`           | Mode           | 0 to 6    | 0       |      | linear | Order of the held notes. Random draws from a seed of the node's path; Chord plays every held note on each step. Choices: 0 Up, 1 Down, 2 Up-down, 3 Down-up, 4 Random, 5 As played, 6 Chord.        |
| `octaves`        | Octaves        | 1 to 4    | 1       |      | linear | Octaves the pattern climbs before it repeats.                                                                                                                                                       |
| `division`       | Division       | 0 to 11   | 2       |      | linear | Length of one step, locked to the transport's beat. Choices: 0 1/32, 1 1/16 triplet, 2 1/16, 3 1/16 dotted, 4 1/8 triplet, 5 1/8, 6 1/8 dotted, 7 1/4 triplet, 8 1/4, 9 1/4 dotted, 10 1/2, 11 1/1. |
| `swing`          | Swing          | 0 to 0.75 | 0       |      | linear | Delay of every second step, as a fraction of a step: 0 is straight, about 0.33 a triplet feel, 0.5 dotted.                                                                                          |
| `gate_length`    | Gate length    | 0.05 to 1 | 0.5     |      | linear | How long each note sounds, as a fraction of its step.                                                                                                                                               |
| `latch`          | Latch          | 0 to 1    | 0       |      | linear | On keeps playing released notes until a new note starts a new chord. Choices: 0 Off, 1 On.                                                                                                          |
| `velocity`       | Velocity       | 0 to 1    | 0       |      | linear | Use each held note's own velocity, or Fixed velocity for every step. Choices: 0 As played, 1 Fixed.                                                                                                 |
| `fixed_velocity` | Fixed velocity | 0 to 1    | 0.8     |      | linear | Velocity of every step when Velocity is Fixed. Shown when `velocity` is 1.                                                                                                                          |
| `channel`        | Channel        | 0 to 16   | 0       |      | linear | 0 keeps each note's own channel; 1–16 sends every step on one channel.                                                                                                                              |

<!-- parameters:end -->

### Mode (`mode`)

The order of the held notes: Up, Down, Up-down, Down-up, Random, As played or Chord.

### Octaves (`octaves`)

How many octaves the pattern climbs before it repeats, 1 to 4. Notes above 127 are skipped. In Chord mode each step moves the chord up an octave.

### Division (`division`)

The length of one step, from 1/32 to a whole note, with triplet and dotted choices.

### Swing (`swing`)

Delays every second step by a fraction of a step, 0 to 0.75.

### Gate length (`gate_length`)

How much of its step a note holds, 0.05 to 1.

### Latch (`latch`)

Off or On. On keeps playing the notes after you let go; the first note you press after letting go of every key starts a new chord.

### Velocity (`velocity`)

As played uses each held note's own velocity; Fixed plays every step at Fixed velocity.

### Fixed velocity (`fixed_velocity`)

The velocity of every step when Velocity is Fixed, 0 to 1. Hidden otherwise.

### Channel (`channel`)

0 keeps each note's own channel; 1 to 16 sends every step on that channel.

## Tips

- Latch with Up-down over two octaves gives a classic synth arpeggio from a single held chord.
- Put a [Transpose](https://docs.tune.toys/nodes/midi.transpose/) before the arpeggiator to shift the held chord, or after it to shift the pattern.
- Random is the same on every replay: it is seeded, not truly random.

## See also

[Keyboard](https://docs.tune.toys/nodes/midi.keyboard/), [Step sequencer](https://docs.tune.toys/nodes/midi.step/), [Transpose](https://docs.tune.toys/nodes/midi.transpose/), [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/).
