VST 3 Examples VST 3.7
SDK for developing VST plug-in
Loading...
Searching...
No Matches
VoiceProcessorImplementation< Precision, VoiceClass, numChannels, maxVoices, GlobalParameterStorage > Class Template Reference

A Simple Voice Processor Implementation supporting note expression events. More...

#include <voiceprocessor.h>

+ Inheritance diagram for VoiceProcessorImplementation< Precision, VoiceClass, numChannels, maxVoices, GlobalParameterStorage >:

Public Member Functions

 VoiceProcessorImplementation (float sampleRate, GlobalParameterStorage *globalParameters=0)
 
 ~VoiceProcessorImplementation () override
 
tresult process (ProcessData &data) override
 
void processEvent (Event evt) override
 
void clearAllVoices () override
 
- Public Member Functions inherited from VoiceProcessor
 VoiceProcessor ()
 
virtual ~VoiceProcessor ()
 
int32 getActiveVoices () const
 Returns the number of active voices.
 
void clearOutputNeeded (bool val)
 

Protected Member Functions

VoiceClass * getVoice (int32 noteId)
 
VoiceClass * findVoice (int32 noteId)
 

Protected Attributes

VoiceClass voices [maxVoices]
 
- Protected Attributes inherited from VoiceProcessor
int32 activeVoices {0}
 
bool mClearOutputNeeded {true}
 

Detailed Description

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
class Steinberg::Vst::VoiceProcessorImplementation< Precision, VoiceClass, numChannels, maxVoices, GlobalParameterStorage >

A Simple Voice Processor Implementation supporting note expression events.

Parameters
Precisionmust be either float or double
VoiceClassthe voice class
numChannelsnumber of channels
maxVoicesnumber of maximum voices
GlobalParameterStoragea class holding global parameters

The VoiceClass must implement the following methods:

int32 getNoteId () const;
void setGlobalParameterStorage (GlobalParameterStorage* globalParameters);
void setSampleRate (ParamValue sampleRate);
void setNoteExpressionValue (int32 index, ParamValue value);
void noteOn (int32 pitch, ParamValue velocity, float tuning, int32 sampleOffset, int32 noteId);
void noteOff (ParamValue velocity, int32 sampleOffset);
bool process (SamplePrecision* outputBuffers[numChannels], int32 numSamples);
void reset ()
tresult process(ProcessData &data) override
Definition voiceprocessor.h:368
int32_t int32

See VoiceBase for an example base class.

This implementation does not support advanced features like voice stealing when maxVoices is reached, etc ...

Constructor & Destructor Documentation

◆ VoiceProcessorImplementation()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
VoiceProcessorImplementation ( float sampleRate,
GlobalParameterStorage * globalParameters = 0 )

◆ ~VoiceProcessorImplementation()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
~VoiceProcessorImplementation ( )
override

Member Function Documentation

◆ process()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
tresult process ( ProcessData & data)
overridevirtual

Implements VoiceProcessor.

◆ processEvent()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
void processEvent ( Event evt)
overridevirtual

Implements VoiceProcessor.

◆ clearAllVoices()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
void clearAllVoices ( )
overridevirtual

Reimplemented from VoiceProcessor.

◆ getVoice()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
VoiceClass * getVoice ( int32 noteId)
protected

◆ findVoice()

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
VoiceClass * findVoice ( int32 noteId)
protected

Member Data Documentation

◆ voices

template<class Precision, class VoiceClass, int32 numChannels, int32 maxVoices, class GlobalParameterStorage>
VoiceClass voices[maxVoices]
protected
Empty

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