PROGRAMMER'S GUIDESound I / F library
Back | ■
Sound I / F library

2.4 Function specifications

[Sound system boot]


 List
 Title

Function specifications

 Function

Sound system boot

 Function name

SND_Init

 No

1

Form
void SND_Init (SndIniDt * sys_ini)
input
sys_ini: System boot data
output
none
Function value
none
function
The program, sound area map transfer, and register initialization are performed based on the specified system boot data, and the sound system is booted. For more information on booting the sound system, see the Sound Driver System Interface in the Sound Development Manual.
remarks
Use SCU DMA transfer for the transfer.
caution
Do not use this function in interrupt processing.

[interrupt]


 List
 Title

Function specifications

 Function

Interrupt enable setting

 Function name

SND_SET_ENA_INT

 No

2

Form
void SND_SET_ENA_INT (Uint8 data)
input
data: Interrupt enable bit (1: enable, 0: disable) constant
 Bit position constant
 explanation
 SND_INT_PCM_ADR
 PCM address interrupt

output
none
Function value
none
function
Set interrupt enable. This is the setting for whether to generate an interrupt signal from the sound system, not the setting for the SCU interrupt mask.

 List
 Title

Function specifications

 Function

Get interrupt permission

 Function name

SND_GET_ENA_INT

 No

3

Form
Unit8 SND_SET ENA_INT (void)
input
none
output
Interrupt enable bit (1: enable, 0: disable)
constant
 Bit position constant
 explanation
 SND_INT_PCM_ADR
 PCM address interrupt

Function value
none
function
Get interrupt permission

 List
 Title

Function specifications

 Function

Interrupt factor acquisition

 Function name

SND_SET_FCT_INT

 No

Four

Form
Unit8 SND_GET_FCT_INT (void)
input
none
output
Interrupt enable bit
constant
 constant
 explanation
 SND_FCT_PCM_ADR
 PCM adress update

Function value
none
function
Set the interrupt factor.

 List
 Title

Function specifications

 Function

Interrupt set

 Function name

SND_RESET_INT

 No

Five

Form
void SND_RESET_INT (void)
input
none
output
none
Function value
none
function
Reset the interrupt. Execute after the sound is interrupted. If you do not execute this function, the interrupt will remain on.

[Preparation for performance]


 List
 Title

Function specifications

 Function

Sound data transfer

 Function name

SND_MoveData

 No

6

Form
void SND_MoveData (Uint16 * source, Unit32 size, Uint16 data_kind, Uint16 data_no)
input
source: Sound data transfer source address size: Transfer size (in bytes) data_kind: Data type
Data type constant name
 Constant name
 explanation
 SND_KD_TONE
 Tone bank data
 SND_KD_SEQ
 Sequence data
 SND_KD_DSP_PRG
 DSP program
 SND_KD_DSP_RAM
 DSP work RAM

data_no: data number
output
none
Function value
none
function
Sound data is transferred to the sound memory according to the map information corresponding to the specified data type and data number.
remarks
Use SCU DMA transfer for the transfer.
For the default interrupt priority, do not use SND_MoveData () in interrupt processing.
To use it in interrupt processing, change the interrupt priority so that the DMA end interrupt can be acquired in interrupt processing.
Use the system library to change the interrupt priority.

[Sound Control]

common


 List
 Title

Function specifications

 Function

Change sound area map

 Function name

SND_ChgMap

 No

7

Form
SndRet SND_ChgMap (SndAreaMap area_no)
input
area_no: Sound area map number
output
none
Function value
Command execution status
function
Change the current sound area map to the sound area map indicated by the sound area map number.
caution
If there is sound when changing the sound area map, or if the DSP is operating, switching the map or replacing the sound data in use may cause the sound driver system to run out of control, so be sure to observe the following. Please give me.

Execute the sound area map change function SND_ChgMap () after executing the following two commands when there is no sound on the CD-DA.


 List
 Title

Function specifications

 Function

DSP canceled

 Function name

SND_StopDsp

 No

8

Form
SndRet SND_StopDsp (void)
input
none
output
none
Function value
Command execution status
function
Stops the execution of the DSP microprogram.
remarks

 List
 Title

Function specifications

 Function

