Papageno
An Advanced Pattern Matching Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Enumerations | Functions
ppg_cluster.h File Reference
#include "ppg_token.h"
#include "ppg_input.h"
#include "ppg_layer.h"

Go to the source code of this file.

Macros

#define PPG_CLUSTER_CREATE(...)   ppg_cluster_create(PPG_INPUTS(__VA_ARGS__))
 Auxiliary macro to create a cluster based on a set of input specifications. More...
 

Enumerations

enum  PPG_Cluster_Flags { PPG_Cluster_Flags_Disallow_Input_Deactivation = (1 << 3) }
 Flags that configure cluster behavior. More...
 

Functions

PPG_Token ppg_cluster (PPG_Layer layer, PPG_Action action, PPG_Count n_inputs, PPG_Input_Id inputs[])
 Defines a stand alone note cluster. More...
 
PPG_Token ppg_cluster_create (PPG_Count n_inputs, PPG_Input_Id inputs[])
 Generates a cluster token. More...
 

Macro Definition Documentation

#define PPG_CLUSTER_CREATE (   ...)    ppg_cluster_create(PPG_INPUTS(__VA_ARGS__))

Auxiliary macro to create a cluster based on a set of input specifications.

Parameters
...A list of inputs

Enumeration Type Documentation

Flags that configure cluster behavior.

Use the functions ppg_token_set_flags and ppg_token_get_flags to manipulated cluster flags.

Enumerator
PPG_Cluster_Flags_Disallow_Input_Deactivation 

Set this flag to gain.

Function Documentation

PPG_Token ppg_cluster ( PPG_Layer  layer,
PPG_Action  action,
PPG_Count  n_inputs,
PPG_Input_Id  inputs[] 
)

Defines a stand alone note cluster.

All members must be activated/pressed at least once for the cluster to be considered as match.

Parameters
layerThe layer the pattern is associated with
actionThe action that is supposed to be carried out if the pattern matches
n_inputsThe number of inputs
inputsA pointer to an array of input definitions.
Returns
The constructed token
PPG_Token ppg_cluster_create ( PPG_Count  n_inputs,
PPG_Input_Id  inputs[] 
)

Generates a cluster token.

Use this function to generate tokens that are passed to the ppg_pattern function to generate complex patterns. Every member of the cluster must have been activated at least once for the cluster to be considered as match.

Note
Clusters that are generated by this function must be passed to ppg_pattern to be effective
Use setter functions that operate on tokens to change attributes of the generated token
Parameters
n_inputsThe number of inputs that are associated with the cluster
inputsAn array of input ids that represent the notes of the cluster
Returns
The constructed token