Copyright © 2013-2015 MultiMedia Soft

CallbackMidiKeyboardNotification delegate

Previous pageReturn to chapter overviewNext page

Remarks

 

Callback delegate invoked from a secondary thread when one of the keys on the virtual piano keyboard, previously created through the MidiVirtualKeyboard.Create method, is pressed or released.

 

In order to allow the component invoking this delegate at runtime, the container application must invoke the CallbackMidiKeyboardNotificationSet method passing the address of the callback function.

 

For further details about callback delegates see the How to synchronize the container application with the API tutorial.

For further details about the use of the virtual MIDI keyboard see the ClassMidiVirtualKeyboard class section and the How to manage the virtual MIDI piano keyboard tutorial.

 

 

[Visual Basic]

Public Delegate Sub CallbackMidiKeyboardNotification (

hWndKeyboard as Int32,

nNote as Int16,

bPressed as Boolean,

bSimulated as Boolean,

nUserData as Int32

)


 

[C#]

public delegate void CallbackMidiKeyboardNotification (

Int32 hWndKeyboard,

Int16 nNote,

bool bPressed,

bool bSimulated,

Int32 nUserData

)


 

[C++]

public delegate void CallbackMidiKeyboardNotification (

Int32 hWndKeyboard,

Int16 nNote,

bool bPressed,

bool bSimulated,

Int32 nUserData

)


 

 

Parameter

Description

 

 

hWndKeyboard

Handle of the virtual keyboard as returned by the call to the MidiVirtualKeyboard.Create method

nNote

Note played through pressure of one of the keys of the virtual piano keyboard. Can be a key number from 0 to 127; 60 means middle C

bPressed

Boolean flag that specifies if the key was pressed or released.

Supported values are the following:

Mnemonic constant

Meaning

false

The key was released

true

The key was pressed

bSimulated

Boolean flag that specifies if the key pressure is simulated. When the key pressure is simulated, the key appears pressed on the piano keyboard but no real event is generated on the MIDI stream in playback, allowing to display a note played through an external physical MIDI keyboard attached to one of the MIDI input channels.

Supported values are the following:

Mnemonic constant

Meaning

false

The call to this method will play the requested note on the MIDI stream in playback

true

The call to this method will not play the requested note on the MIDI stream in playback but will display the corresponding key as pressed on the piano keyboard.

nUserData

User instance data