alCSPNew (function)

alCSPNew, n_alCSPNew

Initializes a compressed MIDI sequence player

Syntax

#include <libaudio.h>     /* libaudio.h */
void alCSPNew(    ALCSPlayer *seqp, ALSeqpConfig *config);
#include <n_libaudio.h>     /* n_libaudio.h */
void n_alCSPNew(N_ALCSPlayer *seqp, ALSeqpConfig *config);

Arguments

seqp
Pointer to the compressed MIDI sequence player structure to initialize

config
Pointer to the sequence player configuration structure
(Note: Bothe alSeqpNew and alCSPNew use the same configuration structure.)

Description

alCSPNew initializes a compressed MIDI sequence player (seqp) for the configuration specified in config, and it signs into the synthesis driver as a client. It allocates memory from the (initialized) ALHeap structure.

The arguments in the ALSeqpConfig structure (config) determine how many resources are allocated from the heap. This structure is defined in the <libaudio.h> file. The values are as follows:

maxVoices
The maximum number of voices to support

maxEvents
The maximum number of internal events to support

maxChannels
The maximum number of MIDI channels to support, usually 16 or smaller.

debugFlags
are flags used to report common audio errors. It is set to zero to turn off error reporting. To turn on error reporting, "OR" together the following values. NO_SOUND_ERR_MASK controls error messages that occur when there is no sound that covers the requested sound at the specified pitch. NOTE_OFF_ERR_MASK controls error messages that occur when a "note off" occurs when there is no voice currently playing that note on the specified channel. NO_VOICE_ERR_MASK controls error messages that occur when there are no more voices available to satisfy the request to allocate a voice.

*initOsc
Points to the procedure that handles the initialization of oscillatores used to perform vibrato and tremelo. If vibrato and tremelo are not used, this value must be set to zero.

*updateOsc
Points to the procedure that handles the updating of oscillators used to perform vibrato and tremelo. If vibrato and tremelo are not used, this value must be set to zero.

*stopOsc
Points to the procedure that handles the shutting down of oscillators used to perform vibrato and tremelo. If vibrato and tremelo are not used, this value must be set to zero.

heap
Pointer to an initialized audio heap.

An example showing how to set up and use oscillators is presented in the Playseq demo application.

For details on n_audio library, see "Chapter 28: n_audio library" in the N64 Programming Manual.

See Also

alHeapNew, alHeapAlloc, alCSPDelete

Revision History

1999/04/30 Changed Format