MidiPlayerTK.MidiKeyboard

[MPTK PRO] - BAse class to send and receive Midi Message from a Midi keyboard connected to the device
More information here https://paxstellar.fr/class-midikeyboard/ More...

Public Types

enum class  PluginError
 General error return values More...
 

Public Member Functions

static int MPTK_ClearReadQueue ()
 Empty the read queue More...
 
static void MPTK_CloseAllInp ()
 Close all input device for receiving Midi message More...
 
static void MPTK_CloseOut (int index)
 Close device for output More...
 
static int MPTK_CountInp ()
 Count of output device detected More...
 
static int MPTK_CountOut ()
 Count of input device detected More...
 
static void MPTK_OpenAllInp ()
 Open or refresh all input device for receiving Midi message More...
 
static void MPTK_OpenOut (int index)
 Open device for output More...
 
static int MPTK_SizeReadQueue ()
 Count of midi message waiting in the read queue More...
 

Static Public Member Functions

static void MPTK_ExcludeSystemMessage (bool exclude)
 Exclude system message More...
 
static string MPTK_GetInpName (int index)
 Name of the device More...
 
static string MPTK_GetOutName (int index)
 Name of the device More...
 
static bool MPTK_Init ()
 Plugins Init. Mandatory before executing any other functions of the plugins More...
 
static void MPTK_PlayEvent (MPTKEvent evnt, int device)
 Play one midi event on the device with a thread so the call return immediately. More...
 
static MPTKEvent MPTK_Read ()
 Read a Midi message from all devices input connected More...
 
static void MPTK_SetRealTimeRead ()
 Enable read midi event from a callback. The event OnActionInputMidi is triggred when a Midi event is available. More...
 
static void MPTK_UnsetRealTimeRead ()
 Disable read midi event from a callback. Mandatory before exiting the application, moreover with inside Unity editor to avoid crash. More...
 
static string MPTK_Version ()
 Get current version of the plugins More...
 

Properties

static PluginError MPTK_LastStatus [get]
 Last status, value reset to OK after the call More...
 

Events

static Action< MPTKEventOnActionInputMidi
 Event triggered when a Midi event is available. More...
 

Detailed Description

[MPTK PRO] - BAse class to send and receive Midi Message from a Midi keyboard connected to the device
More information here https://paxstellar.fr/class-midikeyboard/

Member Enumeration Documentation

◆ PluginError

General error return values

Member Function Documentation

◆ MPTK_ClearReadQueue()

static int MidiPlayerTK.MidiKeyboard.MPTK_ClearReadQueue ( )

Empty the read queue

Returns

◆ MPTK_CloseAllInp()

static void MidiPlayerTK.MidiKeyboard.MPTK_CloseAllInp ( )

Close all input device for receiving Midi message

◆ MPTK_CloseOut()

static void MidiPlayerTK.MidiKeyboard.MPTK_CloseOut ( int  index)

Close device for output

Parameters
index

◆ MPTK_CountInp()

static int MidiPlayerTK.MidiKeyboard.MPTK_CountInp ( )

Count of output device detected

Returns

◆ MPTK_CountOut()

static int MidiPlayerTK.MidiKeyboard.MPTK_CountOut ( )

Count of input device detected

Returns

◆ MPTK_ExcludeSystemMessage()

static void MidiPlayerTK.MidiKeyboard.MPTK_ExcludeSystemMessage ( bool  exclude)
static

Exclude system message

Parameters
excludeIf true exclude all messages with status/command >= 0xF0. Default: true

◆ MPTK_GetInpName()

static string MidiPlayerTK.MidiKeyboard.MPTK_GetInpName ( int  index)
static

Name of the device

Parameters
indexId of the device
Returns

◆ MPTK_GetOutName()

static string MidiPlayerTK.MidiKeyboard.MPTK_GetOutName ( int  index)
static

Name of the device

Parameters
indexId of the device
Returns

◆ MPTK_Init()

static bool MidiPlayerTK.MidiKeyboard.MPTK_Init ( )
static

Plugins Init. Mandatory before executing any other functions of the plugins

◆ MPTK_OpenAllInp()

static void MidiPlayerTK.MidiKeyboard.MPTK_OpenAllInp ( )

Open or refresh all input device for receiving Midi message

◆ MPTK_OpenOut()

static void MidiPlayerTK.MidiKeyboard.MPTK_OpenOut ( int  index)

Open device for output

Parameters
index

◆ MPTK_PlayEvent()

static void MidiPlayerTK.MidiKeyboard.MPTK_PlayEvent ( MPTKEvent  evnt,
int  device 
)
static

Play one midi event on the device with a thread so the call return immediately.

Parameters
evntMidi event
deviceindex of the device

◆ MPTK_Read()

static MPTKEvent MidiPlayerTK.MidiKeyboard.MPTK_Read ( )
static

Read a Midi message from all devices input connected

Returns

◆ MPTK_SetRealTimeRead()

static void MidiPlayerTK.MidiKeyboard.MPTK_SetRealTimeRead ( )
static

Enable read midi event from a callback. The event OnActionInputMidi is triggred when a Midi event is available.

if (enableRealTimeRead)
{
MidiKeyboard.OnActionInputMidi += ProcessEvent;
MidiKeyboard.MPTK_SetRealTimeRead();
}
else
{
MidiKeyboard.OnActionInputMidi -= ProcessEvent;
MidiKeyboard.MPTK_UnsetRealTimeRead();
}

◆ MPTK_SizeReadQueue()

static int MidiPlayerTK.MidiKeyboard.MPTK_SizeReadQueue ( )

Count of midi message waiting in the read queue

Returns

◆ MPTK_UnsetRealTimeRead()

static void MidiPlayerTK.MidiKeyboard.MPTK_UnsetRealTimeRead ( )
static

Disable read midi event from a callback. Mandatory before exiting the application, moreover with inside Unity editor to avoid crash.

◆ MPTK_Version()

static string MidiPlayerTK.MidiKeyboard.MPTK_Version ( )
static

Get current version of the plugins

Returns

Property Documentation

◆ MPTK_LastStatus

PluginError MidiPlayerTK.MidiKeyboard.MPTK_LastStatus
staticget

Last status, value reset to OK after the call

Event Documentation

◆ OnActionInputMidi

Action<MPTKEvent> MidiPlayerTK.MidiKeyboard.OnActionInputMidi
static

Event triggered when a Midi event is available.

if (enableRealTimeRead)
{
MidiKeyboard.OnActionInputMidi += ProcessEvent;
MidiKeyboard.MPTK_SetRealTimeRead();
}
else
{
MidiKeyboard.OnActionInputMidi -= ProcessEvent;
MidiKeyboard.MPTK_UnsetRealTimeRead();
}