BASS.NET API for the Un4seen BASS Audio Library

MidiShortMessageControllerValue Property

BASS.NET API for the Un4seen BASS Audio Library
Gets or Sets the controller value from/to the Data2 byte (and optionally from the PreviousShortMessage).

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

public short ControllerValue { get; set; }

Property Value

Type: Int16

The controller value normally ranges from 0 to 127. But if the controller is a continuous controller, this simply means that it's value can be set to any value within the range from 0 to 16383 (for 14-bit coarse/fine resolution).

To set a continuous controllers use the SetContinuousController(Boolean, Boolean). By default this is never set. In such case this property will return the combined controller value by pairing this contoller value with the one from the PreviousShortMessage. Note: You must explicitly call the SetContinuousController(Boolean, Boolean) method in order to obtain the paired value. There is also no additional check performed (except that the PreviousShortMessage must exist and must have a StatusType of value ControlChange). Setting this member if IsSetAsContinuousController will in such case also modify this short-message as well as the PreviousShortMessage!

This property should only be used when StatusType is ControlChange.

Note: Some ControlChange messages might actually use two short messages (e.g. the BankSelect) to support paired values with a higher resolution (16384 instead of 128 values). In such case two messages will be send, where one contains the the LSB value (single steps) in it's Data2 byte and the other on the MSB value (128th steps) in it's Data2 byte.

For this special case it might be useful to keep in your MIDIINPROC handler always the current and the last message.

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

To access the controller number using this value access the Controller or ControllerType property.

See Also