Copyright © 2013-2014 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]

MidiVirtualKeyboard.Create (

hWndParent as IntPtr,

nLeft as Int32,

nTop as Int32,

nWidth as Int32,

nHeight as Int32,

nLowNote as Int16,

nHighNote as Int16,

bSendEventNotif as Boolean,

nOrientation as enumDjcMidiKeyboardOrientations

) as IntPtr


 

[C#]

public IntPtr MidiVirtualKeyboard.Create (

IntPtr hWndParent,

Int32 nLeft,

Int32 nTop,

Int32 nWidth,

Int32 nHeight,

Int16 nLowNote,

Int16 nHighNote,

bool bSendEventNotif,

enumDjcMidiKeyboardOrientations nOrientation

);


 

[C++]

public: IntPtr MidiVirtualKeyboard.Create (

IntPtr hWndParent,

Int32 nLeft,

Int32 nTop,

Int32 nWidth,

Int32 nHeight,

Int16 nLowNote,

Int16 nHighNote,

bool bSendEventNotif,

enumDjcMidiKeyboardOrientations 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

 

 

IntPtr.Zero

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