csnd namespace provides a modern C++ framework for writing Csound plugins with template-based classes, container types, and utility functions.
Location: include/plugin.h
Plugin base classes
Plugin template
include/plugin.h:987
The Plugin template is the main base class for opcodes with both inputs and outputs.
Template parameters:
N- Number of output argumentsM- Number of input arguments
InPlug template
include/plugin.h:860
Base class for opcodes with only input arguments (no outputs), or for opcodes with variable argument counts.
FPlugin template
include/plugin.h:1124
Specialized base class for frequency-domain signal (fsig) processing plugins.
Parameter access
Param template
include/plugin.h:783
Access methods:
outargs[n]/inargs[n]- Dereference to get/set scalar valueoutargs(n)/inargs(n)- Get pointer for direct buffer accessinargs.str_data(n)- Access string argumentinargs.fsig_data(n)- Access fsig argumentinargs.vector_data<MYFLT>(n)- Access array argument
Container classes
Vector template
include/plugin.h:347
Container for one-dimensional arrays with STL-compatible iterators.
Example:
AudioSig class
include/plugin.h:272
Wraps audio signals with automatic sample-accurate timing support.
Parameters:
p- Plugin object pointers- Audio signal pointerres- If true, resets output buffer to zero
Fsig class
include/plugin.h:498
Container for frequency-domain signals (phase vocoder data).
Pvframe template
include/plugin.h:585
Phase vocoder frame container with bin access.
Types:
pv_frame- Standard PV frame (Pvframe<pv_bin>)spv_frame- Sliding PV frame (Pvframe<spv_bin>)
Pvbin template
include/plugin.h:419
Represents a single phase vocoder bin (amplitude-frequency pair).
Example:
Table class
include/plugin.h:645
Function table container with array-like access.
Example:
AuxMem template
include/plugin.h:717
Dynamic memory allocation using Csound’s AuxAlloc mechanism.
Example:
Csound engine access
Thecsnd::Csound class provides engine access methods:
include/plugin.h:59
Access via csound member in plugin classes.
Plugin registration
plugin function
include/plugin.h:1170
Registers a plugin opcode.
Parameters:
csound- Csound engine pointername- Opcode nameoargs- Output argument typesiargs- Input argument typesthr- Thread specification (see below)flags- Optional flagsdeprec- Deprecation flag
Thread specification
include/plugin.h:48
Argument type strings
Common type specifiers:i- i-rate scalark- k-rate scalara- a-rate audioS- stringf- fsig (frequency-domain signal)[]- array (e.g.,i[],k[])m- multiple (variable number)o- optional.- any type
Registration example
Plugin helper methods
Plugin base classes provide these helper methods:Thread class
include/plugin.h:249
Base class for creating threads within Csound.
Example:
Constants
include/plugin.h:44