Stop sounding all sounds

 Function name

SND_OffAllSound

 No

9

Form
SndRet SND_OffAllSound (void)
input
none
output
none
Function value
Command execution status
function
Stops all sound pronunciation.
remarks

 List
 Title

Function specifications

 Function

Overall volume setting

 Function name

SND_SetTlVl

 No

Ten

Form
SndRet SND_SetTlVl (SndTlVl vol)
input
vol: Overall volume
output
none
Function value
Command execution status
function
Change the overall volume.
remarks
Affects only sequence and PCM.

 List
 Title

Function specifications

 Function

Effect change

 Function name

SND_ChgEfct

 No

11

Form
SndRet SND_ChgEfct (SndEfctBnkNum efct_no)
input
efct_no: Effect bank number
output
none
Function value
Command execution status
function
Executes the DSP program indicated by the effect bank number.

 List
 Title

Function specifications

 Function

Mixer change

 Function name

SND_ChgMix

 No

12

Form
SndRet SND_ChgMix (SndToneBnkNum tone_no, SndMixBnkNum mix_no)
input
tone_no: tone bank number mix_no: Mixer number
output
none
Function value
Command execution status
function
Change the mixer.

 List
 Title

Function specifications

 Function

Mixer parameter change

 Function name

SND_ChgMixPrm

 No

13

Form
SndRet SND_ChgMixPrm (SndEfctOut efct_out SndLev level, SndPan pan)
input
efct_out: Effect out select level: Effect return Level pan: Effect Pan
output
none
Function value
Command execution status
function
Change the parameters of the mixer.

 List
 Title

Function specifications

 Function

Hardware check

 Function name

SND_ChkHard

 No

14

Form
SndRet SndChkHard (SndHardStat * stat, SndHardChk prm)
input
prm: Hard check parameter
output
stat: Hard check status
Function value
Command execution status
function
Perform a hardware check according to the hardware parameters.

sequence


 List
 Title

Function specifications

 Function

Sequence start

 Function name

SND_StartSeq

 No

15

Form
SndRet SND_StartSeq (SndSeqNum seq_no, SndSeqBnkNum seq_bk_no, SndSeqSongNum song_no, SndSeqPri pri_lev)
input
seq_no: Pronunciation control number seq_bk_no: Sequence bank number song_no: Sequence song number pri_lev: Priorty level
output
none
Function value
Command execution status
function
Starts the specified sequence.

 List
 Title

Function specifications

 Function

Sequence abort

 Function name

SND_StopSeq

 No

16

