VST2.4 specs 
HOME   |   Software       VST2.4 specs :: FIRST   -   PREV   -   NEXT

dispatch() functions


C++: VstIntPtr function dispatcher(AEffect* e, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
Delphi: function dispatcher(e: PAEffect; opcode, index: VstInt32; value: VstIntPtr; ptr: pointer; opt: Single): VstIntPtr; cdecl;
always returns 0, unless otherwise defined.
all string-pointers points to zero terminated strings.
e[ ]: = plugin receives as entry parameter
x[ ]: = plugin returns to host

The host calls the plugin's dispatcher() function with opcodes 00 thru 79::
00. effOpen   >= VST1.0   @see AudioEffect::open()
initialise this plugin instance

01. effClose   >= VST1.0   @see AudioEffect::close()
exit this plugin instance, release all memory and other resources

02. effSetProgram   >= VST1.0   @see AudioEffect::setProgram()
host has changed the current program number
host must call this inside a plugBeginSetProgram ... plugEndSetProgram sequence
e[value]: program number

03. effGetProgram   >= VST1.0   @see AudioEffect::getProgram()
host requests the current program number
x[return]: current program number

04. effSetProgramName   >= VST1.0   @see AudioEffect::setProgramName()
host has changed the current program name
e[ptr]: pointer to new program name (max 24 char + 0)

05. effGetProgramName   >= VST1.0   @see AudioEffect::getProgramName()
host requests the current program name
x[ptr]: returns string-pointer to program name (max 24 char + 0)

06. effGetParamLabel   >= VST1.0   @see AudioEffect::getParameterLabel()
host requests parameter label
e[index]: parameter index
x[ptr]: returns string-pointer to parameter label (max 8 char + 0), examples: sec, dB, type

07. effGetParamDisplay   >= VST1.0   @see AudioEffect::getParameterDisplay()
host requests parameter textual representation
e[index]: parameter index
x[ptr]: returns string-pointer to parameter textual representation (max 8 char + 0), examples: examples: 0.5, -3, PLATE

08. effGetParamName   >= VST1.0   @see AudioEffect::getParameterName()
host requests parameter name
e[index]: parameter index
x[ptr]: returns string-pointer to parameter name (max 31 char + 0)

09. effGetVu   >= VST1.0 ... deprecated in VST2.4   @see AudioEffect::getVu()
called if ( flags and (effFlagsHasClip or effFlagsHasVu) )
x[return]: 'VU' value; > 1.0 means clipped

10. effSetSampleRate   >= VST1.0   @see AudioEffect::setSampleRate()
host sets SampleRate
e[opt]: float value in Hz, for example 44100.0Hz

11. effSetBlockSize   >= VST1.0   @see AudioEffect::setBlockSize()
host sets BlockSize
e[value]: maximum number of sampleframes an audio block may contain

12. effMainsChanged   >= VST1.0   @see AudioEffect::suspend(), AudioEffect::resume()
the host has switched the 'power on' button. This only switches audio processing on/off.
e[value]:
  0 = OFF, the plugin must call Resume() which in turn must flush any delay buffers etc. here because otherwise pending data would sound again when the effect is switched on next time.
  1 = ON, the plug must call Suspend()

13. effEditGetRect   >= VST1.0   (editor)   @see AEffEditor::getRect()
x[ptr]: pointer to rect*(top, left, bottom, right)
x[return]: 1 = successful

14. effEditOpen   >= VST1.0   (editor)   @see AEffEditor::open()
e[ptr]: contains system dependant Window handle/pointer
x[return]: 1 = successful

15. effEditClose   >= VST1.0   (editor)   @see AEffEditor::close()
no arguments

16. effEditDraw   >= VST1.0 ... deprecated in VST2.4   (editor) (MAC only)   @see AEffEditor::draw()
draw method
e[ptr]: points to rect

17. effEditMouse   >= VST1.0 ... deprecated in VST2.4   (editor) (MAC only)   @see AEffEditor::mouse()
e[index]: x,
e[value]: y

18. effEditKey   >= VST1.0 ... deprecated in VST2.4   (editor) (MAC only)   @see AEffEditor::key()
e[value]: system keycode

19. effEditIdle   >= VST1.0   (editor)   @see AEffEditor::idle()
no arguments. Be gentle! ( it would be better if this call could be avoided )

20. effEditTop   >= VST1.0 ... deprecated in VST2.4   (editor)   @see AEffEditor::top()
window has topped, no arguments

21. effEditSleep   >= VST1.0 ... deprecated in VST2.4   (editor)   @see AEffEditor::sleep()
window goes to background

22. effIdentify   >= VST1.0 ... deprecated in VST2.4  
x[return]: 'NvEf' as a 32-bit integer

23. effGetChunk   >= VST1.0   @see AudioEffect::getChunk()
host requests pointer to a Bank/Program chunk, plugin is responsible for memory allocation/de-allocation of chunk
e[index]: 0 = isBank, 1 = isProgram
x[ptr]: pointer to chunk memory-block
x[return]: byteSize

24. effSetChunk   >= VST1.0   @see AudioEffect::setChunk()
plug-in receives a Bank/Program chunk, host is responsible for memory allocation/de-allocation of chunk
e[index]: 0 = isBank, 1 = isProgram
e[value]: byteSize
e[ptr]: pointer to chunk memory-block

25. effProcessEvents   >= VST2.0   @see AudioEffectX::processEvents()
e[ptr]: pointer to VstEvents*, host usually call ProcessEvents just before calling ProcessReplacing
x[return]: 0 = 'wants no more??' ... else return=1

// parameters and programs
26. effCanBeAutomated   >= VST2.0   @see AudioEffectX::canParameterBeAutomated()
hosts asks if parameter can be automated, this should be called each time before attempting to call SetParameter()
e[index]: parameter index
x[return]: 1 = parameter can be automated

27. effString2Parameter   >= VST2.0   @see AudioEffectX::string2parameter()
host must call this two-fold:
1)host checks the capability of plugin if it can convert a string into a parameter float value
e[index]: parameter index
e[ptr]: NULL
x[return]: 1 = plug CAN convert string2Parameter, 0 = plug CANNOT convert string2Parameter
2)host requests plug to set a parameter from the parameter textual representation into a parameter float value (range 0.0 to 1.0), if this conversion is successful then internally the plugin must call setParameter as part of this call
e[index]: parameter index
e[ptr]: string-pointer to textual representation of parameter
x[return]: 1 = conversion successful, 0 = fail

