# Module catalog

> Every module of the Pyzed audio engine: oscillators, filters, envelopes, LFOs, effects, sequencers, drums, samplers and MIDI, with their ports, ranges and defaults.

Source: https://albakore.github.io/pyzed/audio/engine/modules/

<!-- Generated by docs/scripts/gen_audio_modules.py from audio.modules(). -->

Every module the engine has, grouped as in a rack. Add one with `engine.add(kind, **params)` and plug its ports with `engine.connect(src, output, dst, input)`. The same data is in Python as [`audio.modules()`](https://albakore.github.io/pyzed/audio/engine/getting-started/#the-catalog), which an interface can use to draw any module. Signals follow the [conventions of modular synthesizers](https://albakore.github.io/pyzed/audio/engine/getting-started/#signals): audio swings between -1 and 1, pitch is in V/oct (0 = C4) and gates are 0 or 1.

## Sources

### Oscillator · `oscillator`

A band-limited VCO: sine, triangle, saw and square (with pulse width), tuned by `freq` plus the V/oct `pitch` input.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `pitch` | Pitch (V/oct) | cv |
| `fm` | FM | cv |
| `pwm` | PWM | cv |
| `sync` | Sync | gate |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |
| `sine` | Sine | audio |
| `triangle` | Triangle | audio |
| `saw` | Saw | audio |
| `square` | Square | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `freq` | Frequency | 8 … 20000 Hz (logarithmic) | 261.63 |
| `wave` | Wave | options: `sine`, `triangle`, `saw`, `square` | `saw` |
| `fine` | Fine | -1 … 1 st | 0 |
| `pw` | Pulse width | 0.05 … 0.95 | 0.5 |
| `fm_amount` | FM amount | 0 … 1 | 0 |
| `level` | Level | 0 … 1 | 0.8 |

### Noise · `noise`

White, pink or brown noise.

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `color` | Color | options: `white`, `pink`, `brown` | `white` |
| `level` | Level | 0 … 1 | 0.5 |

### Sampler · `sampler`

Plays a WAV file or a list of samples (`node.load`) when its gate opens: once, while the gate is held or in a loop.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `gate` | Gate | gate |
| `pitch` | Pitch (V/oct) | cv |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `mode` | Mode | options: `one-shot`, `gate`, `loop` | `one-shot` |
| `tune` | Tune | -24 … 24 st | 0 |
| `start` | Start | 0 … 1 | 0 |
| `end` | End | 0 … 1 | 1 |
| `level` | Level | 0 … 1 | 0.8 |

**State** (`node.state`): `position`, `playing`

### Drum · `drum`

A synthesized drum voice (kick, snare, hi-hat, clap or tom) struck by each rising edge of `trigger`.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `trigger` | Trigger | gate |
| `accent` | Accent | cv |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `sound` | Sound | options: `kick`, `snare`, `hihat`, `clap`, `tom` | `kick` |
| `tune` | Tune | -12 … 12 st | 0 |
| `decay` | Decay | 0.02 … 2 s (logarithmic) | 0.4 |
| `tone` | Tone | 0 … 1 | 0.5 |
| `level` | Level | 0 … 1 | 0.8 |

**State** (`node.state`): `hit`

## Modulation

### LFO · `lfo`

A slow oscillator to move other parameters: sine, triangle, saw, square or random steps (sample and hold).

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `rate` | Rate | cv |
| `reset` | Reset | gate |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | cv |
| `unipolar` | Unipolar | cv |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `rate` | Rate | 0.01 … 50 Hz (logarithmic) | 1 |
| `wave` | Wave | options: `sine`, `triangle`, `saw`, `square`, `random` | `sine` |
| `amount` | Amount | 0 … 1 | 1 |
| `offset` | Offset | -1 … 1 | 0 |

**State** (`node.state`): `phase`

### VCA · `vca`

An amplifier whose gain follows `cv` (an envelope or an LFO); with nothing on `cv` it is a plain volume.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |
| `cv` | CV | cv |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `gain` | Gain | 0 … 2 | 1 |
| `response` | Response | options: `linear`, `exponential` | `linear` |

### Envelope · `adsr`

An ADSR envelope: rises while the gate opens, settles at sustain and fades out when it closes.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `gate` | Gate | gate |
| `retrig` | Retrigger | gate |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | cv |
| `inverted` | Inverted | cv |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `attack` | Attack | 0.001 … 10 s (logarithmic) | 0.01 |
| `decay` | Decay | 0.001 … 10 s (logarithmic) | 0.2 |
| `sustain` | Sustain | 0 … 1 | 0.7 |
| `release` | Release | 0.001 … 10 s (logarithmic) | 0.3 |

**State** (`node.state`): `stage`, `level`

## Filters

### Filter · `filter`

A resonant state-variable filter (VCF) with low-pass, high-pass, band-pass and notch; `cutoff` takes V/oct, so an envelope or LFO sweeps it.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |
| `cutoff` | Cutoff | cv |
| `resonance` | Resonance | cv |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |
| `lowpass` | Low-pass | audio |
| `bandpass` | Band-pass | audio |
| `highpass` | High-pass | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `mode` | Mode | options: `lowpass`, `highpass`, `bandpass`, `notch` | `lowpass` |
| `cutoff` | Cutoff | 20 … 20000 Hz (logarithmic) | 1200 |
| `resonance` | Resonance | 0 … 1 | 0.2 |
| `cv_amount` | CV amount | -1 … 1 | 1 |
| `drive` | Drive | 0 … 1 | 0 |

## Mixing

### Mixer · `mixer`

Four channels with level and pan into a stereo pair.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in_1` | In 1 | audio |
| `in_2` | In 2 | audio |
| `in_3` | In 3 | audio |
| `in_4` | In 4 | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `level_1` | Level 1 | 0 … 1.5 | 0.8 |
| `level_2` | Level 2 | 0 … 1.5 | 0.8 |
| `level_3` | Level 3 | 0 … 1.5 | 0.8 |
| `level_4` | Level 4 | 0 … 1.5 | 0.8 |
| `pan_1` | Pan 1 | -1 … 1 | 0 |
| `pan_2` | Pan 2 | -1 … 1 | 0 |
| `pan_3` | Pan 3 | -1 … 1 | 0 |
| `pan_4` | Pan 4 | -1 … 1 | 0 |
| `master` | Master | 0 … 1.5 | 1 |

## Effects

### Delay · `delay`

An echo with feedback and a tone control on the repeats.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |
| `time` | Time | cv |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `time` | Time | 0.001 … 2 s (logarithmic) | 0.35 |
| `feedback` | Feedback | 0 … 0.98 | 0.4 |
| `tone` | Tone | 200 … 20000 Hz (logarithmic) | 8000 |
| `mix` | Mix | 0 … 1 | 0.35 |

### Reverb · `reverb`

A stereo room (Freeverb): size, damping and width.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `size` | Size | 0 … 1 | 0.6 |
| `damping` | Damping | 0 … 1 | 0.4 |
| `width` | Width | 0 … 1 | 1 |
| `mix` | Mix | 0 … 1 | 0.3 |

### Distortion · `distortion`

Drives the signal into a soft or hard clipper, a wavefolder or a fuzz.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `type` | Type | options: `soft`, `hard`, `fold`, `fuzz` | `soft` |
| `drive` | Drive | 0 … 1 | 0.4 |
| `tone` | Tone | 200 … 20000 Hz (logarithmic) | 6000 |
| `mix` | Mix | 0 … 1 | 1 |
| `level` | Level | 0 … 1 | 0.7 |

### Chorus · `chorus`

A stereo chorus; with feedback and a short delay it becomes a flanger.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `rate` | Rate | 0.05 … 5 Hz (logarithmic) | 0.8 |
| `depth` | Depth | 0 … 1 | 0.5 |
| `delay` | Delay | 1 … 30 ms (logarithmic) | 12 |
| `feedback` | Feedback | 0 … 0.9 | 0 |
| `mix` | Mix | 0 … 1 | 0.5 |

### Bitcrusher · `bitcrusher`

Lo-fi: fewer bits and a lower sample rate.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `bits` | Bits | 1 … 16 bit | 8 |
| `downsample` | Downsample | 1 … 32 x | 4 |
| `mix` | Mix | 0 … 1 | 1 |

### Compressor · `compressor`

Evens out the level; a signal on `sidechain` ducks the input instead (the pumping of dance music).

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |
| `sidechain` | Sidechain | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `threshold` | Threshold | -60 … 0 dB | -18 |
| `ratio` | Ratio | 1 … 20 :1 | 4 |
| `attack` | Attack | 0.1 … 100 ms (logarithmic) | 10 |
| `release` | Release | 10 … 1000 ms (logarithmic) | 120 |
| `makeup` | Makeup | 0 … 24 dB | 0 |

**State** (`node.state`): `reduction`

## Sequencing

### Clock · `clock`

The tempo of a patch: gates at the chosen division of the beat, on each beat and on each bar.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `reset` | Reset | gate |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `clock` | Clock | gate |
| `beat` | Beat | gate |
| `bar` | Bar | gate |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `bpm` | Tempo | 20 … 300 BPM | 120 |
| `division` | Division | options: `1/4`, `1/8`, `1/16`, `1/32` | `1/16` |
| `swing` | Swing | 0 … 0.5 | 0 |
| `run` | Run | options: `off`, `on` | `on` |

**State** (`node.state`): `tick`, `beat`

### Sequencer · `sequencer`

Up to 16 steps of pitch and gate, advanced by `clock` (or by its own `bpm` in sixteenth notes when nothing is on `clock`).

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `clock` | Clock | gate |
| `reset` | Reset | gate |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `pitch` | Pitch (V/oct) | cv |
| `gate` | Gate | gate |
| `trigger` | Trigger | gate |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `steps` | Steps | 1 … 16 | 8 |
| `gate_length` | Gate length | 0.05 … 1 | 0.5 |
| `bpm` | Tempo | 0 … 300 BPM | 120 |
| `pitch_1` … `pitch_16` | Pitch | -24 … 24 st | 0 |
| `gate_1` … `gate_16` | Gate | options: `off`, `on` | `on` |

**State** (`node.state`): `step`

## Utilities

### Constant · `constant`

A fixed voltage, to drive an input from a knob.

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | cv |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `value` | Value | -10 … 10 V | 1 |

### Scope · `scope`

Passes its input through untouched, to watch a signal anywhere in a patch.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `in` | In | audio |

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `out` | Out | audio |

## I/O

### Audio input · `audio_in`

The sound of the input device (a microphone or a line in), opened with `Engine(input_device=...)` or `input=True`.

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `gain` | Gain | 0 … 4 | 1 |

### MIDI to CV · `midi_in`

Turns the notes of a MIDI keyboard (or `engine.note_on`) into pitch, gate and velocity, playing the last note held.

**Outputs**

| Port | | Type |
| --- | --- | --- |
| `pitch` | Pitch (V/oct) | cv |
| `gate` | Gate | gate |
| `velocity` | Velocity | cv |
| `mod` | Mod wheel | cv |
| `retrigger` | Retrigger | gate |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `channel` | Channel | 0 … 16 | 0 |
| `glide` | Glide | 0.0001 … 2 s (logarithmic) | 0.0001 |
| `bend_range` | Bend range | 0 … 24 st | 2 |

**State** (`node.state`): `note`, `gate`

### Audio output · `audio_out`

The speakers. With nothing on `right`, `left` plays on both sides.

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `left` | Left | audio |
| `right` | Right | audio |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `volume` | Volume | 0 … 1 | 0.8 |

### CV to MIDI · `midi_out`

Plays the notes of a gate and a pitch on a MIDI output (`engine.open_midi_output`).

**Inputs**

| Port | | Type |
| --- | --- | --- |
| `pitch` | Pitch (V/oct) | cv |
| `gate` | Gate | gate |
| `velocity` | Velocity | cv |

**Parameters**

| Parameter | | Range | Default |
| --- | --- | --- | --- |
| `channel` | Channel | 1 … 16 | 1 |

**State** (`node.state`): `note`
