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

2.4 Function specifications

[Sound system start]


 one
View
table
 Title

function specification

 Function

sound system start

 Function name

SND_Init

 No

1

Format
void SND_Init(SndIniDt *sys_ini)
input
sys_ini: System startup data
output
none
function value
none
function
Starts the sound system by transferring programs and sound area maps and initializing registers based on the specified system startup data. For more information on starting the sound system, see Sound Driver System Interface in the Sound Development Manual.
remarks
The transfer uses SCU DMA transfer.
Note
Do not use this function within interrupt processing.

[interrupt]


 one
View
table
 Title

function specification

 Function

Interrupt enable setting

 Function name

SND_SET_ENA_INT

 No

2

Format
void SND_SET_ENA_INT(Uint8 data)
input
data: Interrupt enable bit (1: enabled, 0: disabled) constant
 bit position constant
 explanation
 SND_INT_PCM_ADR
 PCM address interrupt

output
none
function value
none
function
Set interrupt permission. This is a setting for whether or not to generate an interrupt signal from the sound system, not a setting for the SCU's interrupt mask.

 one
View
table
 Title

function specification

 Function

Obtain interrupt permission

 Function name

SND_GET_ENA_INT

 No

3

Format
Unit8 SND_SET ENA_INT(void)
input
none
output
Interrupt enable bit (1: enabled, 0: disabled)
constant
 bit position constant
 explanation
 SND_INT_PCM_ADR
 PCM address interrupt

function value
none
function
get interrupt permission

 one
View
table
 Title

function specification

 Function

Get interrupt factor

 Function name

SND_SET_FCT_INT

 No

4

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

function value
none
function
Set the interrupt factor.

 one
View
table
 Title

function specification

 Function

interrupt set

 Function name

SND_RESET_INT

 No

5

Format
void SND_RESET_INT(void)
input
none
output
none
function value
none
function
Reset interrupts. Run it after the sound interrupt occurs. If this function is not executed, the interrupt will continue to occur.

[Performance preparation]


 one
View
table
 Title

function specification

 Function

sound data transfer

 Function name

SND_MoveData

 No

6

Format
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
Transfers sound data to sound memory according to the map information corresponding to the specified data type and data number.
remarks
The transfer uses SCU DMA transfer.
For default interrupt priority, avoid using SND_MoveData() within interrupt processing.
To use it within interrupt processing, change the interrupt priority so that the DMA end interrupt can be obtained within interrupt processing.
Please use the system library to change the interrupt priority.

[Sound control]

common


 one
View
table
 Title

function specification

 Function

Sound area map change

 Function name

SND_ChgMap

 No

7

Format
SndRet SND_ChgMap(SndAreaMap area_no)
input
area_no: Sound area map number
output
none
function value
Command execution status
function
Changes the current sound area map to the sound area map indicated by the sound area map number.
Note
If there is sound or the DSP is operating when you change the sound area map, switching the map or replacing the sound data in use may cause the sound driver system to go out of control, so be sure to observe the following: please.

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


 one
View
table
 Title

function specification

 Function

DSP canceled

 Function name

SND_StopDsp

 No

8

Format
SndRet SND_StopDsp(void)
input
none
output
none
function value
Command execution status
function
Aborts execution of the DSP microprogram.
remarks

 one
View
table
 Title

function specification

 Function

All sound pronunciation canceled

 Function name

SND_OffAllSound

 No

9

Format
SndRet SND_OffAllSound(void)
input
none
output
none
function value
Command execution status
function
Cancels all sound pronunciation.
remarks

 one
View
table
 Title

function specification

 Function

Overall volume setting

 Function name

SND_SetTlVl

 No

10

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

 one
View
table
 Title

function specification

 Function

effect change

 Function name

SND_ChgEfct

 No

11

Format
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 Effect bank number.

 one
View
table
 Title

function specification

 Function

mixer change

 Function name

SND_ChgMix

 No

12

Format
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 mixer.

 one
View
table
 Title

function specification

 Function

Change mixer parameters

 Function name

SND_ChgMixPrm

 No

13

Format
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 mixer parameters.

 one
View
table
 Title

function specification

 Function

hardware check

 Function name

SND_ChkHard

 No

14

Format
SndRet SndChkHard(SndHardStat *stat, SndHardChk prm)
input
prm: hard check parameter
output
stat: hard check status
function value
Command execution status
function
Performs hardware check according to hardware parameters.

sequence


 one
View
table
 Title

function specification

 Function

Start sequence

 Function name

SND_StartSeq

 No

15

Format
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: Priority level
output
none
function value
Command execution status
function
Begins the specified sequence.

 one
View
table
 Title

function specification

 Function

Sequence abort

 Function name

SND_StopSeq

 No

16

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

 one
View
table
 Title

function specification

 Function

Sequence pause

 Function name

SND_PauseSeq

 No

17

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

 one
View
table
 Title

function specification

 Function

Cancel sequence suspension

 Function name

SND_ContSeq

 No

18

Format
SndRet SND_ContSeq(SndSeqNum seq_no)
input
seq_no: Pronunciation control number
output
none
function value
none
function
Unsuspends the specified sequence.

 one
View
table
 Title

function specification

 Function

Sequence volume setting

 Function name

SND_SetSeqVl

 No

19

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

 one
View
table
 Title

function specification

 Function

Sequence PAN settings

 Function name

SND_SetSeqPan

 No

20

Format
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 setting values
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

 one
View
table
 Title

function specification

 Function

Tempo change

 Function name

SND_ChgTempo

 No

21

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

 one
View
table
 Title

function specification

 Function

MIDI direct control

 Function name

SND_CtrlDirMidi

 No

22

Format
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: Priority 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
Directly controls MIDI according to specified parameters.

