Functions
tSimplePoly

Polyphony handler. More...

Functions

void tSimplePoly_init (tSimplePoly *const poly, int maxNumVoices, LEAF *const leaf)
 Initialize a tSimplePoly to the default mempool of a LEAF instance. More...
 
void tSimplePoly_initToPool (tSimplePoly *const poly, int maxNumVoices, tMempool *const pool)
 Initialize a tSimplePoly to a specified mempool. More...
 
void tSimplePoly_free (tSimplePoly *const poly)
 Free a tSimplePoly from its mempool. More...
 
int tSimplePoly_noteOn (tSimplePoly *const poly, int note, uint8_t vel)
 Add a note with a given velocity to the poly handler. More...
 
int tSimplePoly_noteOff (tSimplePoly *const poly, uint8_t note)
 Remove a note from the poly handler. More...
 
void tSimplePoly_deactivateVoice (tSimplePoly *const polyh, uint8_t voice)
 
int tSimplePoly_markPendingNoteOff (tSimplePoly *const polyh, uint8_t note)
 
int tSimplePoly_findVoiceAssignedToNote (tSimplePoly *const polyh, uint8_t note)
 Find if there is a voice with that note – useful for note offs where you want to wait to remove it from the poly until the release phase of the envelope is finished. More...
 
void tSimplePoly_setNumVoices (tSimplePoly *const poly, uint8_t numVoices)
 Set the number of voices available to play notes. More...
 
int tSimplePoly_getNumVoices (tSimplePoly *const poly)
 Get the current number of voices available to play notes. More...
 
int tSimplePoly_getNumActiveVoices (tSimplePoly *const poly)
 Get the number of voices currently playing notes. More...
 
int tSimplePoly_getPitch (tSimplePoly *const poly, uint8_t voice)
 Get the current MIDI note number of a given voice. More...
 
int tSimplePoly_getPitchAndCheckActive (tSimplePoly *const polyh, uint8_t voice)
 Returns negative one if the voice is inactive.
 
int tSimplePoly_getVelocity (tSimplePoly *const poly, uint8_t voice)
 Get the current MIDI velocity of a given voice. More...
 
int tSimplePoly_isOn (tSimplePoly *const poly, uint8_t voice)
 Get the current play state of a given voice. More...
 

Detailed Description

Polyphony handler.

Function Documentation

◆ tSimplePoly_init()

void tSimplePoly_init ( tSimplePoly *const  poly,
int  maxNumVoices,
LEAF *const  leaf 
)

Initialize a tSimplePoly to the default mempool of a LEAF instance.

Parameters
polyA pointer to the tSimplePoly to initialize.
maxNumVoicesThe maximum number of voices this tSimplePoly can handle at once.
leafA pointer to the leaf instance.

◆ tSimplePoly_initToPool()

void tSimplePoly_initToPool ( tSimplePoly *const  poly,
int  maxNumVoices,
tMempool *const  pool 
)

Initialize a tSimplePoly to a specified mempool.

Parameters
polyA pointer to the tSimplePoly to initialize.
mempoolA pointer to the tMempool to use.

◆ tSimplePoly_free()

void tSimplePoly_free ( tSimplePoly *const  poly)

Free a tSimplePoly from its mempool.

Parameters
polyA pointer to the tSimplePoly to free.

◆ tSimplePoly_noteOn()

int tSimplePoly_noteOn ( tSimplePoly *const  poly,
int  note,
uint8_t  vel 
)

Add a note with a given velocity to the poly handler.

Parameters
polyA pointer to the relevant tSimplePoly.
noteThe MIDI note number to add.
velThe MIDI velocity of the note to add.
Returns
The voice that will play the note.

◆ tSimplePoly_noteOff()

int tSimplePoly_noteOff ( tSimplePoly *const  poly,
uint8_t  note 
)

Remove a note from the poly handler.

Parameters
polyA pointer to the relevant tSimplePoly.
noteThe MIDI note number to remove.
Returns
The voice that was playing the removed note.

◆ tSimplePoly_deactivateVoice()

void tSimplePoly_deactivateVoice ( tSimplePoly *const  polyh,
uint8_t  voice 
)
Parameters

◆ tSimplePoly_markPendingNoteOff()

int tSimplePoly_markPendingNoteOff ( tSimplePoly *const  polyh,
uint8_t  note 
)
Parameters

◆ tSimplePoly_findVoiceAssignedToNote()

int tSimplePoly_findVoiceAssignedToNote ( tSimplePoly *const  polyh,
uint8_t  note 
)

Find if there is a voice with that note – useful for note offs where you want to wait to remove it from the poly until the release phase of the envelope is finished.

Parameters

◆ tSimplePoly_setNumVoices()

void tSimplePoly_setNumVoices ( tSimplePoly *const  poly,
uint8_t  numVoices 
)

Set the number of voices available to play notes.

Parameters
polyA pointer to the relevant tSimplePoly.
numVoicesThe new number of available voices. Cannot be greater than the max number voices given on initialization.

◆ tSimplePoly_getNumVoices()

int tSimplePoly_getNumVoices ( tSimplePoly *const  poly)

Get the current number of voices available to play notes.

Parameters
polyA pointer to the relevant tSimplePoly.
Returns
The current number of voices available to play notes.

◆ tSimplePoly_getNumActiveVoices()

int tSimplePoly_getNumActiveVoices ( tSimplePoly *const  poly)

Get the number of voices currently playing notes.

Parameters
polyA pointer to the relevant tSimplePoly.
Returns
The number of voices currently playing notes.

◆ tSimplePoly_getPitch()

int tSimplePoly_getPitch ( tSimplePoly *const  poly,
uint8_t  voice 
)

Get the current MIDI note number of a given voice.

Parameters
polyA pointer to the relevant tSimplePoly.
voiceThe voice to get the MIDI note number of.
Returns
The MIDI note number of the given voice.

◆ tSimplePoly_getVelocity()

int tSimplePoly_getVelocity ( tSimplePoly *const  poly,
uint8_t  voice 
)

Get the current MIDI velocity of a given voice.

Parameters
polyA pointer to the relevant tSimplePoly.
voiceThe voice to get the MIDI velocity of.
Returns
The current MIDI velocity of the given voice.

◆ tSimplePoly_isOn()

int tSimplePoly_isOn ( tSimplePoly *const  poly,
uint8_t  voice 
)

Get the current play state of a given voice.

Parameters
polyA pointer to the relevant tSimplePoly.
voiceThe voice to get the state of.
Returns
The current play state of the given voice.