28. effGetNumProgramCategories   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::getNumCategories()
no arguments, this is for dividing programs into groups (like GM)
x[return]: 1 when there is no real program categories

29. effGetProgramNameIndexed   >= VST2.0   @see AudioEffectX::getProgramNameIndexed()
host requests program name
e[index]: program index
e[value]: deprecated in VST2.4
x[ptr]: returns string-pointer to program name (max 24 char + 0)
x[return]: 1 = OK, 0 = fail

30. effCopyProgram   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::copyProgram()
e[index]: destination program number to copy current program to, note: implies setParameter connections, configuration
x[return]: 1 = successful

31. effConnectInput   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::inputConnected()
e[index]: input pin number that has been (dis-)connected
e[value]: 0 = disconnected, else connected
x[return]: 1 = successful

32. effConnectOutput   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::outputConnected()
e[index]: output pin number that has been (dis-)connected
e[value]: 0 = disconnected, else connected
x[return]: 1 = successful

33. effGetInputProperties   >= VST2.0   @see AudioEffectX::getInputProperties()
host requests plugin's input pin properties
e[index]: input pin number
x[ptr]: pointer to VstPinProperties*, memory is already allocated by host
x[return]: 1 = successful

34. effGetOutputProperties   >= VST2.0   @see AudioEffectX::getOutputProperties()
host requests plugin's output pin properties
e[index]: output pin number
x[ptr]: pointer to VstPinProperties*, memory is already allocated by host
x[return]: 1 = successful

35. effGetPlugCategory   >= VST2.0   @see AudioEffectX::getPlugCategory()
host requests plugin category
x[return]: category number: 0=Unknown, 1=Effect, 2=Synth, 3=Analysis, 4=Mastering, 5=Spacializer(panners),
6=RoomFx(delays and reverbs), 7=SurroundFx(dedicated surround processors),
8=Restoration, 9=OfflineProcess, 10=Shell(is only a container of plugins), 11=Generator

36. effGetCurrentPosition (realtime)   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::reportCurrentPosition()
for external dsp, see AEffect.flag bits below

37. effGetDestinationBuffer (realtime)   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::reportDestinationBuffer()
for external dsp, see AEffect.flag bits, returns float* in <ptr>

38. effOfflineNotify (offline)   >= VST2.0   @see AudioEffectX::offlineNotify()
e[index]: start flag
e[value]: count
e[ptr]: pointer to VstAudioFile array
x[return]: 1 = successful

