ASPiK SDK
Loading...
Searching...
No Matches
Steinberg::Vst::ASPiK::VST3Plugin Class Reference

The VST3Plugin object is the ASPiK plugin shell for the VST3 API. More...

#include <vst3plugin.h>

Inheritance diagram for Steinberg::Vst::ASPiK::VST3Plugin:

Public Member Functions

 VST3Plugin ()
 object constructor: because of class factory, do NOT use this for init; use initialize() instead
 
 ~VST3Plugin ()
 object destructor: because of class factory, do NOT use this for destruction; use terminate() instead
 
tresult PLUGIN_API initialize (FUnknown *context) override
 object initializer
 
tresult PLUGIN_API setBusArrangements (SpeakerArrangement *inputs, int32 numIns, SpeakerArrangement *outputs, int32 numOuts) override
 Client queries us for our supported Busses; this is where you can modify to support mono, surround, etc...
 
tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) override
 Client queries us for our supported sample lengths.
 
tresult PLUGIN_API setupProcessing (ProcessSetup &newSetup) override
 we get information about sample rate, bit-depth, etc...
 
tresult PLUGIN_API setActive (TBool state) override
 VST3 plugins may be turned on or off; you are supposed to dynamically delare stuff when activated then delete when de-activated.
 
tresult PLUGIN_API setState (IBStream *fileStream) override
 This is the READ part of the serialization process. We get the stream interface and use it to read from the filestream.
 
tresult PLUGIN_API getState (IBStream *fileStream) override
 This is the WRITE part of the serialization process. We get the stream interface and use it to write to the filestream. This is important because it is how the Factory Default is set at startup, as well as when writing presets.
 
bool doControlUpdate (ProcessData &data)
 Find and issue Control Changes.
 
tresult PLUGIN_API process (ProcessData &data) override
 the VST3 audio processing function
 
virtual tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID &id) override
 The client queries this 129 times for 130 possible control messages, see ivstsmidicontrollers.h for the VST defines for kPitchBend, kCtrlModWheel, etc... for each MIDI Channel in our Event Bus.
 
bool issueMIDICCProxyMessage (ParamID proxyParamID, ParamValue proxyParamValue)
 Find and issue Control Changes.
 
void unipolarDoubleToMIDI14_bit (double unipolarValue, uint32_t &midiDataLSB, uint32_t &midiDataMSB)
 
IPlugView *PLUGIN_API createView (const char *_name) override
 creates the custom GUI view
 
tresult PLUGIN_API terminate () override
 object destroyer
 
virtual tresult receiveText (const char8 *text) override
 VST3 messaging system - not used in ASPiK but here if you want to play with messaging.
 
tresult PLUGIN_API setParamNormalizedFromFile (ParamID tag, ParamValue value)
 helper function for setComponentState()
 
tresult PLUGIN_API setComponentState (IBStream *fileStream) override
 This is the serialization-read function so the GUI can be updated from a preset or startup.
 
void updateMeters (ProcessData &data, bool forceOff=false)
 update the outbound VST3 parameters that correspond to plugin meter variables
 
tresult PLUGIN_API setParamNormalized (ParamID tag, ParamValue value) override
 This is overridden for selecting a preset, this is also called when automating parameters.
 
virtual tresult PLUGIN_API getProgramName (ProgramListID listId, int32 programIndex, String128 name) override
 Get preset name.
 
virtual void PLUGIN_API update (FUnknown *changedUnknown, int32 message) override
 Toggle preset.
 
virtual uint32 PLUGIN_API getLatencySamples () override
 
virtual uint32 PLUGIN_API getTailSamples () override
 Returns the tail-time in samples.
 
void updateHostInfo (ProcessData &data, HostInfo *hostInfo)
 update the incoming host data for the plugin core
 

Static Public Member Functions

static FUnknown * createInstance (void *context)
 
static FUID * getFUID ()
 static function for VST3 clsss factory
 
static const char * getPluginName ()
 static function for VST3 clsss factory
 
static const char * getVendorName ()
 static function for VST3 clsss factory
 
static const char * getVendorURL ()
 static function for VST3 clsss factory
 
static const char * getVendorEmail ()
 static function for VST3 clsss factory
 
