JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Steinberg::Vst::IMidiMapping Class Referenceabstract

MIDI Mapping interface: Vst::IMidiMapping. More...

#include "ivsteditcontroller.h"

Inheritance diagram for Steinberg::Vst::IMidiMapping:
Steinberg::FUnknown

Public Member Functions

virtual tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID &id)=0
 Gets an (preferred) associated ParamID for a given Input Event Bus index, channel and MIDI Controller.
 
- Public Member Functions inherited from Steinberg::FUnknown
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void **obj)=0
 Query for a pointer to the specified interface.
 
virtual uint32 PLUGIN_API addRef ()=0
 Adds a reference and returns the new reference count.
 
virtual uint32 PLUGIN_API release ()=0
 Releases a reference and returns the new reference count.
 

Static Public Attributes

static const FUID iid
 
- Static Public Attributes inherited from Steinberg::FUnknown
static const FUID iid
 

Detailed Description

MIDI Mapping interface: Vst::IMidiMapping.

MIDI controllers are not transmitted directly to a VST component. MIDI as hardware protocol has restrictions that can be avoided in software. Controller data in particular come along with unclear and often ignored semantics. On top of this they can interfere with regular parameter automation and the host is unaware of what happens in the plug-in when passing MIDI controllers directly.

So any functionality that is to be controlled by MIDI controllers must be exported as regular parameter. The host will transform incoming MIDI controller data using this interface and transmit them as regular parameter change. This allows the host to automate them in the same way as other parameters. CtrlNumber can be a typical MIDI controller value extended to some others values like pitchbend or aftertouch (see ControllerNumbers). If the mapping has changed, the plug-in must call IComponentHandler::restartComponent (kMidiCCAssignmentChanged) to inform the host about this change.

Example

//--------------------------------------
// in myeditcontroller.h
class MyEditController: public EditControllerEx1, public IMidiMapping
{
//...
//---IMidiMapping---------------------------
tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID& id) SMTG_OVERRIDE;
//---Interface---------
OBJ_METHODS (MyEditController, EditControllerEx1)
END_DEFINE_INTERFACES (MyEditController)
REFCOUNT_METHODS (MyEditController)
};
//--------------------------------------
// in myeditcontroller.cpp
tresult PLUGIN_API MyEditController::getMidiControllerAssignment (int32 busIndex, int16 midiChannel, CtrlNumber midiControllerNumber, ParamID& tag)
{
// for my first Event bus and for MIDI channel 0 and for MIDI CC Volume only
if (busIndex == 0 && midiChannel == 0 && midiControllerNumber == kCtrlVolume)
{
tag = kGainId;
return kResultTrue;
}
return kResultFalse;
}
Advanced implementation (support IUnitInfo) for a VST 3 edit controller.
MIDI Mapping interface: Vst::IMidiMapping.
#define DEFINE_INTERFACES
Start defining interfaces.
Definition fobject.h:387
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition fobject.h:394
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition fobject.h:400
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition fobject.h:360
uint32 ParamID
parameter identifier
Definition vsttypes.h:81
int16 CtrlNumber
MIDI controller number (see ControllerNumbers for allowed values)
Definition vsttypes.h:83
@ kCtrlVolume
Channel Volume (formerly Main Volume)

Definition at line 557 of file ivsteditcontroller.h.

Member Function Documentation

◆ getMidiControllerAssignment()

virtual tresult PLUGIN_API Steinberg::Vst::IMidiMapping::getMidiControllerAssignment ( int32  busIndex,
int16  channel,
CtrlNumber  midiControllerNumber,
ParamID id 
)
pure virtual

Gets an (preferred) associated ParamID for a given Input Event Bus index, channel and MIDI Controller.

Parameters
[in]busIndex- index of Input Event Bus
[in]channel- channel of the bus
[in]midiControllerNumber- see ControllerNumbers for expected values (could be bigger than 127)
[in]id- return the associated ParamID to the given midiControllerNumber

Member Data Documentation

◆ iid

const FUID Steinberg::Vst::IMidiMapping::iid
static

Definition at line 570 of file ivsteditcontroller.h.


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