39. effOfflinePrepare (offline)   >= VST2.0   @see AudioEffectX::offlinePrepare()
e[value]: count
e[ptr]: pointer to VstOfflineTask array
x[return]: 1 = successful

40. effOfflineRun (offline)   >= VST2.0   @see AudioEffectX::offlineRun()
e[value]: count
e[ptr]: pointer to VstOfflineTask array
x[return]: 1 = successful

41. effProcessVarIo (offline)   >= VST2.0   @see AudioEffectX::processVariableIo()
e[ptr]: pointer to VariableIO*
x[return]: 1 = successful

42. effSetSpeakerArrangement   >= VST2.0   @see AudioEffectX::setSpeakerArrangement()
e[value]: pointer to VstSpeakerArrangement* pluginInput
e[ptr]: pointer to VstSpeakerArrangement* pluginOutput
x[return]: 1 = successful

43. effSetBlockSizeAndSampleRate   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::setBlockSizeAndSampleRate()
host set BlockSize and SampleRate, host MUST call this inside a Suspend() ... Resume() sequence
e[value]: block size
e[opt]: sampleRate
x[return]: 1 = successful

44. effSetBypass   >= VST2.0   @see AudioEffectX::setBypass()
the host has switched the 'softBypass' state
e[value]: onOff (0 = off, 1 = On)
x[return]: 1 = successful

45. effGetEffectName   >= VST2.0   @see AudioEffectX::getEffectName()
x[ptr]: returns string-pointer to a string with effect name (max 32 bytes)
x[return]: 1 = successful

46. effGetErrorText   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::getErrorText()
x[ptr]: returns string-pointer to a string with error text (max 256 bytes)
x[return]: 1 = successful

47. effGetVendorString   >= VST2.0   @see AudioEffectX::getVendorString()
x[ptr]: returns string-pointer to a string identifying the vendor (max 64 char)
x[return]: 1 = successful

48. effGetProductString   >= VST2.0   @see AudioEffectX::getProductString()
x[ptr]: returns string-pointer to a string with product name (max 64 char)
x[return]: 1 = successful

49. effGetVendorVersion   >= VST2.0   @see AudioEffectX::getVendorVersion()
x[return]: vendor-specific version

50. effVendorSpecific   >= VST2.0   @see AudioEffectX::vendorSpecific()
no definition, vendor specific handling
The MouseWheel handling is a bit of an after thought, and has been implemented by Stenberg via the effVendorSpecific call as follows:
e[index]: 'stCA' / $73744341
e[value]: 'Whee' / $57686565
e[ptr]: 1.0 = wheel-up, -1.0 = wheel-down
x[return]: 1 = MouseWheel used

51. effCanDo   >= VST2.0   @see AudioEffectX::canDo()
host queries a plugin 'cando' capability
e[ptr]: string-pointer to cando string
x[return]: 1='cando', 0='don't know' (default), -1='No'

52. effGetTailSize   >= VST2.0   @see AudioEffectX::getTailSize()
returns tail size; 0 is default (return 1 for 'no tail')

53. effIdle   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::idle()
host sends this idle call in response to plugin's 'audioMasterneedIdle' request
x[return]: 1 must be returned to keep idle calls being issued by host

54. effGetIcon   >= VST2.0 ... deprecated in VST2.4   (editor)   @see AudioEffectX::getIcon()
void* in <ptr>, not defined

55. effSetViewPosition   >= VST2.0 ... deprecated in VST2.4   (editor)   @see AudioEffectX::setViewPosition()
set view position (in window) to x <index> y <value>

56. effGetParameterProperties   >= VST2.0   @see AudioEffectX::getParameterProperties()
of parameter <index>, VstParameterProperties* in <ptr>
return=1 when successful

57. effKeysRequired   >= VST2.0 ... deprecated in VST2.4   @see AudioEffectX::keysRequired()
returns 0: needs keys (default for 1.0 plugs), 1: don't need

58. effGetVstVersion   >= VST2.0   @see AudioEffectX::getVstVersion()
returns 2; older versions return 0

59. effEditKeyDown   >= VST2.1   (editor)   @see AEffEditor::onKeyDown()
e[index]: character
e[value]: virtual key-code
e[opt]: key-modifiers
x[return]: 0 = KeyDown not used, 1 = KeyDown used

60. effEditKeyUp   >= VST2.1   (editor)   @see AEffEditor::onKeyUp()
e[index]: character
e[value]: virtual key-code
e[opt]: key-modifiers
x[return]: 0 = not KeyUp used, 1 = KeyUp used

