MidiPlayerTK.MidiKeyboard

[MPTK PRO] Base class to send and receive Midi Message from a Midi keyboard connected to the desktop
More...

Public Types

enum  PluginError
 

Public Member Functions

static int MPTK_ClearReadQueue ()
 
static void MPTK_CloseAllInp ()
 
static void MPTK_CloseOut (int index)
 
static int MPTK_CountInp ()
 
static int MPTK_CountOut ()
 
static void MPTK_OpenAllInp ()
 
static void MPTK_OpenOut (int index)
 
static int MPTK_SizeReadQueue ()
 

Static Public Member Functions

static void MPTK_ExcludeSystemMessage (bool exclude)
 
static string MPTK_GetInpName (int index)
 
static string MPTK_GetOutName (int index)
 
static bool MPTK_Init ()
 
static void MPTK_PlayEvent (MPTKEvent evnt, int device)
 
static MPTKEvent MPTK_Read ()
 
static void MPTK_SetRealTimeRead ()
 
static void MPTK_UnsetRealTimeRead ()
 
static string MPTK_Version ()
 

Properties

static PluginError MPTK_LastStatus [get]
 

Events

static Action< MPTKEventOnActionInputMidi
 

Detailed Description

[MPTK PRO] Base class to send and receive Midi Message from a Midi keyboard connected to the desktop

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;
}
else
{
MidiKeyboard.OnActionInputMidi -= ProcessEvent;
}
[MPTK PRO] Base class to send and receive Midi Message from a Midi keyboard connected to the desktop
Definition: MidiKeyboard.cs:19
static void MPTK_UnsetRealTimeRead()
Definition: MidiKeyboard.cs:314
static void MPTK_SetRealTimeRead()
Definition: MidiKeyboard.cs:274

◆ 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 message is available.

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