A base class for synth voices, to be used with the Synth template class. You don't have to make your voice classes inherit this one, but it makes some things easier.
| unsigned char LV2::Voice::get_key |
( |
| ) |
const |
|
inline |
Return the MIDI key that the voice is currently playing. LV2::INVALID_KEY means that the voice is not active and could be used to play a new note.
Referenced by LV2::Synth< V, D, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7 >::find_free_voice(), and LV2::Synth< V, D, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7 >::handle_midi().
| void LV2::Voice::on |
( |
unsigned char |
key, |
|
|
unsigned char |
velocity |
|
) |
| |
|
inline |
Turn the voice on. This default implementation does nothing, you probably want to override it.
If key is LV2::INVALID_KEY the voice should go silent as fast at possible (the synth may use this when it receives an All Sound Off event).
- Parameters
-
| key | The MIDI key for the note that the voice should play. |
| velocity | The MIDI velocity for the Note On event. |
Referenced by LV2::Synth< V, D, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7 >::handle_midi().
| void LV2::Voice::render |
( |
uint32_t |
from, |
|
|
uint32_t |
to |
|
) |
| |
|
inline |
Render audio for this voice to the output buffers, from sample from to sample to. The buffers may already contain audio from other voices, so use += instead of = when writing to it. This default implementation does nothing, you probably want to override it.
Referenced by LV2::Synth< V, D, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7 >::run().