61. effSetEditKnobMode   >= VST2.1   (editor)   @see AEffEditor::setKnobMode()
e[value]: knobmode 0=circular, 1=circular relativ, 2=linear
x[return]: 1 = successful

62. effGetMidiProgramName   >= VST2.1   @see AudioEffectX::getMidiProgramName()
e[ptr]: passed points to MidiProgramName struct.
x[ptr]: struct will be filled with information for 'thisProgramIndex'.
x[return]: number of used programIndexes. if 0 is returned, no MidiProgramNames supported.

63. effGetCurrentMidiProgram   >= VST2.1   @see AudioEffectX::getCurrentMidiProgram()
e[ptr]: passed points to MidiProgramName struct.
x[ptr]: struct will be filled with information for the current program.
x[return]: the programIndex of the current program.

64. effGetMidiProgramCategory   >= VST2.1   @see AudioEffectX::getMidiProgramCategory()
e[ptr]: passed points to MidiProgramCategory struct.
x[ptr]: struct will be filled with information for 'thisCategoryIndex'.
x[return]: number of used categoryIndexes. if 0 is returned, no MidiProgramCategories supported.

65. effHasMidiProgramsChanged   >= VST2.1   @see AudioEffectX::hasMidiProgramsChanged()
x[return]: 1 if the MidiProgramNames or MidiKeyNames had changed on this channel, 0 otherwise. <ptr> ignored.

66. effGetMidiKeyName   >= VST2.1   @see AudioEffectX::getMidiKeyName()
e[ptr]: passed points to MidiKeyName struct.
x[ptr]: struct will be filled with information for 'thisProgramIndex' and 'thisKeyNumber'.

67. effBeginSetProgram   >= VST2.1   @see AudioEffectX::beginSetProgram()
host calls this before a new program (effSetProgram) is loaded

68. effEndSetProgram   >= VST2.1   @see AudioEffectX::endSetProgram()
host calls this after the new program (effSetProgram) has been loaded

69. effGetSpeakerArrangement   >= VST2.3   @see AudioEffectX::getSpeakerArrangement()
e[value]: pointer to VstSpeakerArrangement** pluginInput
e[ptr]: pointer to VstSpeakerArrangement** pluginOutput

70. effShellGetNextPlugin   >= VST2.3   @see AudioEffectX::shellGetNextPlugin()
This opcode is only called, if plugin is of type kPlugCategShell. <ptr> points to a char buffer of size 64, which is to be filled with the name of the plugin including the terminating zero.
x[return]: the next plugin's uniqueID.

71. effStartProcess   >= VST2.3   @see AudioEffectX::startProcess()
host calls this before the start of process call and after e.g. resume()

72. effStopProcess   >= VST2.3   @see AudioEffectX::stopProcess()
host calls this after the stop of process call and before e.g. suspend()

73. effSetTotalSampleToProcess (offline)   >= VST2.3   @see AudioEffectX::setTotalSampleToProcess()
Called in offline (non RealTime) Process before process is called, indicates how many sample will be processed

74. effSetPanLaw   >= VST2.3   @see AudioEffectX::setPanLaw()
PanLaw : Type (Linear, Equal Power,.. see enum PanLaw Type) in <value>, Gain in <opt>: for Linear : [1.0 => 0dB PanLaw], [~0.58 => -4.5dB], [0.5 => -6.02dB]

75. effBeginLoadBank   >= VST2.3   @see AudioEffectX::beginLoadBank()
Called before a Bank is loaded, <ptr> points to VstPatchChunkInfo structure
x[return]: -1 if the Bank cannot be loaded, 1 if it can be loaded, 0 (for compatibility)

76. effBeginLoadProgram   >= VST2.3   @see AudioEffectX::beginLoadProgram()
Called before a Program is loaded, <ptr> points to VstPatchChunkInfo structure
x[return]: -1 if the Program cannot be loaded, 1 if it can be loaded, 0 (for compatibility)

77. effSetProcessPrecision   >= VST2.4   @see AudioEffectX::setProcessPrecision()
e[value]: @see VstProcessPrecision

78. effGetNumMidiInputChannels   >= VST2.4   @see AudioEffectX::getNumMidiInputChannels()
x[return]: number of used MIDI input channels (1-15)

79. effGetNumMidiOutputChannels   >= VST2.4   @see AudioEffectX::getNumMidiOutputChannels()
x[return]: number of used MIDI output channels (1-15)

FIRST   -   PREV   -   NEXT   -   TOP