![]() |
pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
|
An outline of the core concepts used in Plink. More...
An outline of the core concepts used in Plink.
Plink has the concept of processes, which are data structures that contain audio and control data buffers and information about the buffers such as size and the number of input and/or output buffers.
typedef struct PlinkBufferF { int bufferSize; float* buffer; } PlinkBufferF; typedef struct PlinkProcessBase { void* userData; int numOutputs; int numInputs; int numBuffers; } PlinkProcessBase; typedef struct PlinkProcessF { PlinkProcessBase base; PlinkBufferF buffers[1]; } PlinkProcessF; typedef struct PlinkState { double sampleRate; double sampleDuration; } PlinkState;
Processing functions
Processing functions operate on process structs. Processing is achieved using a primary function, which branches into subfunctions according to the input and output block sizes specified in the process struct. Thus for a sawtooth generator we have the following prototypes:
void plink_SawProcessF_NN (void* pp, SawProcessStateF* state); void plink_SawProcessF_N1 (void* pp, SawProcessStateF* state); void plink_SawProcessF_Nn (void* pp, SawProcessStateF* state); void plink_SawProcessF (void* pp, SawProcessStateF* state);
plink_SawProcessF() is the primary function. The subfunctions use a function suffix notation to indicate the number and size of the buffers they expect to process.
N
indicates the output buffer's block size in samples.n
indicates some other arbitrary blocksize that is neither N
nor 1. n
appearing in the list more than once might be a different value of n
, n
could be larger than N
.So in the above plink_SawProcessF() example, we can see that the function expects to have 2 buffers to process. NN indicates that both buffers have the same size. N1
indicates that the input buffer is of size 1, and Nn
indicates that the input buffer is of some arbitrary size. e.g. for N=512: