FAQSGL programming related
BackForward
FAQ / SGL programming related

sound



I want to set stereo / monaural for CDDA.

Q)
About stereo / monaural settings in SGL

A)
Make the stereo / monaural settings for SGL CD-DA and sequence data as follows.

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

    slCDDAOn function → SGL reference manual

    However, in order to execute this function, it is necessary to execute the slInitSound function in advance.
    If the slSynch function is executed in the loop of the main program, it is possible to switch between stereo and monaural with the above function even during CD-DA playback.

  2. When changing the sequence data Change the stereo / monaural bit of the sound driver.
    Be sure to make this setting after setting 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 sounds in PCM.

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

A)
SGL's slPCMOn function can certainly play up to 4 notes, but the maximum number of notes will vary depending on the type of PCM you are trying to play.
To give an example

STEREO
 16 Bit
1 sound 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 will be.
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 reproduce 1 to 4 PCM data.


Effect-related function parameters

Q)
I don't understand how to use the following functions, and the effects are not working.
Where are the values derived from each argument of the function below?
Would you please provide me with 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 setting contents of these effect-related parameters are processed by receiving information from the sound data production side.
Now, let's take a brief explanation using the case of actually playing the 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, the "effect number" specified by "slSndEffect (Effect)". If there is one effect, always specify "0". If there are multiple effects, specify "1" from the above map information if you want to apply the above reverb. To do.

  2. Next, determine the target to apply the effect with "slSndMixChange (Tbank, Mixno)". If you want to apply an effect to BGM, specify 0 for "Tone bank number". 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 received from the production side.

  3. Finally, "slSndMixParmChange (Effect, Level, Pan)" is used when you want to change the effect effect from the default setting 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" (also get the channel allocation information from the production side) and lower the "effect return level".

  4. "slDSPOff ()" issues an instruction to stop and initialize the sound DSP itself, and is a function that must be performed for sound initialization and termination when dealing with effects.

Unfortunately, there is no SGL sample program that deals with effects yet.


How to set mixer parameters in SGL

Q)
How can SGL realize the sound data of R = 15 with the parameters of the mixer on the actual program? Should I ignore the lower 3 bits in the PAN parameter?

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


BackForward
FAQSGL programming related
Copyright SEGA ENTERPRISES, LTD ,. 1997