Functions
tPoly

Polyphony handler with glide and pitch bend options. More...

Functions

void tPoly_init (tPoly *const poly, int maxNumVoices, LEAF *const leaf)
 Initialize a tPoly to the default mempool of a LEAF instance. More...
 
void tPoly_initToPool (tPoly *const poly, int maxNumVoices, tMempool *const pool)
 Initialize a tPoly to a specified mempool. More...
 
void tPoly_free (tPoly *const poly)
 Free a tPoly from its mempool. More...
 
int tPoly_noteOn (tPoly *const poly, int note, uint8_t vel)
 Add a note with a given velocity to the poly handler. More...
 
int tPoly_noteOff (tPoly *const poly, uint8_t note)
 Remove a note from the poly handler. More...
 
void tPoly_orderedAddToStack (tPoly *const poly, uint8_t note)
 
void tPoly_setNumVoices (tPoly *const poly, uint8_t numVoices)
 Set the number of voices available to play notes. More...
 
void tPoly_setPitchGlideActive (tPoly *const poly, int isActive)
 Set whether pitch glide over note changes in voices is active. More...
 
void tPoly_setPitchGlideTime (tPoly *const poly, float t)
 Set how long pitch glide over note changes in voices takes. More...
 
void tPoly_setPitchBend (tPoly *const poly, float pitchBend)
 Set the amount of pitch bend. More...
 
void tPoly_setBendGlideTime (tPoly *const poly, float t)
 
void tPoly_setBendSamplesPerTick (tPoly *const poly, float t)
 
void tPoly_tickPitch (tPoly *const poly)
 Execute all tick-rate changes in the poly handler's pitch, including glide and bend. More...
 
void tPoly_tickPitchGlide (tPoly *const poly)
 Execute the tick-rate change of the poly handler's pitch glide. More...
 
void tPoly_tickPitchBend (tPoly *const poly)
 Execute the tick-rate change of the poly handler's pitch bend. More...
 
int tPoly_getNumVoices (tPoly *const poly)
 Get the current number of voices available to play notes. More...
 
int tPoly_getNumActiveVoices (tPoly *const poly)
 Get the number of voices currently playing notes. More...
 
float tPoly_getPitch (tPoly *const poly, uint8_t voice)
 Get the current pitch of a given voice. More...
 
int tPoly_getKey (tPoly *const poly, uint8_t voice)
 Get the current MIDI note number of a given voice. More...
 
int tPoly_getVelocity (tPoly *const poly, uint8_t voice)
 Get the current MIDI velocity of a given voice. More...
 
int tPoly_isOn (tPoly *const poly, uint8_t voice)
 Get the current play state of a given voice. More...
 

Detailed Description

Polyphony handler with glide and pitch bend options.

Function Documentation

◆ tPoly_init()

void tPoly_init ( tPoly *const  poly,
int  maxNumVoices,
LEAF *const  leaf 
)

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

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

◆ tPoly_initToPool()

void tPoly_initToPool ( tPoly *const  poly,
int  maxNumVoices,
tMempool *const  pool 
)

Initialize a tPoly to a specified mempool.

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

◆ tPoly_free()

void tPoly_free ( tPoly *const  poly)

Free a tPoly from its mempool.

Parameters
polyA pointer to the tPoly to free.

◆ tPoly_noteOn()

int tPoly_noteOn ( tPoly *const  poly,
int  note,
uint8_t  vel 
)

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

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

◆ tPoly_noteOff()

int tPoly_noteOff ( tPoly *const  poly,
uint8_t  note 
)

Remove a note from the poly handler.

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

◆ tPoly_orderedAddToStack()

void tPoly_orderedAddToStack ( tPoly *const  poly,
uint8_t  note 
)
Parameters

◆ tPoly_setNumVoices()

void tPoly_setNumVoices ( tPoly *const  poly,
uint8_t  numVoices 
)

Set the number of voices available to play notes.

Parameters
polyA pointer to the relevant tPoly.
numVoicesThe new number of available voices. Cannot be greater than the max number voices given in tPoly_init().

◆ tPoly_setPitchGlideActive()

void tPoly_setPitchGlideActive ( tPoly *const  poly,
int  isActive 
)

Set whether pitch glide over note changes in voices is active.

Parameters
polyA pointer to the relevant tPoly.
isActiveWhether pitch glide should be active or not.

◆ tPoly_setPitchGlideTime()

void tPoly_setPitchGlideTime ( tPoly *const  poly,
float  t 
)

Set how long pitch glide over note changes in voices takes.

Parameters
polyA pointer to the relevant tPoly.
tThe time to glide in milliseconds.

◆ tPoly_setPitchBend()

void tPoly_setPitchBend ( tPoly *const  poly,
float  pitchBend 
)

Set the amount of pitch bend.

Parameters
polyA pointer to the relevant tPoly.
pitchBendThe new amount of pitch bend.

◆ tPoly_setBendGlideTime()

void tPoly_setBendGlideTime ( tPoly *const  poly,
float  t 
)
Parameters

◆ tPoly_setBendSamplesPerTick()

void tPoly_setBendSamplesPerTick ( tPoly *const  poly,
float  t 
)
Parameters

◆ tPoly_tickPitch()

void tPoly_tickPitch ( tPoly *const  poly)

Execute all tick-rate changes in the poly handler's pitch, including glide and bend.

Parameters
polyA pointer to the relevant tPoly.

◆ tPoly_tickPitchGlide()

void tPoly_tickPitchGlide ( tPoly *const  poly)

Execute the tick-rate change of the poly handler's pitch glide.

Parameters
polyA pointer to the relevant tPoly.

◆ tPoly_tickPitchBend()

void tPoly_tickPitchBend ( tPoly *const  poly)

Execute the tick-rate change of the poly handler's pitch bend.

Parameters
polyA pointer to the relevant tPoly.

◆ tPoly_getNumVoices()

int tPoly_getNumVoices ( tPoly *const  poly)

Get the current number of voices available to play notes.

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

◆ tPoly_getNumActiveVoices()

int tPoly_getNumActiveVoices ( tPoly *const  poly)

Get the number of voices currently playing notes.

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

◆ tPoly_getPitch()

float tPoly_getPitch ( tPoly *const  poly,
uint8_t  voice 
)

Get the current pitch of a given voice.

Parameters
polyA pointer to the relevant tPoly.
voiceThe voice to get the pitch of.
Returns
The current pitch of the given voice as a fractional MIDI note number.

◆ tPoly_getKey()

int tPoly_getKey ( tPoly *const  poly,
uint8_t  voice 
)

Get the current MIDI note number of a given voice.

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

◆ tPoly_getVelocity()

int tPoly_getVelocity ( tPoly *const  poly,
uint8_t  voice 
)

Get the current MIDI velocity of a given voice.

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

◆ tPoly_isOn()

int tPoly_isOn ( tPoly *const  poly,
uint8_t  voice 
)

Get the current play state of a given voice.

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