alCSeq.3p 2.26 KB
.TH alCSeq 3P local "Silicon Graphics, Inc."

.SH NAME
.upperok
alCSeq \- Ultra 64 Compressed MIDI sequence routines

.SH SYNOPSIS
.nf
\f3
.Op c
#include <libaudio.h>
.sp .8v
void    alCSeqNew(ALCSeq *seq, u8 *ptr);
void    alCSeqNextEvent(ALCSeq *seq,ALEvent *evt);
s32     alCSeqGetTicks(ALCSeq *seq);
f32     alCSeqTicksToSec(ALCSeq *seq, s32 ticks, u32 tempo);
u32     alCSeqSecToTicks(ALCSeq *seq, f32 sec, u32 tempo);
void    alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks);
void    alCSeqSetLoc(ALCSeq *seq, ALCSeqMarker *marker);
void    alCSeqGetLoc(ALCSeq *seq, ALCSeqMarker *marker); 
.Op
\f1
.fi
.SH DESCRIPTION
The Ultra 64 Audio Library supports playback of musical sequences that
have been compressed with midicomp. The format of these files is detailed
in the AudioFormats document.
.PP
To use a Compressed MIDI sequence in your game, you must first initialize 
a runtime ALCSeq structure to represent it. This is accomplished with a
call to 
.B alCSeqNew.
.PP
After initializing the sequence structure, you can perform sequence
operations. Typically, you will also create and initialize a Compressed 
MIDI Sequence Player, that will play the sequence for you.
.PP
The 
.B alCSeqNextEvent 
call returns the next MIDI event from the sequence's current location.  
Normally, you won't call 
.B alCSeqNextEvent 
directly, as it is 
called for you by the Sequence Player during sequence playback.
.PP
The function 
.B alCSeqGetTicks
returns the current sequence location measured
in ticks. The convenience functions 
.B alCSeqTicksToSec
and 
.B alCSeqSecToTicks 
convert between time formats. The "ticks" format is in units of time relative
to the MIDI clock at the resolution specified in the MIDI sequence header.
However, since this calculation is done with a specific tempo, it will not
be accurate if the sequence includes tempo changes.
.PP
A call to 
.B alCSeqNewMarker 
will initialize a marker to the location specified in ticks. A call to
.B alCSeqGetLoc
will initialize a marker with the current location. This marker can
then be used with 
.B alCSeqSetLoc
to jump to the location specified by the marker.

.SH SEE ALSO
alCSeqNew(3P),
alCSeqNextEvent(3P),
alCSeqGetTicks(3P),
alCSeqTicksToSec(3P),
alCSeqSecToTicks(3P),
alCSeqNewMarker(3P),
alCSeqSetLoc(3P),
alCSeqGetLoc(3P)