BASS.NET API for the Un4seen BASS Audio Library

MidiShortMessage Constructor (IntPtr, IntPtr, MidiShortMessage)

BASS.NET API for the Un4seen BASS Audio Library
Creates a new instance of the MidiShortMessage and also evaluates a previous short message..

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

public MidiShortMessage(
	IntPtr param1,
	IntPtr param2,
	MidiShortMessage previous
)

Parameters

param1
Type: SystemIntPtr
The MIDI message that was received.
param2
Type: SystemIntPtr
The timestamp that the message was received by the input device driver.
previous
Type: radio42.Multimedia.MidiMidiShortMessage
The previous short message received (e.g. in order to check, if a ControlChange message need to be paired - which is not done automatically here!).
Remarks

You might use this constuctor for example in your MIDIINPROC when receiving a MIM_DATA message.

MIDI messages received from a MIDI input port have running status disabled; each message is expanded to include the MIDI status byte.

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 (previous) message. Use this overload to always keep your previous message with the current short message. NOTE: The PreviousShortMessage property will only be set in case this current message and the previous are having the same StatusType (otherwise all previous messages would be links together and memory wil simply increase and increase, since the Garbage Collector would never release any un-needed messages)! In case of real-time messages the the PreviousShortMessage will also not be set.

To access the single value assigned to the Controller/ControllerType access the ControllerValue property.

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.

See Also

Reference