Papageno
An Advanced Pattern Matching Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Enumerations | Functions
ppg_chord.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_CHORD_CREATE(...)   ppg_chord_create(PPG_INPUTS(__VA_ARGS__))
 Auxiliary macro to create a chord based on a set of input specifications. More...
 

Enumerations

enum  PPG_Chord_Flags { PPG_Chord_Flags_Disallow_Input_Deactivation = (1 << 3) }
 Flags that configure chord behavior. More...
 

Functions

PPG_Token ppg_chord (PPG_Layer layer, PPG_Action action, PPG_Count n_inputs, PPG_Input_Id inputs[])
 Defines a stand alone magic chord. More...
 
PPG_Token ppg_chord_create (PPG_Count n_inputs, PPG_Input_Id inputs[])
 Generates a chord token. More...
 

Macro Definition Documentation

#define PPG_CHORD_CREATE (   ...)    ppg_chord_create(PPG_INPUTS(__VA_ARGS__))

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

Parameters
...A list of inputs

Enumeration Type Documentation

Flags that configure chord behavior.

Use the functions ppg_token_set_flags and ppg_token_get_flags to manipulated chord flags.

Enumerator
PPG_Chord_Flags_Disallow_Input_Deactivation 

Set this flag to gain.

Function Documentation

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

Defines a stand alone magic chord.

All members must be activated/pressed simultaneously for a chord to be considered as a match.

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

Generates a chord token.

Use this function to generate tokens that are be passed to the ppg_pattern function to generate complex patterns. All notes of a chord must have been pressed at the same time time for the chord to match.

Note
Chords 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 chord
inputsAn array of inputs that represent the notes of the chord
Returns
The constructed token