Copyright © 2013-2015 MultiMedia Soft

MidiVirtualKeyboard.Create method

Previous pageReturn to chapter overviewNext page

Remarks

 

Creates a new virtual piano keyboard on the given parent window.

 

Notes played on the virtual piano, through the left button of the mouse, will be directly sent to the MIDI stream in playback on the given player.

Keys pressure/release can be simulated through the MidiVirtualKeyboard.Note method, for example for displaying a note played through an external physical MIDI keyboard attached to one of the MIDI input channels.

 

The container application is notified each time a key on the virtual keyboard is pressed or released through the MidiKeyboardNotification event.

 

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

 

 

Syntax

 

[Visual Basic]

control.MidiVirtualKeyboard.Create (

hWndParent as OLE_HANDLE,

nLeft as Long,

nTop as Long,

nWidth as Long,

nHeight as Long,

nLowNote as Integer,

nHighNote as Integer,

bSendEventNotif as enumBoolean,

nOrientation as enumDjcMidiKeyboardOrientations

) as OLE_HANDLE


 

[C++]

OLE_HANDLE control.MidiVirtualKeyboard.Create (

OLE_HANDLE hWndParent,

long nLeft,

long nTop,

long nWidth,

long nHeight,

short nLowNote,

short nHighNote,

short bSendEventNotif,

short nOrientation

);


 

Parameter

Description

 

 

hWndParent

Handle of the parent window, usually the container form.

nLeft

Left position of the keyboard window, expressed in client coordinates (pixels) of hWndParent

nTop

Top position of the keyboard window, expressed in client coordinates (pixels) of hWndParent

nWidth

Width of the keyboard window, expressed in pixels

nHeight

Height of the keyboard window, expressed in pixels

nLowNote

Lower note displayed on the virtual piano keyboard. Can be a value between 0 and 127 but must always be a natural note (white key).

nHighNote

Higher note displayed on the virtual piano keyboard. Can be a value between 2 and 127 but must always be a natural note (white key).

bSendEventNotif

Reserved for future uses. Set this value to BOOL_FALSE.

nOrientation

Orientation of the piano keyboard.

Supported values are the following:

Mnemonic constant

Value

Meaning

MIDI_KEYBOARD_ORIENT_HORIZONTAL

0

The piano keyboard orientation is horizontal as in the picture below

MIDI_KEYBOARD_ORIENT_VERTICAL_LEFT

1

The piano keyboard orientation is left vertical as in the picture below

MIDI_KEYBOARD_ORIENT_VERTICAL_RIGHT

2

The piano keyboard orientation is right vertical as in the picture below

 

 

Return value

 

Value

Meaning

 

 

0

An error occurred, check the LastError property value in order to get the error code

Other values

Handle (HWND) of the new virtual piano keyboard