// Plugin SDK v3.1

Build for
PocketDAW.

One header. One compile. Drop the file and run. Build synths, effects, and full visual experiences that run natively on handheld hardware and desktop — no engine changes required.

my-synth.c
#include "pocketdaw.h"

// Declare your synth
const char* pdsynth_name() { return "My Synth"; }
int pdsynth_param_count() { return 4; }

// Host gives you primitives — osc, filter, ADSR, FX bus
PdSynthInstance pdsynth_create(float sr, PdSynthHost* host) {
    MySynth* s = calloc(1, sizeof(MySynth));
    s->sr = sr; s->host = host;
    return s;
}

// Process audio — called every frame
void pdsynth_process(PdSynthInstance inst, PdSynthAudio* buf) {
    MySynth* s = (MySynth*)inst;
    for (int i = 0; i < buf->frames; i++) {
        float v = s->host->osc_sample(OSC_SAW, s->phase, s->freq);
        buf->outL[i] = buf->outR[i] = v * s->amp;
        s->phase += s->freq / s->sr;
    }
}

// Optional: draw on the graphics page with live audio data
void pdsynth_draw(PdSynthInstance inst, SDL_Renderer* r, PdVisualCtx* ctx) {
    // ctx->scopeBufL/R, ctx->peakL, ctx->noteOn — all live
    SDL_SetRenderDrawColor(r, 0, 255, 65, 255);
    // draw waveform, meters, particles — go wild
}
build & install
# Compile for device (aarch64)
aarch64-none-linux-gnu-gcc -shared -fPIC -o my-synth.so my-synth.c -lm

# Or desktop Linux
gcc -shared -fPIC -o my-synth.so my-synth.c -lm

# Drop it in — no restart needed
cp my-synth.so plugins/synths/

Built with the Plugin SDK

Every instrument and effect in PocketDAW is a community-compilable plugin. These are all running as .so files loaded at runtime.

Synth Editor
Synth Editor — custom params + graphics page
FX Editor
Full-screen FX Editor — GR meter, oscilloscope, particles
Sequencer
64-step pattern sequencer — plugin per MIDI track
Mixer
Mixer — FX chain plugins per strip
Sample Editor
Sample Editor — loaded via plugin host API
Arrange View
Arrangement — 128 bars, per-pattern plugin instances

Ships with 10 plugins

All bundled plugins are open examples. Fork any of them from the SDK repo and build your own variant.

🎹
Synth

PD Synth

8-voice subtractive · 2 osc · SVF filter · ADSR

📻
Synth

FM Synth

4-op FM · 6 algorithms · ratio + depth per op

🌊
Synth

Wavetable

3-type morphing wavetables · per-voice LFO

🌾
Synth

Granular

16-grain cloud · position/scatter/pitch

🥁
Synth

Drum Machine

8-pad sampler · per-pad tune/decay/level

🐯
Synth

JT Synth

Dual osc · ring mod · drive · by Johnytiger

🎤
Synth

Pitcher

Sample-based pitch engine · 6 presets

📼
FX

Tape Delay

Warm tape-saturated delay · feedback + HPF

🔊
FX

Pulse Ring

Ring modulator · carrier osc + envelope

🗜️
FX

JT Sidechain

Sidechain compressor · 6 presets · GR meter

Synth API

Current SDK version: v3.1 (ships with PocketDAW v0.4.0) — backward-compatible with v3.0.
Implement any subset. Only pdsynth_name, pdsynth_create, pdsynth_destroy, and pdsynth_process are required. Everything else is optional.

Symbol Version Description
pdsynth_name()RequiredPlugin display name
pdsynth_create(sr, host)RequiredAllocate instance. Host pointer gives access to primitives.
pdsynth_destroy(inst)RequiredFree instance
pdsynth_process(inst, buf)RequiredFill output buffers. Called every audio frame.
pdsynth_note(inst, midi, vel)OptionalMIDI note on/off (vel=0 is note off)
pdsynth_param_count()OptionalNumber of parameters shown in editor
pdsynth_param_name(i)OptionalParameter label
pdsynth_get_param(inst, i)OptionalGet current value (0.0–1.0)
pdsynth_set_param(inst, i, v)OptionalSet parameter value
pdsynth_draw(inst, renderer, ctx)SDK v3Custom graphics page. ctx has live scope, peak, note state.
pdsynth_preset_count()OptionalNumber of factory presets
pdsynth_preset_name(i)OptionalPreset name by index
pdsynth_load_preset(inst, i)OptionalLoad factory preset
pdsynth_sample_loaded(inst, data, len, sr)OptionalHost calls after user loads a sample file

FX API

FX plugins chain into mixer strips. SDK v2 adds sidechain support. SDK v2.1 adds editor hooks for meters and formatted display.

SymbolVersionDescription
pdfx_name()RequiredPlugin display name
pdfx_create(sr)RequiredAllocate instance
pdfx_destroy(inst)RequiredFree instance
pdfx_process(inst, audio)RequiredProcess in-place stereo buffer
pdfx_needs_sidechain()SDK v2Declare sidechain input requirement
pdfx_set_sidechain(inst, scL, scR, frames)SDK v2Receive sidechain audio each frame
pdfx_get_gain_reduction(inst)SDK v2.1Real-time GR value (0.0–1.0) for editor meter
pdfx_format_param(inst, i)SDK v2.1Custom value display: "5.0ms", "4.2:1"
pdfx_get_accent_color(inst, r, g, b)SDK v2.1Dynamic accent color for full-screen editor
pdfx_param_group(i)SDK v2.1Parameter section grouping label

Host Primitives (SDK v3)

Call these from pdsynth_process via the host pointer. No external dependencies needed.

PrimitiveDescription
host->osc_sample(type, phase, freq)6 waveforms: Sine, Saw, Square, Triangle, Noise, Pulse
host->wavetable_sample(type, phase, morph)3-type morphing wavetables
host->filter_sample(state, in, cutoff, res, mode)2-pole state-variable: LP, HP, BP, Notch
host->adsr_tick(env, gate, a, d, s, r)4-stage ADSR envelope generator
host->fx_process(type, buf, frames, param)Reverb, delay, chorus, distortion, bitcrush

From zero to plugin in 4 steps

1

Clone the SDK

git clone https://github.com/poealone/pocketdaw-sdk — includes headers, all example plugins, build scripts, and manifest templates.

2

Copy an example

Start from examples/jt-synth/ (minimal subtractive) or examples/tape-delay/ (FX). All examples compile with a single gcc command.

3

Compile for your target

Desktop: gcc -shared -fPIC -o my-plugin.so my-plugin.c -lm
Anbernic: aarch64-none-linux-gnu-gcc -shared -fPIC -o my-plugin.so my-plugin.c -lm

4

Drop and run

Copy the .so into plugins/synths/ or plugins/fx/. PocketDAW scans on launch — your plugin appears in the list.

$ full documentation $ sdk repo $ share your plugin