Form
SndRet SND_StopSeq (SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
none
Function value
Command execution status
function
Aborts the specified sequence.

 List
 Title

Function specifications

 Function

Sequence pause

 Function name

SND_PauseSeq

 No

17

Form
SndRet SND_PauseSeq (SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
none
Function value
Command execution status
function
Suspends the specified sequence.

 List
 Title

Function specifications

 Function

Release sequence suspension

 Function name

SND_ContSeq

 No

18

Form
SndRet SND_ContSeq (SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
none
Function value
none
function
Unpauses the specified sequence.

 List
 Title

Function specifications

 Function

Sequence volume setting

 Function name

SND_SetSeqVl

 No

19

Form
SndRet SND_SetSeqVl (SndSeqNum seq_no, SndSeqVl seq_vl, SndFade fade)
input
seq_no: Pronunciation control number seq_vl: Sequence Volume fade: fade Rate
output
none
Function value
Command execution status
function
Sets the volume of the sequence.

 List
 Title

Function specifications

 Function

Sequence PAN setting

 Function name

SND_SetSeqPan

 No

20

Form
SndRet SND_SetSeqPan (SndSeqNum seq_no, Uint8 ctrl_sw, Uint8 md_pan)
input
seq_no : Pronunciation control number
ctrl_sw : Control switch
SND_SEQ_PAN_ON = Control ON
SND_SEQ_PAN_OFF = Control OFF
md_pan : MIDI PAN data
Meaning of set value
left ← −− Center − − → Right
0x00 ← −− 0x40 −− → 0x7f 
output
none
Function value
Command execution status
function
Set the PAN of the sequence.
reference
"Sound Driver Programmer's Guide"
Sound control command details
● 0EH SEQUENCE PAN

 List
 Title

Function specifications

 Function

Tempo change

 Function name

SND_ChgTempo

 No

twenty one

Form
SndRet SND_ChgTempo (SndSeqNum seq_no, SndTempo tempo)
input
seq_no: Pronunciation control number tempo: Tempo
output
none
Function value
Command execution status
function
Makes the specified sequence the specified Tempo.

 List
 Title

Function specifications

 Function

MIDI direct control

 Function name

SND_CtrlDirMidi

 No

twenty two

Form
SndRet SND_CtrlDirMidi (SndSeqNum seq_no, SndSeqPri seq_pri, Uint8 md_com, Uint8 ch, Uint8 dt1, Uint8 dt2)
input
seq_no: Pronunciation control number seq_pri: Priorty level md_com: MIDI command (0H to 7H) ch: MIDI channel (0H to 1FH) dt1: MIDI data1 (00H to 7FH) dt2: MIDI data2 (00H to 7FH)
output
none
Function value
Command execution status
function
Controls MIDI directly according to the specified parameters.

PCM


 List
 Title

Function specifications

 Function

PCM start

 Function name

SND_StartPcm

 No

twenty three

Form
SndRet SND_StartPcm (SndPcmStartPrm * sprm, SndPcmChgPrm * cprm)
input
sprm: PCM start parameter pointer cprm: PCM change parameter pointer
output
none
Function value
Command execution status
function
Plays PCM data according to the specified parameters.

 List
 Title

Function specifications

 Function

PCM canceled

 Function name

SND_StopPcm

 No

twenty four

Form
SndRet SND_StopPcm (SndPcmNum pcm_num)
input
pcm_num: Playback stop PCM stream playback number
output
none
Function value
Command execution status
function
Stops playing PCM data.

 List
 Title

Function specifications

 Function

PCM change

 Function name

SND_ChgPcm

 No

twenty five

Form
SndRet SND_ChgPcm (SndPcmChgPrm * cpcm)
input
cpcm: PCM change parameter pointer
output
none
Function value
Command execution status
function
Changes the playback status of PCM data.

CD


 List
 Title

Function specifications

 Function

Volume analysis started

 Function name

SND_StartVlAnl

 No

26

Form
SndRet SND_StartVlAnl (void)
input
none
output
none
Function value
Command execution status
function
Volume analysis will start. Starts analysis of volume by frequency band and overall volume. Volume analysis continues until you execute the volume analysis stop function. When analyzing the volume by frequency band, execute the dedicated DSP program by changing the effect before executing this function. No DSP program is required to analyze the overall volume.
remarks
No other DSP program can be executed while the DSP program for volume analysis by frequency band is being executed.

 List
 Title

Function specifications

 Function

Volume analysis canceled

 Function name

SND_StopVlAnl

 No

27

Form
SndRet SND_StopVlAnl (void)
input
none
output
none
Function value
Command execution status
function
Volume analysis will be stopped.

 List
 Title

Function specifications

 Function

CD-DA Level setting

 Function name

SND_SetCdDaLev

 No

28

Form
SndRet SND_SetCdDaLev (SndLev left, SndLev right)
input
left: Volume of left output right: Volume of right output
output
none
Function value
Command execution status
function
Change the current stereo volume.

 List
 Title

Function specifications

 Function

CD-DA Pan settings

 Function name

SND_SetCdDaPan

 No

29

Form
SndRet SND_SetCdDaPan (SndPan left, SndPan right)
input
left: Left output PAN right: Right output PAN
output
none
Function value
Command execution status
function
Change the current stereo PAN.

[Get status]

sequence


 List
 Title

Function specifications

 Function

Get sequence status

 Function name

SND_GetSeqStat

 No

30

Form
void SND_GetSeqStat (SndSeqStat * status, SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
status: Sequence status pointer
Function value
none
function
Gets the sequence status of the specified pronunciation control number.

 List
 Title

Function specifications

 Function

Pronunciation control number Playback position acquisition

 Function name

SND_GetSeqPlayPos

 No

31

Form
void SND_GetSeqPlayPos (SndSeqPlayPos * pos, SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
pos: Pronunciation control number playback position
Function value
none
function
Acquires the playback position of the specified pronunciation control number.

PCM


 List
 Title

Function specifications

 Function

Get PCM execution address

 Function name

SND_GetPcmPlayAdr

 No

32

Form
void SND_GetPcmPlayAdr (SndPcmPlayAdr * adr, SndPcmNum num)
input
num: PCM playback number
output
adr: PCM execution address
Function value
none
function
Gets the address of the PCM data currently being played.

 List
 Title

Function specifications

 Function

PCM address update interrupt status acquisition

 Function name

SND_GET_INT_STAT

 No

33

Form
SndPcmIntStat SND_GET_INT_STAT (void)
input
none
output
none
Function value
PCM address update interrupt status
function
Gets the PCM address update interrupt status. This is valid when the interrupt factor is a PCM addres update interrupt. You can see which PCM playback number address has been updated.

CD


 List
 Title

Function specifications

 Function

Acquisition of stereo volume for the entire analysis

 Function name

SND_GetAnlTlVl

 No

34

Form
void SND_GetAnlTlVl (SndCdVlAnl * left, SndCdVlAnl * right)
input
none
output
left: Overall analysis volume of left output right: Overall analysis volume of right output
Function value
none
function
Gets the overall stereo analysis volume. Execute the volume analysis start function before executing this function.
remarks
The volume is updated at 16msec intervals.

 List
 Title

Function specifications

 Function

Acquisition of stereo volume by analysis frequency band

 Function name

SND_GetAnlHzVl

 No

35

Form
void SND_GetAnlHzVl (SndCdHzSrVl * hz_vl)
input
none
output
hz_vl: Stereo analysis volume by frequency band
Function value
none
function
Acquires the stereo analysis volume for each frequency band. Execute the volume analysis start function before executing this function.
remarks
The volume is updated at 16msec (1/60sec) intervals.

 List
 Title

Function specifications

 Function

Sound control settings

 Function name

SND_SET_SND_CTRL

 No

36

Form
void SND_SET_SND_CTRL (Uint8 snd_ctrl)
input
Sound control value
SND_CTRL_OUTPUT_STEREO: Stereo
SND_CTRL_OUTPUT_MONO: Monaural
output
none
Function value
none
function
Set the sound control value.
Currently, you can select and set the stereo / monaural mode.
remarks

 List
 Title

Function specifications

 Function

Get sound control

 Function name

SND_GET_SND_CTRL

 No

37

Form
Uint8 SND_GET_SND_CTRL (void)
input
none
output
Sound control value
SND_CTRL_OUTPUT_STEREO: Stereo
SND_CTRL_OUTPUT_MONO: Monaural
Function value
none
function
Gets the sound control value.
remarks

3D sound

 List
 Title

Function specifications

 Function

QSOUND parameter set

 Function name

SND_SetQSound

 No

1

Form
SndRet SND_SetQSound (Uint8 QCh, Uint8 QSt)
input
QCh: QSOUND channel to control
QSt: QSOUND PAN data (0x00 to 0x1e)
Meaning of set value
left ← −− Center − − → Right
0x00 ← −− 0x0f −− → 0x1e 
output
none
Function value
Command execution status
function
Set the localization of QSOUND.

 List
 Title

Function specifications

 Function

YAMAHA 3D parameter set

 Function name

SND_Set3D_Stat

 No

2

Form
SndRet SND_Set3D_Stat (Uint8 Y3DDst, Uint8 Y3DAzm, Uint8 Y3DElv)
input
Y3DDst: Distance (0x00 to 0x7f)
Y3DAzm: Direction (0x00 to 0x7f)
Y3DElv: Height (0x00 to 0x7f)
output
none
Function value
Command execution status
function
Set the YAMAHA 3D localization.

 List
 Title

Function specifications

 Function

YAMAHA 3D localization initialization

 Function name

SND_Set3D_Init

 No

3

Form
SndRet SND_Set3D_Init ()
input
none
output
none
Function value
Command execution status
function
Set the YAMAHA 3D localization to the center of the front.

Back | ■
PROGRAMMER'S GUIDESound I / F library
Copyright SEGA ENTERPRISES, LTD., 1997