BASS.NET API for the Un4seen BASS Audio LibraryMidiSysExMessageMessageWrite 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.12.0
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

VB
Private _midiOutProc As MIDIOUTPROC
Private _midiOutHandle As IntPtr
...
_midiOutProc = New MIDIOUTPROC(AddressOf MyMidiOutProc)
Midi.MIDI_OutOpen(_midiOutHandle, 0, _midiOutProc, 0)
...
' create a new system-exclusive message
Dim sysex As New MidiSysExMessage(False, _midiOutHandle)
' message will be 8 byte (incl. SoX and EoX)
sysex.CreateBuffer(8)
' write start-of-system-exclusive
sysex.MessageWriteSoX()
Dim offset As Integer = 1
' write 6 more bytes...
sysex.MessageWrite8(offset, 65)
sysex.MessageWrite16(offset, 1023)
sysex.MessageWrite16(offset, 13)
sysex.MessageWrite8(offset, 1)
' write end-of-system-exclusive
sysex.MessageWriteEoX()
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