static CString getPluginType ()
 static function for VST3 clsss factory
 

Public Attributes

uint32 m_uLatencyInSamples = 0
 set in constructor with plugin
 

Protected Types

typedef std::vector< IPtr< ProgramList > > ProgramListVector
 
typedef std::map< ProgramListID, ProgramListVector::size_type > ProgramIndexMap
 
typedef std::vector< IPtr< Unit > > UnitVector
 

Protected Attributes

VSTParamUpdateQueue ** m_pParamUpdateQueueArray = nullptr
 sample accurate parameter automation
 
unsigned int sampleAccuracy = 1
 sample accurate parameter automation
 
bool enableSAAVST3 = false
 sample accurate parameter automation
 
UnitVector units
 
ProgramListVector programLists
 
ProgramIndexMap programIndexMap
 
UnitID selectedUnit
 

Detailed Description

The VST3Plugin object is the ASPiK plugin shell for the VST3 API.

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Constructor & Destructor Documentation

◆ VST3Plugin()

Steinberg::Vst::ASPiK::VST3Plugin::VST3Plugin ( )

object constructor: because of class factory, do NOT use this for init; use initialize() instead

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ ~VST3Plugin()

Steinberg::Vst::ASPiK::VST3Plugin::~VST3Plugin ( )

object destructor: because of class factory, do NOT use this for destruction; use terminate() instead

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

Member Function Documentation

◆ canProcessSampleSize()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::canProcessSampleSize ( int32  symbolicSampleSize)
override

Client queries us for our supported sample lengths.

Define our word-length capabilities (currently 32 bit only)

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ createInstance()

static FUnknown * Steinberg::Vst::ASPiK::VST3Plugin::createInstance ( void *  context)
inlinestatic

our COM creation method

◆ createView()

IPlugView *PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::createView ( const char *  _name)
override

creates the custom GUI view

IPlugView: create our custom GUI

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ doControlUpdate()

bool Steinberg::Vst::ASPiK::VST3Plugin::doControlUpdate ( ProcessData &  data)

Find and issue Control Changes.

functions to reduce size of process()

Returns
true if a control was changed

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getFUID()

FUID * Steinberg::Vst::ASPiK::VST3Plugin::getFUID ( )
static

static function for VST3 clsss factory

IUnitInfo handler.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getLatencySamples()

virtual uint32 PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::getLatencySamples ( )
inlineoverridevirtual

base class override

◆ getMidiControllerAssignment()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::getMidiControllerAssignment ( int32  busIndex,
int16  channel,
CtrlNumber  midiControllerNumber,
ParamID &  id 
)
overridevirtual

The client queries this 129 times for 130 possible control messages, see ivstsmidicontrollers.h for the VST defines for kPitchBend, kCtrlModWheel, etc... for each MIDI Channel in our Event Bus.

IMidiMapping

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getPluginName()

const char * Steinberg::Vst::ASPiK::VST3Plugin::getPluginName ( )
static

static function for VST3 clsss factory

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getPluginType()

CString Steinberg::Vst::ASPiK::VST3Plugin::getPluginType ( )
static

static function for VST3 clsss factory

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getProgramName()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::getProgramName ( ProgramListID  listId,
int32  programIndex,
String128  name 
)
overridevirtual

Get preset name.

IUnitInfo

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getState()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::getState ( IBStream *  fileStream)
override

This is the WRITE part of the serialization process. We get the stream interface and use it to write to the filestream. This is important because it is how the Factory Default is set at startup, as well as when writing presets.

NOTES:

  • The datatypes/read order must EXACTLY match the getState() version or crashes may happen or variables not initialized properly.
  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getTailSamples()

uint32 PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::getTailSamples ( )
overridevirtual

Returns the tail-time in samples.

base class override for tailtime

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getVendorEmail()

const char * Steinberg::Vst::ASPiK::VST3Plugin::getVendorEmail ( )
static

static function for VST3 clsss factory

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getVendorName()

const char * Steinberg::Vst::ASPiK::VST3Plugin::getVendorName ( )
static

static function for VST3 clsss factory

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getVendorURL()

const char * Steinberg::Vst::ASPiK::VST3Plugin::getVendorURL ( )
static

