A Note Off message with pitch and velocity.
KeyOff events have 2 fields numbered from 0 to 1 :
0
- Pitch, a note number from 0 to 127. (Field size : 1 byte)
1
- Vel, a note velocity from 0 to 127. (Field size : 1 byte)
Creates a KeyOff event, and returns a pointer to the event or NIL if there is no more memory space. Fields are modified using MidiSetField instead of direct structure access.
MidiEvPtr KeyOff( long date, short pitch, short vel, short chan, short port) { MidiEvPtr e; if ( e = MidiNewEv( typeKeyOff ) ) /* Allocate a new event. Check not NIL */ { Date(e) = date; /* These information are common to all */ Chan(e) = chan; /* kind of events */ Port(e) = port; MidiSetField(e,0,pitch); /* These fields are particular to KeyOff */ MidiSetField(e,1,vel); } return e; }
Creates a KeyOff event, and returns a pointer to the event or NIL if there is no more memory space. Fields are modified using direct structure access instead of MidiSetField.
MidiEvPtr KeyKeyOff( long date, short pitch, short vel, short chan, short port) { MidiEvPtr e; if ( e = MidiNewEv( typeKeyOff ) ) /* Allocate a new event. Check not NIL */ { Date(e) = date; /* These information are common to all */ Chan(e) = chan; /* kind of events */ Port(e) = port; Pitch(e) = pitch; /* These fields are particular to KeyOff*/ Vel(e) = vel; } return e; }