pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
Core Plink concepts.
Fundamentals

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.

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:

 All Classes Functions Typedefs Enumerations Enumerator Properties