alCSeq.3p
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.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)