MidiCountFields


Gives the number of fields of an event.

pascal long    MidiCountFields (MidiEvPtr e);

e
a MidiEvPtr, a pointer to the concerned event.

The result is a 32-bit integer, the number of fields of the event.


An universal method for printing of a MidiShare event.


void PrintEv(MidiEvPtr e)
{
    long i, n;
    n = MidiCountFields(e);
    printf( "Event %x content :\n", e );
    printf( " link : %x\n", Link(e) );
    printf( " date : %i\n", Date(e) );
    printf( " type : %i\n", EvType(e) );
    printf( "  ref : %i\n", RefNum(e) );
    printf( " port : %i\n", Port(e) );
    printf( " chan : %i\n", Chan(e) );
    printf( " %i fields ( ", n );
    for(i=0; i<n; ++i) printf("%i ",MidiGetField(e,i) );
    printf( ")\n" );
}

pitch (8-bit), velocity (8-bit) and duration (16-bit)). Some others, like system exclusive have a variable number of fields.