← Back to midigarden midigarden

Create Your Own Patches

Build custom synthesizers for midigarden using Pure Data

What You Need

How midigarden Patches Work

midigarden wraps your patch with automatic voice allocation. You build a single-voice synth, and the app creates multiple instances to handle polyphony and mixing.

Your patch receives: MIDI note (pitch) and velocity as a packed message at the inlet

Your patch outputs: Audio signals from two outlets (left and right)

Starter Template: Amber

The amber patch is a good starting point. It uses four sine oscillators at harmonic ratios (1x, 2.03x, 3.04x, 5.02x) with amplitude envelope and soft clipping. Smooth organ/flute/bell tones that saturate cleanly when driven.

amber.pd patch diagram

Download amber.pd

Patch Structure

1. Input: Unpack MIDI Data

Start with an inlet connected to unpack f f. This separates the packed pitch and velocity values.

2. Pitch Processing

Use mtof to convert MIDI note number to frequency in Hz. Connect this to your oscillators.

3. Velocity Handling

Velocity ranges 0-127. Use it to control amplitude, filter cutoff, or modulation depth. sel 0 can detect note-off messages (velocity = 0).

4. Sound Generation

Build your synthesis: oscillators (osc~, phasor~), noise (noise~), filters (lop~, bp~), etc.

5. Amplitude Envelope

Use line~ or vline~ to create attack/decay envelopes. Multiply your signal by the envelope.

6. Output: Two Outlets

End with two outlet~ objects for left and right audio channels. Connect your final signal to both.

Testing Your Patch in Pure Data

Before transferring to midigarden, test your patch in Pure Data on your computer.

Important: To hear audio in Pure Data, you need a dac~ object. Connect the signals that go into your two outlet~ objects into a dac~ instead. The dac~ has left and right inputs for stereo output.

The amber.pd starter includes test buttons (the bangs at the top) that send note messages so you can hear the sound without external MIDI.

Adding Parameters

Use horizontal sliders (hsl) or number boxes (nbx) to add tweakable parameters. These will appear in midigarden's edit mode.

For receive symbols, use the $2- prefix (e.g., $2-decay). This becomes the patch name when instantiated, allowing unique parameter addressing per voice.

Transfer to midigarden

  1. Save your patch as a .pd file
  2. On your iPhone/iPad, open the Files app
  3. Navigate to On My iPhone (or iPad) → midigarden
  4. Copy or AirDrop your .pd file into the midigarden folder
  5. Close and reopen midigarden to load the new patch
  6. Swipe to the new patch in the patch selector (upper right circle)

Tips

Resources