ListReference

function

slBGMOn


Start playing BGM

Form

    #include "sgl.h"

    Uint16 song;
    Uint8 prio;
    Uint8 vol;
    Uint8 rate;

    Bool slBGMOn (song, prio, vol, rate);

argument

    Uint16 song --Song number.
Uint8 prio --Priority.
Uint8 vol --Volume.
Uint8 rate-Percentage of fades.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Start playing BGM. BGM always uses pronunciation control number 0.
vol specifies the range from 0 to 127, and rate specifies the pitch to that vol.
As soon as you specify 0 for rate, it will be at that volume.
If the command buffer is full, FALSE is returned as the return value.
Otherwise, it returns TRUE.

Example

    slBGMOn (0, 4, 127, 0);

caution


    Although it is a specification to specify the priority in the second argument of this function, the sound driver does not currently support the priority of the sequence.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If you want to control the priority of the sequence, you need to specify it on the user application side.
This function is a function that plays a song using sequence 0. Therefore, functionally slSoundRequest ("bbbb", SND_SEQ_START , 0, Bank, Song, Prio); It is no different from saying that.

reference

 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Sequence Start
Sequence Volume


ListReference

function

slBGMPause


BGM pose

Form

    #include "sgl.h"

    Bool slBGMPause (void);

argument

    void --Do not give anything.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Pauses the BGM performance.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.

Example

    slBGMPause (3);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Sequence Pause


ListReference

function

slBGMCont


Resume from BGM pause state

Form

    #include "sgl.h"

    Bool slBGMCont (void);

argument

    void --Do not give anything.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Resumes the paused BGM.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.

Example

    slBGMCont ();

reference

 slBGMOn
 slBGMPause
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Sequence Pause OFF


ListReference

function

slBGMOff


Cancellation of BGM performance

Form

    #include "sgl.h"

    Bool slBGMOff (void);

argument

    void --Do not give anything.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Stops playing BGM.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.

Example

    slBGMOff ();

reference

 slBGMOn
 slBGMPause
 slBGMCont
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Sequence Stop


ListReference

function

slBGMFade


BGM fade setting

Form

    #include "sgl.h"

    Uint8 vol;
    Uint8 rate;

    Bool slBGMFade (vol, rate);

argument

    Uint8 vol --Maximum volume Uint8 rate --Volume increase rate

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Gradually changes the playing volume of BGM to the specified size.
As soon as you specify 0 for rate, it will be at that volume.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.

Example

    slBGMFade (127, 4);

reference

 slBGMOn
 slBGMPause
 slBGMCont
 slBGMOff
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Sequence Volume


ListReference

function

slBGMTempo


BGM tempo change

Form

    #include "sgl.h"

    Sint16 tempo;

    Bool slBGMTempo (tempo);

argument

    Sint16 tempo --BGM tempo

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Change the tempo of BGM. With 0 as the original tempo, if you go up or down 1000H, the tempo will be
    It will be doubled or halved.
If you give 0, the tempo will return to the original tempo of the song.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.

Example

    slBGMTempo (-50);

reference

 slBGMOn
 slBGMPause
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

Tempo Change


ListReference

function

slBGMStat


Investigation of BGM playback status

Form

    #include "sgl.h"

    Bool slBGMStat (void);

argument

    void --Do not give anything.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Checks if BGM is playing and returns a flag.
TRUE is returned when playing (even during pause), and FALSE is returned when stopped.

Example

    if ( slBGMStat () == TRUE ) {
      / * Playing * /
    } else {
      / * End of playback * /
    }

reference

 slBGMOn
 slBGMPause
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat 



ListReference

function

slSequenceOn


Start playing the sequence

Form

    #include "sgl.h"

    Uint16 song;
    Uint8 prio;
    Uint8 vol;
    Sint8 pan;

    Uint8 slSequenceOn (song, prio, vol, pan);

argument

    Uint16 song --Song number Uint8 prio --Priority Uint8 vol --Volume Sint8 pan --Pan

Number of returns

    Uint8 --Reserved sequence number

function

    Plays the sound effect from the specified direction (Pan).
vol is specified in the range of 0 to 127, and pan is specified in the range of (left -127 to 0 to +127 right) (however, since Pan has 32 steps on the hardware, the lower 3 bits are invalid). If you specify -128, the Pan setting is ignored.
If there is no free space in the command buffer and pronunciation management buffer, FALSE is returned.
In case of normal termination, the pronunciation control number is returned.

Example

    slSequenceOn (bank << 8 | song, 5, 127, 0);

caution


    If PAN is set in the sequence data, that will take precedence over the function arguments. If such data is forced on the program side,
    To make PAN changes, execute the slSequencePan function after the slSequenceOn function.
Although it is a specification to specify the priority in the second argument of this function, the sound driver does not currently support the priority of the sequence.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If you want to control the priority of the sequence, you need to specify it on the user application side.

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Start
Sequence Volume
Sequence Pan


ListReference

function

slSequenceOff


Stop playing the sequence

Form

    #include "sgl.h"

    Uint8 seq;

    Bool slSequenceOff (seq);

argument

    Uint8 seq --Sequence number.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Stops playing the specified sound effect.
Returns TRUE on success and FALSE on failure.

Example

    slSequenceOff (3);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Stop


ListReference

function

slSequenceFade


Sequence fade settings

Form

    #include "sgl.h"

    Uint8 seq;
    Uint8 vol;
    Uint8 rate;

    Bool slSequenceFade (seq, vol, rate);