static function for VST3 clsss factory

static function for class facgtory access to plugin core's corresponding static function

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ initialize()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::initialize ( FUnknown *  context)
override

object initializer

One time init to define our I/O and vsteditcontroller parameters

NOTES:

  • Call the base class
  • Add a Stereo Audio Output
  • Add a MIDI event inputs (16: one for each channel)
  • Add GUI parameters (EditController part)
  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ issueMIDICCProxyMessage()

bool Steinberg::Vst::ASPiK::VST3Plugin::issueMIDICCProxyMessage ( ParamID  proxyParamID,
ParamValue  proxyParamValue 
)

Find and issue Control Changes.

Returns
true if a control was changed

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ process()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::process ( ProcessData &  data)
override

the VST3 audio processing function

The all important process method where the audio is rendered/effected

Parameters
dataprocess information from the host

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ receiveText()

tresult Steinberg::Vst::ASPiK::VST3Plugin::receiveText ( const char8 *  text)
overridevirtual

VST3 messaging system - not used in ASPiK but here if you want to play with messaging.

for GUI_TIMER_PING and recreate view operations

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setActive()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setActive ( TBool  state)
override

VST3 plugins may be turned on or off; you are supposed to dynamically delare stuff when activated then delete when de-activated.

Turn on/off

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setBusArrangements()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setBusArrangements ( SpeakerArrangement *  inputs,
int32  numIns,
SpeakerArrangement *  outputs,
int32  numOuts 
)
override

Client queries us for our supported Busses; this is where you can modify to support mono, surround, etc...

Define the audio I/O we support

NOTES:

  • The host will query upwards until it finds the target, for example if the audio file is 5.1, the host queries mono, stereo, LCR, LCR + LFE, BFormat, etc . . . then 5.1, giving us the chance to process as many inputs as possible. If we support 5.1, it will stop there (target). Note that some DAWs might reject the target if the audio adapter does not support it.
  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters
    Parameters
    numIns= number of input busses
    numOuts= number of output busses
    inputs[x]--> requested input channel format for that bus
    outputs[x]--> requested output channel format for that bus

◆ setComponentState()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setComponentState ( IBStream *  fileStream)
override

This is the serialization-read function so the GUI can be updated from a preset or startup.

serialize-read from file to setup the GUI parameters

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setParamNormalized()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setParamNormalized ( ParamID  tag,
ParamValue  value 
)
override

This is overridden for selecting a preset, this is also called when automating parameters.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setParamNormalizedFromFile()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setParamNormalizedFromFile ( ParamID  tag,
ParamValue  value 
)

helper function for setComponentState()

helper function for serialization

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setState()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setState ( IBStream *  fileStream)
override

This is the READ part of the serialization process. We get the stream interface and use it to read from the filestream.

Serialization: Save and load presets from a file stream

NOTES:

  • The datatypes/read order must EXACTLY match the getState() version or crashes may happen or variables not initialized properly.
  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setupProcessing()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::setupProcessing ( ProcessSetup &  newSetup)
override

we get information about sample rate, bit-depth, etc...

you can access info about the processing via ProcessSetup; see ivstaudioprocessor.h

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ terminate()

tresult PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::terminate ( )
override

object destroyer

the end. this destroys the core

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ update()

void PLUGIN_API Steinberg::Vst::ASPiK::VST3Plugin::update ( FUnknown *  changedUnknown,
int32  message 
)
overridevirtual

Toggle preset.

from IDependent---------------—

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ updateHostInfo()

void Steinberg::Vst::ASPiK::VST3Plugin::updateHostInfo ( ProcessData &  data,
HostInfo hostInfo 
)

update the incoming host data for the plugin core

update host info for this process loop

Parameters
dataprocess information from the host
hostInfoHostInfo struct to fill out as the return

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide

◆ updateMeters()

void Steinberg::Vst::ASPiK::VST3Plugin::updateMeters ( ProcessData &  data,
bool  forceOff = false 
)

update the outbound VST3 parameters that correspond to plugin meter variables

for meters

Parameters
dataprocess information from the host
forceOffturn off meters regawrdless of audio input values

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide

The documentation for this class was generated from the following files: