ofxPDSP
pdsp::ComputerKeyboard Class Reference

Public Member Functions

void keyPressed (int key)
 
void keyReleased (int key)
 
void setKeysToggle (bool active)
 when active, pressing a key generate a note on and pressing it again a note off More...
 
void setPolyMode (int voices)
 set the mode to Poly, with the given max notes More...
 
void setMonoMode (bool legato, pdsp::MonoPriority priority=pdsp::Last)
 set the mode to Mono, with the given control parameters More...
 
int getVoicesNumber () const
 returns the actual voice number
 
void setPortamento (pdsp::PortamentoMode mode, float timeMs)
 sets the portamento parameters More...
 
void draw (int x, int y, int w, int h)
 draws some graphics and infos about the state of the object More...
 
pdsp::TriggerControlout_trig (int voice)
 returns the trigger output of the given voice More...
 
pdsp::ValueControlout_pitch (int voice)
 returns the pitch output of the given voice More...
 

Public Attributes

vector< int > keys
 this vector holds 12 int values that rapresents the keys that triggers the notes. By default it is initalized to the keys of a qwerty keyboard, but you can change that manually
 

Member Function Documentation

◆ draw()

void pdsp::ComputerKeyboard::draw ( int  x,
int  y,
int  w,
int  h 
)

draws some graphics and infos about the state of the object

Parameters
[in]xx coordinate
[in]yy coordinate
[in]wwidth
[in]hheight

◆ out_pitch()

pdsp::ValueControl & pdsp::ComputerKeyboard::out_pitch ( int  voice)

returns the pitch output of the given voice

Parameters
[in]voicevoice number. It won't be clamped, so use a valid voice number to avoid segfaults.

◆ out_trig()

pdsp::TriggerControl & pdsp::ComputerKeyboard::out_trig ( int  voice)

returns the trigger output of the given voice

Parameters
[in]voicevoice number. It won't be clamped, so use a valid voice number to avoid segfaults.

◆ setKeysToggle()

void pdsp::ComputerKeyboard::setKeysToggle ( bool  active)

when active, pressing a key generate a note on and pressing it again a note off

Parameters
[in]activetrue for activating the mode, false by default

◆ setMonoMode()

void pdsp::ComputerKeyboard::setMonoMode ( bool  legato,
pdsp::MonoPriority  priority = pdsp::Last 
)

set the mode to Mono, with the given control parameters

Parameters
[in]legatotrue if you want to retrigger the envelopes only when all the key are released
[in]priorityyou can use Last, Low or High as parameter

◆ setPolyMode()

void pdsp::ComputerKeyboard::setPolyMode ( int  voices)

set the mode to Poly, with the given max notes

Parameters
[in]maxNotesmax note for the polyphony, 4 is the minimum

Note stealing will steal the oldest note that are not the highest or the lowest playing notes

◆ setPortamento()

void pdsp::ComputerKeyboard::setPortamento ( pdsp::PortamentoMode  mode,
float  timeMs 
)

sets the portamento parameters

Parameters
[in]portamentoModeOff or On
[in]timeMsslew time in milliseconds

The documentation for this class was generated from the following files: