> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nomn.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# MIDI

> MIDI output, export, transport sync, and MIDI Learn

# MIDI

RESERVOIR is a MIDI generator — it produces MIDI note and CC data that you route to instruments in your DAW.

## Real-Time Output

RESERVOIR outputs MIDI in real-time, synchronized to your DAW's transport:

* **Note On/Off** messages for each generated event across all active layers
* **Continuous Controller** data from the Expression system (CC1, CC2, CC11, CC21, CC71, CC72, CC73, CC74, CC76, CC77)
* **Pitch Bend** for vibrato
* **Channel Aftertouch** following the Dynamics envelope

All timing is PPQ-based (pulses per quarter note), ensuring perfect sync with DAW tempo changes, time signature changes, and transport jumps.

## Transport Sync

| Feature          | Behavior                                                             |
| ---------------- | -------------------------------------------------------------------- |
| **Play**         | RESERVOIR starts generating at the current transport position        |
| **Stop**         | All pending note-offs are sent immediately                           |
| **Seek/Jump**    | Engines reset and seek to the new position — no stuck notes          |
| **Tempo change** | Density (attacks per beat) remains constant; absolute timing adjusts |
| **Loop**         | Engines reset at loop boundaries                                     |

## MIDI Export

The Export button writes the current or most recent generation to a standard MIDI file. The export produces one track per active layer, preserving the polyphonic structure for editing in your DAW.

## Duration Modes

| Mode         | Description                                       |
| ------------ | ------------------------------------------------- |
| **Beats**    | Generate for a fixed number of beats              |
| **Bars**     | Generate for a fixed number of bars (assumes 4/4) |
| **Seconds**  | Generate for a fixed duration in seconds          |
| **Infinite** | Generate continuously until stopped (default)     |

| Parameter            | ID                    | Range                             | Default  |
| -------------------- | --------------------- | --------------------------------- | -------- |
| Composition Duration | `compositionDuration` | 4–256                             | 32       |
| Duration Mode        | `durationMode`        | Beats / Bars / Seconds / Infinite | Infinite |
| Generation           | `generationOn`        | On/Off                            | On       |

## MIDI Learn

RESERVOIR supports per-parameter MIDI CC mapping. Right-click any parameter to open its MIDI Learn menu — choose **Learn** and the plugin arms that control to capture the next incoming CC on any channel. Move a knob on your controller and the binding is made; the mapping persists with the host project.

The **MIDI Learn** button in the bottom bar toggles a global highlight mode that decorates every learn-mappable control with its current binding, so you can review and audit assignments at a glance. The button text also shows the most recent CC number, channel, and message count the plugin has received, which is useful for diagnosing whether the host is actually routing MIDI input to the plugin.

To clear a mapping, right-click the parameter and choose **Clear**. The plugin's MIDI Learn manager handles channel-agnostic CC capture and persists mappings inside the saved plugin state.