P.C.M.


 one
View
table
 Title

function specification

 Function

Start PCM

 Function name

SND_StartPcm

 No

23

Format
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 specified parameters.

 one
View
table
 Title

function specification

 Function

PCM canceled

 Function name

SND_StopPcm

 No

24

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

 one
View
table
 Title

function specification

 Function

PCM change

 Function name

SND_ChgPcm

 No

25

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

CD


 one
View
table
 Title

function specification

 Function

Start volume analysis

 Function name

SND_StartVlAnl

 No

26

Format
SndRet SND_StartVlAnl(void)
input
none
output
none
function value
Command execution status
function
Starts volume analysis. Start analyzing the volume by frequency band and the overall volume. Volume analysis continues until you execute the volume analysis stop function. If you want to analyze the volume by frequency band, please run the dedicated DSP program with effect changes before executing this function. No DSP program is required to analyze the overall volume.
remarks
While the DSP program for frequency band volume analysis is running, other DSP programs cannot be executed.

 one
View
table
 Title

function specification

 Function

Stop volume analysis

 Function name

SND_StopVlAnl

 No

27

Format
SndRet SND_StopVlAnl(void)
input
none
output
none
function value
Command execution status
function
Cancels volume analysis.

 one
View
table
 Title

function specification

 Function

CD-DA Level setting

 Function name

SND_SetCdDaLev

 No

28

Format
SndRet SND_SetCdDaLev(SndLev left, SndLev right)
input
left: Left output volume right: Right output volume
output
none
function value
Command execution status
function
Change the current stereo volume.

 one
View
table
 Title

function specification

 Function

CD-DA Pan settings

 Function name

SND_SetCdDaPan

 No

29

Format
SndRet SND_SetCdDaPan(SndPan left, SndPan right)
input
left: PAN of left output right: PAN of right output
output
none
function value
Command execution status
function
Changes the current stereo PAN.

[Status acquisition]

sequence


 one
View
table
 Title

function specification

 Function

Get sequence status

 Function name

SND_GetSeqStat

 No

30

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

 one
View
table
 Title

function specification

 Function

Obtain pronunciation management number playback position

 Function name

SND_GetSeqPlayPos

 No

31

Format
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
Gets the playback position of the specified pronunciation control number.

P.C.M.


 one
View
table
 Title

function specification

 Function

Get PCM execution address

 Function name

SND_GetPcmPlayAdr

 No

32

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

 one
View
table
 Title

function specification

 Function

Get PCM address update interrupt status

 Function name

SND_GET_INT_STAT

 No

33

Format
SndPcmIntStat SND_GET_INT_STAT(void)
input
none
output
none
function value
PCM address update interrupt status
function
Get the PCM address update interrupt status. This is valid when the interrupt source is a PCM address update interrupt. You can see which PCM playback number address has been updated.

CD


 one
View
table
 Title

function specification

 Function

Analysis overall stereo volume acquisition

 Function name

SND_GetAnlTlVl

 No

34

Format
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
Get the overall stereo analysis volume. Please execute the volume analysis start function before executing this function.
remarks
The volume is updated at 16msec intervals.

 one
View
table
 Title

function specification

 Function

Obtain stereo volume by analysis frequency band

 Function name

SND_GetAnlHzVl

 No

35

Format
void SND_GetAnlHzVl(SndCdHzSrVl *hz_vl)
input
none
output
hz_vl: Stereo analysis volume by frequency band
function value
none
function
Obtains stereo analysis volume by frequency band. Please execute the volume analysis start function before executing this function.
remarks
The volume is updated at 16msec (1/60sec) intervals.

 one
View
table
 Title

function specification

 Function

sound control settings

 Function name

SND_SET_SND_CTRL

 No

36

Format
void SND_SET_SND_CTRL(Uint8 snd_ctrl)
input
sound control value
SND_CTRL_OUTPUT_STEREO: Stereo
SND_CTRL_OUTPUT_MONO: Mono
output
none
function value
none
function
Set sound control values.
Currently, you can select and set stereo/monaural mode.
remarks

 one
View
table
 Title

function specification

 Function

Get sound control

 Function name

SND_GET_SND_CTRL

 No

37

Format
Uint8 SND_GET_SND_CTRL(void)
input
none
output
sound control value
SND_CTRL_OUTPUT_STEREO: Stereo
SND_CTRL_OUTPUT_MONO: Mono
function value
none
function
Gets the sound control value.
remarks

3D sound

 one
View
table
 Title

function specification

 Function

QSOUND parameter set

 Function name

SND_SetQSound

 No

1

Format
SndRet SND_SetQSound(Uint8 QCh, Uint8 QSt)
input
QCh: QSOUND channel to control
QSt :QSOUND PAN data (0x00~0x1e)
Meaning of setting values
left ←−− Center −−→ Right
0x00 ←−− 0x0f −−→ 0x1e 
output
none
function value
Command execution status
function
Set the stereo position of QSOUND.

 one
View
table
 Title

function specification

 Function

YAMAHA 3D parameter set

 Function name

SND_Set3D_Stat

 No

2

Format
SndRet SND_Set3D_Stat(Uint8 Y3DDst, Uint8 Y3DAzm,Uint8 Y3DElv)
input
Y3DDst: Distance (0x00~0x7f)
Y3DAzm: Direction (0x00~0x7f)
Y3DElv: Height (0x00 to 0x7f)
output
none
function value
Command execution status
function
Set the stereo position of YAMAHA 3D.

 one
View
table
 Title

function specification

 Function

YAMAHA 3D localization initialization

 Function name

SND_Set3D_Init

 No

3

Format
SndRet SND_Set3D_Init()
input
none
output
none
function value
Command execution status
function
Set the YAMAHA 3D's stereo position to the front center.

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