|
virtual bool | GetBusy () const =0 |
|
virtual void | Trigger (double level, bool isRetrigger) |
| Trigger is called by the VoiceAllocator when a new voice should start, or if the voice limit has been hit and an existing voice needs to re-trigger. More...
|
|
virtual void | Release () |
| As with Trigger, called to do optional tasks when a voice is released. More...
|
|
virtual void | ProcessSamplesAccumulating (sample **inputs, sample **outputs, int nInputs, int nOutputs, int startIdx, int nFrames) |
| Process a block of audio data for the voice. More...
|
|
virtual void | SetSampleRateAndBlockSize (double sampleRate, int blockSize) |
| Implement this if you need to do work when the sample rate or block size changes. More...
|
|
virtual void | SetProgramNumber (int pgm) |
| Implement this to allow picking a sound program from an integer index, as with MIDI. More...
|
|
virtual void | SetControl (int controlNumber, float value) |
| Implement this to respond to control numbers for which there are not ramps. More...
|
|
Definition at line 54 of file SynthVoice.h.
◆ ~SynthVoice()
virtual SynthVoice::~SynthVoice |
( |
| ) |
|
|
inlinevirtual |
◆ GetBusy()
virtual bool SynthVoice::GetBusy |
( |
| ) |
const |
|
pure virtual |
◆ ProcessSamplesAccumulating()
virtual void SynthVoice::ProcessSamplesAccumulating |
( |
sample ** |
inputs, |
|
|
sample ** |
outputs, |
|
|
int |
nInputs, |
|
|
int |
nOutputs, |
|
|
int |
startIdx, |
|
|
int |
nFrames |
|
) |
| |
|
inlinevirtual |
Process a block of audio data for the voice.
- Parameters
-
inputs | Pointer to input channel arrays. Sometimes synthesisers have audio inputs. Alternatively you can pass in modulation from global LFOs etc here. |
outputs | Pointer to output channel arrays. You should add to the existing data in these arrays (so that all the voices get summed) |
nInputs | The number of input channels that contain valid data |
nOutputs | The number of output channels that contain valid data |
startIdx | The start index of the block of samples to process |
nFrames | The number of samples to process in this block |
Definition at line 78 of file SynthVoice.h.
◆ Release()
virtual void SynthVoice::Release |
( |
| ) |
|
|
inlinevirtual |
As with Trigger, called to do optional tasks when a voice is released.
Definition at line 69 of file SynthVoice.h.
◆ SetControl()
virtual void SynthVoice::SetControl |
( |
int |
controlNumber, |
|
|
float |
value |
|
) |
| |
|
inlinevirtual |
Implement this to respond to control numbers for which there are not ramps.
A synthesizer could use its own ramps internally if needed.
- Parameters
-
controlNumber | The MIDI controller number |
value | The normalized value |
Definition at line 102 of file SynthVoice.h.
◆ SetProgramNumber()
virtual void SynthVoice::SetProgramNumber |
( |
int |
pgm | ) |
|
|
inlinevirtual |
Implement this to allow picking a sound program from an integer index, as with MIDI.
- Parameters
-
pgm | The new program number |
Definition at line 96 of file SynthVoice.h.
◆ SetSampleRateAndBlockSize()
virtual void SynthVoice::SetSampleRateAndBlockSize |
( |
double |
sampleRate, |
|
|
int |
blockSize |
|
) |
| |
|
inlinevirtual |
Implement this if you need to do work when the sample rate or block size changes.
- Parameters
-
sampleRate | The new sample rate |
blockSize | The new block size in samples |
Definition at line 92 of file SynthVoice.h.
◆ Trigger()
virtual void SynthVoice::Trigger |
( |
double |
level, |
|
|
bool |
isRetrigger |
|
) |
| |
|
inlinevirtual |
Trigger is called by the VoiceAllocator when a new voice should start, or if the voice limit has been hit and an existing voice needs to re-trigger.
While the VoiceInputs are sufficient to control a voice from the VoiceAllocator, this method can be used to do additional tasks like resetting oscillators.
- Parameters
-
level | Normalised starting level for this voice, derived from the velocity of the keypress, or in the case of a re-trigger the existing level |
- Todo:
- check
- Parameters
-
isRetrigger | If this is true it means the voice is being re-triggered, and you should accommodate for this in your algorithm |
Definition at line 66 of file SynthVoice.h.
◆ MidiSynth
◆ VoiceAllocator
◆ mBasePitch
double SynthVoice::mBasePitch {0.} |
|
protected |
◆ mChannel
uint8_t SynthVoice::mChannel {0} |
|
protected |
◆ mGain
double SynthVoice::mGain {0.} |
|
protected |
◆ mInputs
VoiceInputs SynthVoice::mInputs |
|
protected |
◆ mKey
uint8_t SynthVoice::mKey {0} |
|
protected |
◆ mLastTriggeredTime
int64_t SynthVoice::mLastTriggeredTime {-1} |
|
protected |
◆ mVoiceNumber
uint8_t SynthVoice::mVoiceNumber {0} |
|
protected |
◆ mZone
uint8_t SynthVoice::mZone {0} |
|
protected |
The documentation for this class was generated from the following file: