Japanese
FAQSGL programming related
BackForward
FAQ/SGL programming related

sound



I want to set stereo/monaural to CDDA.

Q)
About stereo/mono settings in SGL

A)
Perform stereo/monaural settings for SGL's CD-DA and sequence data as follows.

  1. CD-DA stereo/mono switching
    • For stereo: Set the left and right pan of the slCDDAOn function to
      slCDDAOn( .. , .. , -127, 127 );
      and set.
    • For monaural: Pan left and right of the slCDDAOn function.
      slCDDAOn( .. , .. , 0, 0 );
      and set.

    slCDDAOn function → SGL Reference Manual

    However, in order to execute this function, you must first execute the slInitSound function.
    If you execute the slSynch function in the main program loop, you can use the above function to switch between stereo and monaural while playing a CD-DA.

  2. For changing sequence data

  3. Change the stereo/mono bits of the sound driver.
    Be sure to perform this setting after configuring the sound driver.

    (example)

    Uint8 sndctrl;
    sndctrl = (*((volatile Uint8 *)(0x25a00483)));
    sndctrl &= 0x7f;
    if (stereo) {
       sndctrl |= 0x80;
    }
    (*((volatile Uint8 *)(0x25a00483))) = (Uint8)sndctrl;
    


I want to play 4-tone PCM.

Q)
In the SGL PCM playback sample (sampsnd2), the PCM that should actually produce 4 sounds only produces at most 2 sounds.Why is that?

A)
It is true that SGL's slPCMOn function can play up to four notes, but the maximum number of notes varies depending on the type of PCM you are trying to play.
To give an example

STEREO
 16 Bit
1 note Number of sound sources used: 4
STEREO
 8 Bit
2 sounds Number of sound sources used: 2
MONORAL
 16 Bit
2 sounds Number of sound sources used: 2
MONORAL
 8 Bit
4 sounds Number of sound sources used: 1

It becomes.
If the number of sound sources used exceeds 4, slPCMOn returns error status -2 (channel over).
Therefore, by combining the types of PCM sounds described above, it is possible to play PCM data of 1 to 4 sounds.


Effect-related function parameters

Q)
I don't really understand how to use the functions below, so the effects aren't going well.
Where are the values derived from each argument of the function below?
Could you please provide a sample?

slSndEffect(Effect)
Effect: Effect number

slSndMixChange(Tbank,Mixno)
Tbank: Tone bank number
Mixno: Mixer number

slSndMixParmChange(Effect,Level,Pan)
Effect: Effect output channel
Level: Effect return level
Pan: Effect pan

slDSPOff()

A)
In conclusion, the settings for these effect-related parameters are processed by receiving information from the sound data production side.
Let's briefly explain how to play sound data created with the following map configuration as an example.

---------------------------------------
BGM song data   : Sequence data 0
SE song data    : Sequence data 1
BGM tone data   : Tone bank data 0
SE tone data    : Tone bank data 1
Delay effect    : DSP program 0
Reverb effect   : DSP program 1
                : DSP work area
---------------------------------------

  1. First, for the "effect number" specified with "slSndEffect(Effect)", if there is only one effect, always specify "0", and if there are multiple effects, if you want to apply the above reverb, specify "1" from the above map information. To do.

  2. Next, use "slSndMixChange(Tbank,Mixno)" to determine the target to apply the effect to. If you want to apply an effect to the BGM, specify 0 for "Tone bank number". Also, if there are multiple mixers that specify the return level and pan from the effect, set the ``mixer number'' of the parameter you want to use. The details of this mixer are also information that we receive from the production side.

  3. Finally, "slSndMixParmChange(Effect,Level,Pan)" is used when you want to change the effect effect from the initial settings on the program side. For example, if you want to reduce the reverb effect, specify the effect you want to change in the ``DSP Effect Output Channel'' (again, get channel allocation information from the production side) and lower the ``Effect Return Level.''

  4. "slDSPOff()" issues a command to stop and initialize the sound DSP itself, and is a function that must be executed for sound initialization and termination processing when working with effects.

Unfortunately, there are no SGL sample programs that handle effects yet.


How to set mixer parameters in SGL

Q)
What should I do in SGL to achieve R=15 sound data using mixer parameters in an actual program? Should I ignore the lower 3 bits of the PAN parameter?

A)
R=15 is 127 in terms of the argument of the slSndMixParmChange() function.
This value is shifted 3 bits to the right to specify 23 levels of effect output PAN.
The argument actually passed to the sound control command is 0F in hexadecimal.


BackForward
FAQSGL programming related
Copyright SEGA ENTERPRISES, LTD. 1997