VST 3 Examples VST 3.7
SDK for developing VST plug-in
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
}
else
{
delete voiceProcessor;
voiceProcessor = 0;
}
return kResultTrue;
}
//------------------------------------------------------------------------
tresult PLUGIN_API MySynthProcessor::process (ProcessData& data)
{
return voiceProcessor->process (data);
}
virtual tresult process(ProcessData &data)=0
VoiceProcessor()
Definition: voiceprocessor.h:111
uint8 TBool
int32 tresult
#define MAX_VOICES
Definition: note_expression_synth_controller.h:48
See also
Steinberg::Vst::VoiceProcessorImplementation

Constructor & Destructor Documentation

◆ VoiceProcessor()

VoiceProcessor ( )
inline

◆ ~VoiceProcessor()

virtual ~VoiceProcessor ( )
inlinevirtual

Member Function Documentation

◆ process()

◆ processEvent()

◆ 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.