# Control to notes

> Turn control lanes (pitch, gate and velocity) into MIDI notes, the inverse of MIDI to control, so control sources and sensors can play instruments.

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

Control to notes plays MIDI notes from control lanes: a pitch lane picks the note and a gate lane starts and stops it. It is the inverse of [MIDI to control](https://docs.tune.toys/nodes/midi.to-control/), so LFOs, curves, sensors and data can play any instrument.

## What it does

The input is a control bundle read in MIDI to control's order: lane 1 is pitch, lane 2 gate and lane 3 velocity. Pitch 0 plays Low note and 1 plays High note, rounded to the nearest note. A one-lane input is a gate that plays Low note; a two-lane input is pitch and gate, at velocity 0.8. When the gate rises to 0.5 or more, a note starts; when it falls below, the note ends. With Legato on, a change of pitch while the gate is high moves the note: the new note starts and then the old one ends, which a glide or mono voice plays as one phrase.

Control runs once per audio block, so notes start and end at the beginning of the block whose lanes changed, not on an exact sample: about 2.7 ms resolution at 128 frames and 48 kHz. Removing the input releases the sounding note.

## When to use it

Use it to play an instrument from something that is not MIDI: a sensor, a drawn [Curve](https://docs.tune.toys/nodes/ctl.curve/), a [Control LFO](https://docs.tune.toys/nodes/ctl.lfo/) or data. Build the bundle with [Combine lanes](https://docs.tune.toys/nodes/ctl.combine/). For notes locked exactly to the beat, use a sequencer such as [Step sequencer](https://docs.tune.toys/nodes/midi.step/).

## Ports

<!-- ports:start -->

| Port      | Direction | Signal  | Lanes                   |
| --------- | --------- | ------- | ----------------------- |
| `control` | Input     | Control | Inferred from the cable |
| `midi`    | Output    | MIDI    | 16 MIDI channels        |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter   | Label     | Range    | Default | Unit | Scale  | Notes                                                                                                      |
| ----------- | --------- | -------- | ------- | ---- | ------ | ---------------------------------------------------------------------------------------------------------- |
| `low_note`  | Low note  | 0 to 127 | 36      |      | linear | Note played when the pitch lane is 0.                                                                      |
| `high_note` | High note | 0 to 127 | 96      |      | linear | Note played when the pitch lane is 1.                                                                      |
| `channel`   | Channel   | 1 to 16  | 1       |      | linear | MIDI channel of the notes.                                                                                 |
| `legato`    | Legato    | 0 to 1   | 0       |      | linear | On moves a held note when the pitch lane changes; Off keeps it until the gate falls. Choices: 0 Off, 1 On. |

<!-- parameters:end -->

### Low note (`low_note`)

The note played when the pitch lane is 0, 0 to 127.

### High note (`high_note`)

The note played when the pitch lane is 1, 0 to 127. Below Low note turns the pitch lane upside down.

### Channel (`channel`)

The MIDI channel the notes are sent on, 1 to 16.

### Legato (`legato`)

Off keeps a note at its starting pitch until the gate falls. On moves it whenever the pitch lane names another note while the gate is high.

## Tips

- Set Low note and High note to the same values as a MIDI to control node to get the notes it read back exactly.
- A stepped pitch source, such as a Random step LFO or a curve with flat segments, plays clean notes; a smooth one with Legato on slides through every note it passes.
- The instrument plays each note as a degree of the Toy's tuning.

## See also

[MIDI to control](https://docs.tune.toys/nodes/midi.to-control/), [Combine lanes](https://docs.tune.toys/nodes/ctl.combine/), [Control LFO](https://docs.tune.toys/nodes/ctl.lfo/), [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/), [Control lanes](https://docs.tune.toys/concepts/control-lanes/).
