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

Go to the source code of this file.

Macros

#define ppg_sequence(...)   ppg_single_note_line(__VA_ARGS__)
 

Enumerations

enum  PPG_Note_Flags { PPG_Note_Flag_Match_Activation = (1 << 2), PPG_Note_Flag_Match_Deactivation = (PPG_Note_Flag_Match_Activation << 1), PPG_Note_Flags_A_N_D = PPG_Note_Flag_Match_Activation | PPG_Note_Flag_Match_Deactivation }
 Flags that configure note behavior. More...
 

Functions

PPG_Token ppg_single_note_line (PPG_Layer layer, PPG_Action action, PPG_Count n_inputs, PPG_Input_Id inputs[])
 Defines a stand alone pattern that consists of single notes. More...
 
PPG_Token ppg_note_create (PPG_Input_Id input, PPG_Count flags)
 Generates a note token. More...
 
PPG_Token ppg_note_create_standard (PPG_Input_Id input)
 Generates a note token with standard behavior. More...
 

Macro Definition Documentation

#define ppg_sequence (   ...)    ppg_single_note_line(__VA_ARGS__)

An alias for ppg_single_note_line

Enumeration Type Documentation

Flags that configure note behavior.

Use the functions ppg_token_set_flags and ppg_token_get_flags to manipulated note flags.

Enumerator
PPG_Note_Flag_Match_Activation 

Match activation of corresponding input.

PPG_Note_Flag_Match_Deactivation 

Match deactivation of corresponding input.

PPG_Note_Flags_A_N_D 

Match activation and deactivation of corresponding input (only if compiled in pedantic mode)

Function Documentation

PPG_Token ppg_note_create ( PPG_Input_Id  input,
PPG_Count  flags 
)

Generates a note token.

Use this function to generate tokens that are passed to the ppg_pattern function to generate complex patterns.

Note
Notes 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
inputThe input that is represented by the note
flagsThe note flags
Returns
The constructed tokenis
PPG_Token ppg_note_create_standard ( PPG_Input_Id  input)

Generates a note token with standard behavior.

Use this function to generate tokens that are passed to the ppg_pattern function to generate complex patterns.

This is a convenience function that yields the same result as ppg_note_create(input, PPG_Note_Flags_A_N_D)

Note
Notes 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
inputThe input that is represented by the note
Returns
The constructed tokenis
PPG_Token ppg_single_note_line ( PPG_Layer  layer,
PPG_Action  action,
PPG_Count  n_inputs,
PPG_Input_Id  inputs[] 
)

Defines a stand alone pattern that consists of single notes.

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 passed as array
inputsInputpositions that represent the notes of the single note line
Returns
The constructed token