A Song Position Pointer message with a 14 bit location (unit : 6 Midi Clocks).
![]()
SongPos events have 2 fields numbered from 0 to 1 :
0- LS 7-Bits of 14-bits location, from 0 to 127. (Field size : 1 byte)
1- MS 7-Bits of 14-bits location, from 0 to 127. (Field size : 1 byte)
Creates a SongPos event with a location in Midi clocks. The location is internally divided by 6. Return a pointer to the event or NIL if there is no more memory space.
MidiEvPtr SongPos( long date, short pos, short port)
{
MidiEvPtr e;
pos = pos / 6;
if ( e = MidiNewEv( typeSongPos) ) /* Allocate a new event. Check not NIL */
{
Date(e) = date; /* These information are common to all */
Port(e) = port; /* kind of events */
MidiSetField(e,0,pos & 0x7F); /* LS-7bits Field */
MidiSetField(e,1,pos>>7 & 0x7F); /* MS-7bits Field */
}
return e;
}