BASS.NET API for the Un4seen BASS Audio Library

MidiSysExMessageMessageWrite Method

BASS.NET API for the Un4seen BASS Audio Library
Writes an 8-bit value to the Message data buffer (full).

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

public void MessageWrite(
	ref int offset,
	byte value
)

Parameters

offset
Type: SystemInt32
The zero-base offset (index) of the Message data buffer where to start writing (the offset will be automatically be increased by the number of bytes written).
value
Type: SystemByte
The full byte value to write.
Remarks

You first need to initialize the Message data buffer with CreateBuffer(Int32) before being able to write to the buffer.

Do not call this method after you have prepared the message with Prepare, since after calling Prepare this method would have no effect.

Examples

private MIDIOUTPROC _midiOutProc;
private IntPtr _midiOutHandle;
...
_midiOutProc = new MIDIOUTPROC(MyMidiOutProc);
Midi.MIDI_OutOpen(ref _midiOutHandle, 0, _midiOutProc, 0);
...
// create a new system-exclusive message
MidiSysExMessage sysex = new MidiSysExMessage(false, _midiOutHandle);
// message will be 8 byte (incl. SoX and EoX)
sysex.CreateBuffer(8);
// write start-of-system-exclusive
sysex.MessageWriteSoX();
int offset = 1;
// write 6 more bytes...
sysex.MessageWrite8(ref offset, 65);
sysex.MessageWrite16(ref offset, 1023);
sysex.MessageWrite16(ref offset, 13);
sysex.MessageWrite8(ref offset, 1);
// write end-of-system-exclusive
sysex.MessageWriteEoX();
...
See Also

Reference