BASS.NET API for the Un4seen BASS Audio Library

MidiShortMessageGetPairedData2 Method

BASS.NET API for the Un4seen BASS Audio Library
Returns a combined paired Data2 value from a MSB and a LSB MidiShortMessage.

Namespace:  radio42.Multimedia.Midi
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public static short GetPairedData2(
	MidiShortMessage msgMSB,
	MidiShortMessage msgLSB
)

Parameters

msgMSB
Type: radio42.Multimedia.MidiMidiShortMessage
The MidiShortMessage containing the MSB (most significant) Data2 byte value.
msgLSB
Type: radio42.Multimedia.MidiMidiShortMessage
The MidiShortMessagecontaining the LSB (least significant) Data2 byte value.

Return Value

Type: Int16
The combined data value ranging from 0 to 16383 (128*128 values).
Remarks

The Data2 byte of the msgLSB message will contain the lower 7-bit value (single steps) and the Data2 byte of the msgMSB message the upper 7-bit value (128th steps) both ranging from 0 to 128.

Some Midi data messages might actually use two sub-sequent short messages to construct a paired message representing a single value range (e.g. the ControlChange with a BankSelect). This to support paired values with a higher resolution (16384 instead of 128 values). The same might apply the the controller value itself. In such case two short messages will be send, where one contains the LSB value (single steps) in it's Data2 byte and the other message contains the MSB value (128th steps) in it's Data2 byte. Typically the messages with a StatusType of ControlChange and with a Controller value between 0 and 31 (MSB) are paired with a message of a Controller value between 32 and 63 (LSB). But also a Controller value of 98 (LSB) will be paired with a Controller value of 99 (MSB) as well as a Controller value of 100 (LSB) will be paired with a Controller value of 101 (MSB). Other pairs might be hardware specific.

So it might be useful to keep in your MIDIINPROC handler always the current and the last message.

The resulting combined data value will be constructed like this: dataMSB=0xxxxxxx, dataLSB=0yyyyyyy = paired=00xxxxxxxyyyyyyy.

You might also use the GetPairedData1(MidiShortMessage, MidiShortMessage) resp. the GetPairedData(Byte, Byte) method to retrieve a combined value from two short messages resp. two data value.

See Also

Reference