# Wavetable

> Plays a drawn or preset table of up to eight 2048-sample frames with position morphing, unison and MIDI pitch.

Source: https://docs.tune.toys/nodes/std.wavetable/

Wavetable plays a table of up to eight 2048-sample frames, morphing between them, with unison and MIDI pitch.

## What it does

The table is node data: one to eight frames of 2048 samples each, as values between -1 and 1. Position moves across the frames, 0 at the first and 1 at the last, blending neighbouring frames. Unison stacks one to four detuned copies of each note, spread by Detune in cents. Frequency sets the pitch when no MIDI note is held; connecting a MIDI cable lets notes play it directly, one note at a time, and a held note overrides Frequency. Glide adds portamento between notes. Amplitude is the peak output level. The output is audio and follows the width of its configuration.

## When to use it

Use it for evolving timbres that a fixed waveform cannot make: sweep Position across drawn frames, thicken with Unison, or play it from a [Keyboard](https://docs.tune.toys/nodes/midi.keyboard/). For a plain waveform or [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/) chords use those instead; this oscillator plays one note at a time.

## Ports

<!-- ports:start -->

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

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter   | Label     | Range       | Default | Unit  | Scale  | Notes                                                                                              |
| ----------- | --------- | ----------- | ------- | ----- | ------ | -------------------------------------------------------------------------------------------------- |
| `frequency` | Frequency | 20 to 20000 | 220     | Hz    | log    | Pitch when no MIDI note is held. A held note overrides it and glides between notes.                |
| `position`  | Position  | 0 to 1      | 0       |       | linear | Morph position across the table's frames; 0 is the first frame and 1 the last.                     |
| `amplitude` | Amplitude | 0 to 1      | 0.25    |       | linear | Peak output level.                                                                                 |
| `unison`    | Unison    | 1 to 4      | 1       |       | linear | Number of stacked detuned voices per note. Choices: 1 1 voice, 2 2 voices, 3 3 voices, 4 4 voices. |
| `detune`    | Detune    | 0 to 50     | 8       | cents | linear | Spread of the unison voices in cents.                                                              |
| `glide_ms`  | Glide     | 0 to 2000   | 0       | ms    | linear | Portamento time between MIDI notes.                                                                |

<!-- parameters:end -->

<!-- data:start -->

- `table`: floats.

<!-- data:end -->

### Frequency (`frequency`)

The pitch, 20 to 20000 Hz on a logarithmic control, used when no MIDI note is held.

### Position (`position`)

Morph position across the table's frames, 0 to 1. With a single frame there is nothing to morph to.

### Amplitude (`amplitude`)

Peak output level, 0 to 1.

### Unison (`unison`)

One to four stacked detuned voices per note. A discrete choice.

### Detune (`detune`)

The spread of the unison voices, 0 to 50 cents. No effect with one voice.

### Glide (`glide_ms`)

Portamento time between MIDI notes, 0 to 2000 ms.

## Tips

- Edit waveforms directly on the node card or in Properties. **Waveform** selects the frame to edit; it does not move Position. **+ Add** appends a copy of that waveform and selects it (up to eight); **Remove** deletes the selected waveform (keeping at least one).
- Draw with **Pencil**, **Line** or **Smooth**, or apply **Sine**, **Saw**, **Square**, **Triangle** or **Noise** to the selected waveform. Other waveforms stay unchanged. Each stroke, held arrow-key edit, preset, addition or removal is one Undo step, with live sound previews. Escape or a cancelled gesture restores the previous waveform.
- On the drawing surface, Left/Right moves the sample cursor and Up/Down changes the waveform there; Shift makes finer edits. The Frame's **Wavetable curve** widget uses the same drawing tools for a fixed table frame.

- Keep Amplitude modest when raising Unison; more voices add up.
- Position is a control, so a [Control LFO](https://docs.tune.toys/nodes/ctl.lfo/) is the natural way to sweep it.

## See also

[Oscillator](https://docs.tune.toys/nodes/std.oscillator/), [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/), [Keyboard](https://docs.tune.toys/nodes/midi.keyboard/), [MIDI](https://docs.tune.toys/concepts/midi/).
