VST 3 Examples VST 3.7 SDK for developing VST plug-in

Public Member Functions | Protected Attributes | List of all members
VoiceProcessor Class Referenceabstract

A Voice Processor class. More...

`#include <voiceprocessor.h>`

Inheritance diagram for VoiceProcessor:

## Public Member Functions
| VoiceProcessor ()
virtual | ~VoiceProcessor ()
virtual tresult | process (ProcessData &data)=0
virtual void | processEvent (Event evt)=0
int32 | getActiveVoices () const
| Returns the number of active voices. More...
void | clearOutputNeeded (bool val)

## Protected Attributes
int32 | activeVoices {0}
bool | mClearOutputNeeded {true}

## Detailed Description

A Voice Processor class.

A virtual base class for a voice manager implementation.

The idea behind this class is to make it easier to support either single precision or double precision samples (float or double) or different channel layouts.

Example:

//------------------------------------------------------------------------
class MySynthProcessor : public AudioEffect
{
public:
tresult PLUGIN_API setActive (TBool state);
tresult PLUGIN_API process (ProcessData& data);
protected:
VoiceProcessor* voiceProcessor;
};
//------------------------------------------------------------------------
tresult PLUGIN_API MySynthProcessor::setActive (TBool state)
{
if (state)
{
if (processSetup.symbolicSampleSize == kSample32)
voiceProcessor = new VoiceProcessorImplementation<float, Voice<float>, 2, MAX_VOICES, void> (processSetup.sampleRate, 0);
else if (processSetup.symbolicSampleSize == kSample64)
voiceProcessor = new VoiceProcessorImplementation<double, Voice<double>, 2, MAX_VOICES, void> (processSetup.sampleRate, 0);
else
return kInvalidArgument;
}
else
{
delete voiceProcessor;
voiceProcessor = 0;
}
return kResultTrue;
}
//------------------------------------------------------------------------
tresult PLUGIN_API MySynthProcessor::process (ProcessData& data)
{
return voiceProcessor->process (data);
}
Steinberg::Vst::VoiceProcessor::process
virtual tresult process(ProcessData &data)=0
Steinberg::Vst::VoiceProcessor::VoiceProcessor
VoiceProcessor()
Definition: voiceprocessor.h:111
Steinberg::Vst::kSample32
kSample32
Steinberg::Vst::kSample64
kSample64
Steinberg::kResultTrue
kResultTrue
Steinberg::kInvalidArgument
kInvalidArgument
TBool
uint8 TBool
tresult
int32 tresult
MAX_VOICES
#define MAX_VOICES
Definition: note_expression_synth_controller.h:48

See also
  Steinberg::Vst::VoiceProcessorImplementation

## Constructor & Destructor Documentation

## ◆ VoiceProcessor()

VoiceProcessor | ( |  | ) |
| inline

## ◆ ~VoiceProcessor()

virtual ~VoiceProcessor | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ process()

virtual tresult process | ( | ProcessData & | data | ) |
| pure virtual

Implemented in VoiceProcessorImplementation< Precision, VoiceClass, numChannels, maxVoices, GlobalParameterStorage >.

## ◆ processEvent()

virtual void processEvent | ( | Event | evt | ) |
| pure virtual

Implemented in VoiceProcessorImplementation< Precision, VoiceClass, numChannels, maxVoices, GlobalParameterStorage >.

## ◆ getActiveVoices()

int32 getActiveVoices | ( |  | ) | const
| inline

Returns the number of active voices.

## ◆ clearOutputNeeded()

void clearOutputNeeded | ( | bool | val | ) |
| inline

## Member Data Documentation

## ◆ activeVoices

int32 activeVoices {0}
| protected

## ◆ mClearOutputNeeded

bool mClearOutputNeeded {true}
| protected

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.