argument

    Uint8 seq --Pronunciation control number Uint8 vol --Maximum volume Uint8 rate --Ratio of volume change

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Volume control is performed for the specified sound effect.
Specify the pronunciation control number, volume, and pitch.
Returns TRUE on success and FALSE on failure.

Example

    slSequenceFade (5, 120, 3);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Volume


ListReference

function

slSequenceTempo


Sequence tempo setting

Form

    #include "sgl.h"

    Uint8 seq;
    Uint16 tempo;

    Bool slSequenceTempo (seq, tempo);

argument

    Uint8 seq --Pronunciation control number Uint16 tempo --Tempo

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Changes the tempo for the specified sound effect. With 0 as the original tempo
    When you move up or down 1000H, the tempo specifies the pronunciation control number and tempo.
Returns TRUE on success and FALSE on failure.

Example

    slSequenceTempo (4, 100);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Tempo Change


ListReference

function

slSequencePause


Pause sequence performance

Form

    #include "sgl.h"

    Uint8 seq;

    Bool slSequencePause (seq);

argument

    Uint8 seq-Pronunciation control number.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Pauses the performance of the specified sound effect.
Returns TRUE on success and FALSE on failure.

Example

    slSequencePause (2);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Pause


ListReference

function

slSequenceCont


Resume sequence performance

Form

    #include "sgl.h"

    Uint8 seq;

    Bool slSequenceCont (seq);

argument

    Uint8 seq-Pronunciation control number.

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Resume the paused sound effect.
Returns TRUE on success and FALSE on failure.

Example

    slSequenceCont (6);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequenceFade
 slSequencePan
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Pause OFF


ListReference

function

slSequencePan


Sequence pan settings

Form

    #include "sgl.h"

    Uint8 seq;
    Uint8 pan;

argument

    Uint8 seq --Pronunciation control number Uint8 pan --Pan Bool slSequencePan (seq, pan);

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Specifies the direction of the sound effect.
Specify pan in the range (left -127 to 0 to +127 right) (the lower 3 bits are invalid).
If you specify -128, the pan setting is ignored.
Returns TRUE on success and FALSE on failure.

Example

    slSequencePan (5, 65);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequenceFade
 slSequenceCont
 slSequenceReset
 slSequenceStat
 slSndFlush

Sequence Pan


ListReference

function

slSequenceReset


Initialization of sequence playing state

Form

    #include "sgl.h"

    Uint8 seq;

    Bool slSequenceReset (seq);

argument

    Uint8 seq --Pronunciation control number

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Initializes the volume, tempo, and Pan of the specified pronunciation number.
Volume is maximum, tempo is usually uncontrolled by Pan.
Returns TRUE on success and FALSE on failure.

Example

    slSequenceReset (5);

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequenceFade
 slSequenceCont
 slSequencePan
 slSequenceStat
 slSndFlush

Sequence Volume
Tempo Change
Sequence Pan


ListReference

function

slSequenceStat


Investigation of the playing state of the sequence

Form

    #include "sgl.h"

    Uint8 seq;

    Bool slSequenceStat (seq);

argument

    Uint8 seq --Sequence number

Number of returns

    Bool- A flag that indicates whether the command was issued correctly.

function

    Checks if the specified sequence of pronunciation numbers is playing and returns a flag.
TRUE is returned when playing (even during pause), and FALSE is returned when stopped.

Example

    if ( slSequenceStat (4) == TRUE ) {
      / * Playing * /
    } else {
      / * End of playback * /
    }

reference

 slBGMOn
 slBGMCont
 slBGMOff
 slBGMFade
 slBGMTempo
 slBGMStat
 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequenceFade
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSndFlush 



ListReference

function

slSndMapChange


Map change

Form

    #include "sgl.h"

    Uint8 map;

    void * slSndMapChange (map);

argument

    Uint8 map --Map number.

Number of returns

    void * --The address of the current soundmap.

function

    Change the current soundmap.
After transferring the sound data, set the transferred bits in the work area.
The return value is the address of the command buffer in which the parameters are set.
Returns NULL if the command buffer is full.

Example

    typedef struct sndmap {
      Sint8 ID;
      Sint8 ST_Addr [3];
      Sint8 LdFlag;
      Sint8 AR_Size [3];
    } SOUNDMAP;

    void init_sound () {
      SOUNDMAP * smptrs, * smptrd;

      / * Wait for the current map to switch * /
      slWaitSound ( slSndMapChange (1));
      smptrs = (SOUNDMAP *) soundmap;
      smptrd = (SOUNDMAP *) SoundCTRL;
      while (smptrs-> ID> = 0) {
        smptrd-> LdFlag = -1; / * Map Load Flag * /
        smptrs ++;
        smptrd ++;
      }
      slDMACopy (sounddat, (void *) (SoundSeqBuf), sizeof (sounddat));
    }

reference

 slWaitSound
 slSndFlush
 SoundRdCount

Sound Map Change


ListReference

function

slSndSeqNum


Check the available pronunciation control number

Form

    #include "sgl.h"

    Uint8 slSndSeqNum (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Available pronunciation control number

function

    Returns a free pronunciation control number.
If there is no space, 0 is returned, and if it ends normally, 1 to 7 are returned.

Example

    if ( slSndSeqNum ()> 0) {
      slSequenceOn (...
    } 

reference

 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

return
Copyright SEGA ENTERPRISES, LTD., 1997