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.
#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 }
# 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/
Every instrument and effect in PocketDAW is a community-compilable plugin. These are all running as .so files loaded at runtime.
All bundled plugins are open examples. Fork any of them from the SDK repo and build your own variant.
8-voice subtractive · 2 osc · SVF filter · ADSR
4-op FM · 6 algorithms · ratio + depth per op
3-type morphing wavetables · per-voice LFO
16-grain cloud · position/scatter/pitch
8-pad sampler · per-pad tune/decay/level
Dual osc · ring mod · drive · by Johnytiger
Sample-based pitch engine · 6 presets
Warm tape-saturated delay · feedback + HPF
Ring modulator · carrier osc + envelope
Sidechain compressor · 6 presets · GR meter
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() | Required | Plugin display name |
| pdsynth_create(sr, host) | Required | Allocate instance. Host pointer gives access to primitives. |
| pdsynth_destroy(inst) | Required | Free instance |
| pdsynth_process(inst, buf) | Required | Fill output buffers. Called every audio frame. |
| pdsynth_note(inst, midi, vel) | Optional | MIDI note on/off (vel=0 is note off) |
| pdsynth_param_count() | Optional | Number of parameters shown in editor |
| pdsynth_param_name(i) | Optional | Parameter label |
| pdsynth_get_param(inst, i) | Optional | Get current value (0.0–1.0) |
| pdsynth_set_param(inst, i, v) | Optional | Set parameter value |
| pdsynth_draw(inst, renderer, ctx) | SDK v3 | Custom graphics page. ctx has live scope, peak, note state. |
| pdsynth_preset_count() | Optional | Number of factory presets |
| pdsynth_preset_name(i) | Optional | Preset name by index |
| pdsynth_load_preset(inst, i) | Optional | Load factory preset |
| pdsynth_sample_loaded(inst, data, len, sr) | Optional | Host calls after user loads a sample file |
FX plugins chain into mixer strips. SDK v2 adds sidechain support. SDK v2.1 adds editor hooks for meters and formatted display.
| Symbol | Version | Description |
|---|---|---|
| pdfx_name() | Required | Plugin display name |
| pdfx_create(sr) | Required | Allocate instance |
| pdfx_destroy(inst) | Required | Free instance |
| pdfx_process(inst, audio) | Required | Process in-place stereo buffer |
| pdfx_needs_sidechain() | SDK v2 | Declare sidechain input requirement |
| pdfx_set_sidechain(inst, scL, scR, frames) | SDK v2 | Receive sidechain audio each frame |
| pdfx_get_gain_reduction(inst) | SDK v2.1 | Real-time GR value (0.0–1.0) for editor meter |
| pdfx_format_param(inst, i) | SDK v2.1 | Custom value display: "5.0ms", "4.2:1" |
| pdfx_get_accent_color(inst, r, g, b) | SDK v2.1 | Dynamic accent color for full-screen editor |
| pdfx_param_group(i) | SDK v2.1 | Parameter section grouping label |
Call these from pdsynth_process via the host pointer. No external dependencies needed.
| Primitive | Description |
|---|---|
| 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 |
git clone https://github.com/poealone/pocketdaw-sdk — includes headers, all example plugins, build scripts, and manifest templates.
Start from examples/jt-synth/ (minimal subtractive) or examples/tape-delay/ (FX). All examples compile with a single gcc command.
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
Copy the .so into plugins/synths/ or plugins/fx/. PocketDAW scans on launch — your plugin appears in the list.