Plugin API Reference
The host ↔ plugin interface for Mcaster1AMP Plugin SDK v2.
Lifecycle
| Symbol | Direction | Purpose |
|---|---|---|
mc1_plugin_main() | plugin → host | Returns the descriptor; called once at load. |
create() | host → plugin | Allocate state for a sample rate / max block size. |
destroy() | host → plugin | Free state on unload or hot-reload. |
DSP interface
| Callback | Thread | Notes |
|---|---|---|
process(state, in, out, frames) | audio | Real-time; no allocations, no locks, no syscalls. |
set_param(state, id, value) | audio/UI | Atomic parameter update; keep it wait-free. |
Input interface
| Callback | Returns | Notes |
|---|---|---|
open(url) | int | Resolve/connect a source; 0 = success. |
read(buf, frames) | int | Fill interleaved float PCM; returns frames produced. |
close() | void | Tear down the source. |
Output interface
| Callback | Thread | Notes |
|---|---|---|
write(buf, frames) | audio | Sink the playback bus to a device/encoder. |
flush() | any | Drain buffers on stop. |
Parameters
Each parameter has an id, name, min, max, and
def. The host renders a control, persists the value with the project, and may automate
it. Read incoming changes via set_param.
Host services
The host exposes a small services struct for logging, sample-rate queries, and (opt-in) access to the AI backends for metadata-aware behavior. Treat all host calls as non-real-time unless documented otherwise.
ABI beta — symbol names may evolve. Pin to
MC1_ABI_VERSION and watch the changelog.