MidiNewEv


Allocates a new event of desirable type.

pascal MidiEvPtr    MidiNewEv( short typeNum );

typeNum
the type of event to be allocated.

The result a MidiEvPtr, a pointer to a MidiShare event of the desired type, or NIL if the MidiShare memory space is exhausted.


A function for creating note events.



MidiEvPtr Note(long date, short pitch, short vel, long dur, short chan, short port)
{
    MidiEvPtr e;
    
    if ( e=MidiNewEv(typeNote) )
    {
        Date(e) = date; Pitch(e) = pitch; Vel(e) = vel;
        Dur(e) = dur; Chan(e) = chan; Port(e) = port;
    }
    return e;
}