IMEAccessor


IMEAccessor

Inheritance: FUnknown <- IMEAccessor
Include File:  imidieffect.h

You can query the context variable passed on by IPluginBase::initialize for a reference to this interface.

Event creation and output:

Event manipulation:

Context information:


IMEAccessor::createMidiEvent

IMEObjectID PLUGIN_API createMidiEvent (
		MidiStatus type,
		long data1,
		long data2,
		long length)

Creates a new MIDI event with the specified status and data bytes of length length (in PPQ).
In case of success, the return value is the handle of the new event. Otherwise the function returns NULL.

Remarks:

All events created inside the Plug-In have to be destroyed with IMEAccessor::destroyEvent!!!

You can determinte the selected MIDI channel for this effect with IMEAccessor::getMidiChannel. You have to bitwise-OR the status byte with the MIDI channel (see the following example) or call IMEAccessor::setChannel afterwards. If the Plug-In is used as a send effect and no channel is selected in the host application ("Any"), the Plug-In events are corrected automatically.

IMEAccessor* accessor; // a valid accessor reference

char status = (char)kNoteOn;
long channel = accessor->getMidiChannel ();
if(channel > 0)
	status |= (channel & 0xF);

IMEObjectID event = accessor->createMidiEvent ((MidiStatus)status, ... )


IMEAccessor::createSysexEvent

IMEObjectID PLUGIN_API createSysexEvent (unsigned char* data, long size)

Creates a new SysEx ("System Exclusive") event with the specified data and size.
In case of success, the return value is the handle of the new event. Otherwise the function returns NULL.

Remarks:

The event has to be destroyed with
IMEAccessor::destroyEvent!


IMEAccessor::duplicateMidiEvent

IMEObjectID PLUGIN_API duplicateMidiEvent (IMEObjectID event)

Creates a copy of the specified MIDI event. In case of success, the return value is the handle of the new event. Otherwise the function returns NULL.

Remarks:

The event has to be destroyed with
IMEAccessor::destroyEvent!


IMEAccessor::destroyEvent

tresult PLUGIN_API destroyEvent (IMEObjectID event)

Destroys the specified event.


IMEAccessor::passToOutputQueue

tresult PLUGIN_API passToOutputQueue (IMEObjectID event)

Passes the specified event to the host's output queue of the effect.


IMEAccessor::passToOutput

tresult PLUGIN_API passToOutput (IMEObjectID event)

Passes the specified event directly on to the output. This method is used for immediate events ("MIDI Thru").


Event start and length

tresult PLUGIN_API setStart  (IMEObjectID event, long ppq)
long    PLUGIN_API getStart  (IMEObjectID event)
tresult PLUGIN_API setLength (IMEObjectID event, long ppq)
long    PLUGIN_API getLength (IMEObjectID event)

The following methods are used to set or determine the start and length of a MIDI event (NoteOn) in PPQ.

IMEAccessor::setStart Sets the start position
IMEAccessor::getStart Returns the start position
IMEAccessor::setLength Sets the event length
IMEAccessor::getLength Returns the event length

Remarks:

The length may be undefined for some immediate events (NoteOff is pending), IMEAccessor::getLength returns -1 in this case!


Event immediate state

tresult PLUGIN_API setImmediateEvent (IMEObjectID event, bool state)
bool    PLUGIN_API isImmediateEvent  (IMEObjectID event)

The following methods are used to set or determine the immediate state of a MIDI event.

IMEAccessor::setImmediateEvent Sets the event state to immediate
IMEAccessor::isImmediateEvent Determines whether the specified event is an immediate event ("MIDI Thru").


Event channel

tresult PLUGIN_API setChannel (IMEObjectID event, int channel)
int     PLUGIN_API getChannel (IMEObjectID event)

The following methods are used to set or determine the channel of a MIDI event.

IMEAccessor::setChannel Sets the MIDI channel
IMEAccessor::getChannel Returns the MIDI channel


Event status and data

