alCSeqPlayer.3p
4.7 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.TH alCSeqPlayer 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
alCSeqPlayer \- Ultra 64 Compressed MIDI sequence player routines.
.SH SYNOPSIS
.nf
\f3
.Op c
#include <libaudio.h>
.sp .8v
void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config);
void alCSPDelete(ALCSPlayer *seqp);
void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq);
ALCSeq *alCSPGetSeq(ALCSPlayer *seqp);
void alCSPSetBank(ALCSPlayer *seqp, ALBank *b);
s32 alCSPGetState(ALCSPlayer *seqp);
void alCSPPlay(ALCSPlayer *seqp);
void alCSPStop(ALCSPlayer *seqp);
void alCSPSetBank(ALCSPlayer *seqp, ALBank *b);
void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo);
s32 alCSPGetTempo(ALCSPlayer *seqp);
s16 alCSPGetVol(ALCSPlayer *seqp);
void alCSPSetVol(ALCSPlayer *seqp, s16 vol);
void alCSPSetChlProgram(ALCSPlayer *seqp, u8 chan, u8 prog);
s32 alCSPGetChlProgram(ALCSPlayer *seqp, u8 chan);
void alCSPSetChlFXMix(ALCSPlayer *seqp, u8 chan, u8 fxmix);
u8 alCSPGetChlFXMix(ALCSPlayer *seqp, u8 chan);
void alCSPSetChlPan(ALCSPlayer *seqp, u8 chan, ALPan pan);
ALPan alCSPGetChlPan(ALCSPlayer *seqp, u8 chan);
void alCSPSetChlVol(ALCSPlayer *seqp, u8 chan, u8 vol);
u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan);
void alCSPSetChlPriority(ALCSPlayer *seqp, u8 chan, u8 priority);
u8 alCSPGetChlPriority(ALCSPlayer *seqp, u8 chan);
void alCSPSendMidi(ALCSPlayer *seqp, long ticks, u8 status,
u8 byte1, u8 byte2);
.Op
\f1
.fi
.SH DESCRIPTION
The Ultra 64 Audio Library supports playback of MIDI sequences using either
the Type 0 MIDI Sequence Player, whose routines start with
.B alSeqp,
or the Compressed MIDI Sequence Player, whose routines start with
.B alCSP.
This man page details the Compressed MIDI Sequence Player. For details
of the Type 0 MIDI Sequence Player, see the man page for
.B alSeqPlayer.
The principle differences between the two MIDI players are the handling of
loops, and the compression of data. Details are discussed in the Nintendo 64
Programming Manual's chapters, Audio Library and Audio Formats.
.PP
The sequence player handles the playback of the sequence, but
the actual sequence data is handled by a Sequence
(see
.B alCSeq).
.PP
To use a Compressed Sequence Player, you must first initialize an ALCSPlayer
structure to represent it. This is accomplished with a call to
.B alCSPNew.
.PP
After initializing the ALCSPlayer structure, you must set the bank and the
sequence with calls to
.B alCSPSetBank
and
.B alCSPSetSeq
respectively.
.PP
To start the sequence player playing, call
.B alCSPPlay.
To stop the sequence player, call
.B alCSPStop.
The sequence player can only have one target sequence at a time. You must
stop a sequence before setting and playing a new sequence. You should not
attempt to switch banks while a sequence is playing. You can use
.B alCSPGetState
to determine if the sequence player is fully stopped. When you call
.B alCSPStop,
all processing of the sequence will stop and all notes will be turned off.
.PP
When a sequence is stopped it will not "rewind" but will remain pointing to
its current location. This allows you to restart a sequence from where it
was stopped with a call to
.B alCSPPlay.
Sustained notes that were cut off by a call to
.B alCSPStop
will not be restarted, only new notes will be processed.
.PP
If you want to rewind the sequence or relocate to another point in the
sequence, you can create an ALCSeqMarker at the desired location using the call
.B alCSeqNewMarker,
and then call
.B alCSeqSetLoc
to rewind or relocate the sequence. Note that these calls do not affect
the channel playback state so care should be taken to make sure that the
channel parameters (eg. program, vol, pan, etc.) are set to appropriate
values for the given sequence location.
Channel parameters can be set with their individual calls or by sending the
appropriate midi data using
.B alCSPSendMidi.
Music can be created in realtime and played back with
.B alCSPSendMidi.
The compressed MIDI sequence player doesn't support loops created by API calls
like the Type 0 MIDI sequence player does. To loop music using the compressed
MIDI sequence player the sequences must have loop points imbedded in them.
Details of how to imbed loop points are discussed in the Ultra 64 Programming
Guide's Audio Library section.
.SH SEE ALSO
alCSeq(3P),
alCSPNew(3P),
alCSPDelete(3P),
alCSPSetSeq(3P),
alCSPGetSeq(3P),
alCSPPlay(3P),
alCSPStop(3P),
alCSPSetBank(3P),
alCSPSetTempo(3P),
alCSPGetTempo(3P),
alCSPGetVol(3P),
alCSPSetVol(3P),
alCSPSetChlProgram(3P),
alCSPGetChlProgram(3P),
alCSPSetChlFXMix(3P),
alCSPGetChlFXMix(3P),
alCSPSetChlPan(3P),
alCSPGetChlPan(3P),
alCSPSetChlVol(3P),
alCSPGetChlVol(3P),
alCSPSetChlPriority(3P),
alCSPGetChlPriority(3P),
alCSPSendMidi(3P)