VST 3 Examples: VoiceProcessor Class Reference
Author: Steinberg

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

Loading...
Searching...
No Matches
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
virtual void | clearAllVoices ()
int32 | getActiveVoices () const
| Returns the number of active voices.
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::AudioEffect
Steinberg::Vst::AudioEffect::process
tresult process(ProcessData &data) SMTG_OVERRIDE
Steinberg::Vst::Component::setActive
tresult setActive(TBool state) SMTG_OVERRIDE
Steinberg::Vst::VoiceProcessorImplementation
A Simple Voice Processor Implementation supporting note expression events.
Definition voiceprocessor.h:142
Steinberg::Vst::VoiceProcessor::VoiceProcessor
VoiceProcessor()
Definition voiceprocessor.h:91
Steinberg::TBool
uint8 TBool
Steinberg::tresult
int32 tresult
Steinberg::Vst::kSample32
kSample32
Steinberg::Vst::kSample64
kSample64
Steinberg::kResultTrue
kResultTrue
Steinberg::kInvalidArgument
kInvalidArgument
MAX_VOICES
#define MAX_VOICES
Definition note_expression_synth_controller.h:29
Steinberg::Vst::ProcessData

See also
  Steinberg::Vst::VoiceProcessorImplementation

## Constructor & Destructor Documentation

## ◆ VoiceProcessor()

VoiceProcessor | ( |  | ) |
| inline

## ◆ ~VoiceProcessor()

virtual ~VoiceProcessor | ( |  | ) |
| inlinevirtual

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

## ◆ clearAllVoices()

virtual void clearAllVoices | ( |  | ) |
| inlinevirtual

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