MidiStatus PLUGIN_API getStatus (IMEObjectID event)
tresult    PLUGIN_API setStatus (IMEObjectID event, MidiStatus status)
int        PLUGIN_API getData1  (IMEObjectID event)
tresult    PLUGIN_API setData1  (IMEObjectID event, int data)
int        PLUGIN_API getData2  (IMEObjectID event)
tresult    PLUGIN_API setData2  (IMEObjectID event, int data)
int        PLUGIN_API getData3  (IMEObjectID event)
tresult    PLUGIN_API setData3  (IMEObjectID event, int data)

The following methods are used to set or determine the status and data bytes of a MIDI event.

IMEAccessor::getStatus Returns the status byte
IMEAccessor::setStatus Sets the status byte
IMEAccessor::getData1 Returns the first data byte
IMEAccessor::setData1 Sets the first data byte
IMEAccessor::getData2 Returns the second data byte
IMEAccessor::setData2 Sets the second data byte
IMEAccessor::getData3 Returns the third data byte
IMEAccessor::setData3 Sets the third data byte

Remarks:

The third data byte is used for the NoteOff Velocity of a Note event. It is ignored otherwise.


Event micro tuning

int     PLUGIN_API getMicroTuning (IMEObjectID event)
tresult PLUGIN_API setMicroTuning (IMEObjectID event, int cent)

The following methods are used to set or determine the micro tuning of a MIDI event. The maximum range is +/- 100 cents.

IMEAccessor::getMicroTuning Returns the micro tuning (in cents)
IMEAccessor::setMicroTuning Sets the micro tuning (in cents)

Remarks:

The micro tuning only affects VST intstruments (if they support it - e.g. HALion).


IMEAccessor::getMidiChannel

long PLUGIN_API getMidiChannel ()

Returns the selected MIDI channel of the track.

Remarks:

The return value can be -1 to indicate that no MIDI channel is specified ("Any").


Processing Interval

long    PLUGIN_API getInterval ()
tresult PLUGIN_API setInterval (long interval)

The following methods are used to set or determine the interval in which the MIDI effect is processed (see IMidiEffect::playAction).

IMEAccessor::getInterval Returns the interval in milliseconds
IMEAccessor::setInterval Sets the interval (in ms)

Remarks:

IMEAccessor::setInterval works together with IMEAccessor::setCanPlayInStop, the processing interval can be set here. If IMEAccessor::setCanPlayInStop has not been called with state set to true, the call to IMEAccessor::setInterval has no effect.


IMEAccessor::getContextInfo

Fills a MidiContextInfo structure with metrical information for the specified PPQ position.
For a detailed description of the data structure click here.


IMEAccessor::setCanPlayInStop

tresult PLUGIN_API setCanPlayInStop (int state)

Informs the host that the Plug-In can play in Stop Mode. This call must be made during the initialization process of the Plug-In.


IMEAccessor2

Inheritance: FUnknown <- IMEAccessor <- IMEAccessor2
Include File:  imidieffect.h

You can query the context variable passed on in IPluginBase::initialize for a reference to this interface.

Methods:


IMEAccessor2::receiveMidiEvent

tresult PLUGIN_API receiveMidiEvent (IMEObjectID event)

Sends a MIDI event to the host application.

Remarks:

The events can be recorded in Cubase SX by selecting "MIDI Plug-Ins Port" as input of a MIDI channel.


IMEAccessor2::getSysexSize

int PLUGIN_API getSysexSize (IMEObjectID event)

Returns the data size of the SysEx event or zero, if the handle does not point to an event of this type.


IMEAccessor2::getSysexMessage

void* PLUGIN_API getSysexMessage (IMEObjectID event)

Gets a pointer to the data of a SysEx message. If the specified event handle is no SysEx event, the return value is NULL.

Remarks:

If you need to copy the SysEx data, you can determine the data size by calling
IMEAccessor2::getSysexSize.



Copyright ©2004 Steinberg Media Technologies GmbH. All Rights Reserved.
Last Modified: