Copyright © 2001-2018 MultiMedia Soft

MIDI.KeyboardNote method

Previous pageReturn to chapter overviewNext page

Remarks

 

Acts on the key corresponding to the given note on the virtual piano keyboard. The key pressure can be real, e.g. generating a note on the MIDI stream, or simulated: in this latest case the key on the keyboard results to be pressed but no sound is generated.

 

For further details about the use of MIDI protocol see the MIDI object section and the How to deal with MIDI protocol tutorial.

 

 

Syntax

 

[Visual Basic]

control.MIDI.KeyboardNote (

hWndKeyboard as OLE_HANDLE,

nNote as Long,

nVelocity as Long,

bSimulated as enumBoolean

) as enumErrorCodes


 

[C++]

short control.MIDI.KeyboardNote (

OLE_HANDLE hWndKeyboard,

long nNote,

long nVelocity,

short bSimulated

);


 

Parameter

Description

 

 

hWndKeyboard

Handle of the virtual keyboard as returned by the call to the MIDI.KeyboardCreate method

nNote

Note to play. Can be a key number from 0 to 127; 60 means middle C

nVelocity

Velocity of the note. 0 means key released while values from 1 to 127 mean pressure.

bSimulated

Boolean flag that specifies if the key pressure is simulated. When the key pressure is simulated, the key will appear pressed on the piano keyboard but no real event will be 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

Value

Meaning

BOOL_FALSE

0

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

BOOL_TRUE

1

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.

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful