alCSeq

Is the Nintendo 64 Compressed MIDI sequence routine

Syntax

#include <libaudio.h>     /* libaudio.h */
void alCSeqNew(ALCSeq *seq, u8 *ptr);
void alCSeqNext(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);

The Nintendo 64 Audio Library supports supports playback of musical sequences that have been compressed with MIDI sequence file conversion tool midicomp. The format of these files is detailed in the AudioFormats document.

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 alCSeqNew.

After initializing the sequence structure, you can perform sequence operations. Typically, you will also create and initialize a Compressed MIDI Sequence Player to play the sequence for you.

The alCSeqNextEvent function call returns the next MIDI event from the sequence's current location. Usually, you will not call the alCSeqNextEvent function directly because it is called for you by the Sequence Player during sequence playback.

The alCSeqGetTicks function returns the current sequence location measured in ticks. The functions alCSeqTicksToSec and 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, because this calculation is done with a specific tempo, it will not be accurate if the sequence includes tempo changes.

A call to alCSeqNewMarker initializes a marker to the location specified in ticks. A call to alCSeqGetLoc initializes a marker with the current location. This marker can then be used with the alCSeqSetLoc function to jump to the location specified by the marker.

See Also

alCSeqNew, alCSeqNextEvent, alCSeqGetTicks, alCSeqTicksToSec, alCSeqSecToTicks, alCSeqNewMarker, alCSeqSetLoc, and alCSeqGetLoc

Revision History

1999/04/30 Changed Format