Japanese

ListReference

function

slBGMOn


BGM starts playing

Format

    #include "sgl.h"

    Uint16 songs;
    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 - Fade rate.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

BGM starts playing. BGM always uses pronunciation control number 0.
vol ranges from 0 to 127, and rate specifies the pitch to that vol.
If you specify 0 for rate, the volume will become that volume immediately.
If there is no space in the command buffer, return FALSE .
Returns TRUE otherwise.

example

    slBGMOn ( 0, 4, 127, 0 );

Note

The specification is to specify the priority as the second argument of this function, but currently the sound driver does not support sequence priorities.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If the sequence priority is to be controlled, it must be specified by the user application.
This function is a function that plays a song using sequence number 0. Therefore, functionally, slSoundRequest ( "bbbb", SND_SEQ_START , 0, Bank, Song, Prio ); It's no different than doing something like this.

reference

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

Sequence Start
Sequence Volume


ListReference

function

slBGMPause


BGM pose

Format

    #include "sgl.h"

    Bool slBGMPause( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Pauses the BGM playing.
If there is no space in the command buffer, the return value is FALSE , otherwise it returns TRUE .

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

Format

    #include "sgl.h"

    Bool slBGMCont( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Resumes the BGM that was paused.
If there is no space in the command buffer, the return value is FALSE , otherwise it returns TRUE .

example

    slBGMCont();

reference

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

Sequence Pause OFF


ListReference

function

slBGMOff


Canceling BGM performance

Format

    #include "sgl.h"

    Bool slBGMOff( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Stops playing BGM.
If there is no space in the command buffer, the return value is FALSE , otherwise it returns TRUE .

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 settings

Format

    #include "sgl.h"

    Uint8 vol;
    Uint8 rate;

    Bool slBGMFade( vol, rate );

argument

    Uint8 vol - maximum volume
    Uint8 rate - rate of increase in volume

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Gradually changes the BGM performance volume to the specified volume.
If you specify 0 for rate, the volume will become that volume immediately.
If there is no space in the command buffer, the return value is FALSE , otherwise it returns TRUE .

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

Format

    #include "sgl.h"

    Sint16 tempo;

    Bool slBGMTempo( tempo );

argument

    Sint16 tempo - BGM tempo

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Change the tempo of BGM. With 0 as the original tempo, if you move it up or down by 1000H, the tempo will be: It will be doubled or halved.
If you give 0, it will return to the original tempo of the song.
If there is no space in the command buffer, the return value is FALSE , otherwise it returns TRUE .

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

Format

    #include "sgl.h"

    Bool slBGMStat( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Checks whether BGM is playing and returns a flag.
Returns TRUE if it is playing (even during pause), and FALSE if it is 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

Format

    #include "sgl.h"

    Uint16 songs;
    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

Return number

    Uint8 - Reserved sequence number

function

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

example

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

Note

If PAN is set in the sequence data, that setting takes precedence over the function argument. If such data is forced by the program, If you want to change the PAN, execute the slSequencePan function after the slSequenceOn function.
The specification is to specify the priority as the second argument of this function, but currently the sound driver does not support sequence priorities.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If the sequence priority is to be controlled, it must be specified by the user application.

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


Stopping sequence playback

Format

    #include "sgl.h"

    Uint8seq ;

    Bool slSequenceOff( seq );

argument

    Uint8 seq - Sequence number.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Stops playing the specified sound effect.
Returns TRUE if successful, FALSE if unsuccessful.

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

Format

    #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 - Rate of change in volume

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Controls the volume of the specified sound effect.
Specify the pronunciation control number, volume, and pitch.
Returns TRUE if successful, FALSE if unsuccessful.

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


Setting the sequence tempo

Format

    #include "sgl.h"

    Uint8 seq;
    Uint16 tempo;

    Bool slSequenceTempo( seq, tempo );

argument

    Uint8 seq - pronunciation management number
    Uint16 tempo - tempo

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Changes the tempo of the specified sound effect. With 0 as the original tempo, If you go up or down 1000H, the tempo specifies the pronunciation control number and tempo.
Returns TRUE if successful, FALSE if unsuccessful.

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


Pausing sequence play

Format

    #include "sgl.h"

    Uint8seq ;

    Bool slSequencePause( seq );

argument

    Uint8 seq - pronunciation control number.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Pauses the specified sound effect.
Returns TRUE if successful, FALSE if unsuccessful.

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 play

Format

    #include "sgl.h"

    Uint8 seq;

    Bool slSequenceCont( seq );

argument

    Uint8 seq - pronunciation control number.

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Resumes the sound effect that was paused.
Returns TRUE if successful, FALSE if unsuccessful.

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

Format

    #include "sgl.h"

    Uint8 seq;
    Uint8 pan;

argument

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

Return number

    Bool - Flag indicating 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) (lower 3 bits are invalid).
If -128 is specified, the pan setting is ignored.
Returns TRUE if successful, FALSE if unsuccessful.

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


Initializing the sequence playing state

Format

    #include "sgl.h"

    Uint8seq ;

    Bool slSequenceReset( seq );

argument

    Uint8 seq - pronunciation control number

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Initializes the volume, tempo, and pan of the specified note number.
Volume is maximum, tempo is normal, and pan is uncontrolled.
Returns TRUE if successful, FALSE if unsuccessful.

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


Investigating the performance status of a sequence

Format

    #include "sgl.h"

    Uint8seq ;

    Bool slSequenceStat( seq );

argument

    Uint8 seq - sequence number

Return number

    Bool - Flag indicating whether the command was issued correctly.

function

Checks whether the sequence with the specified pronunciation number is being played and returns a flag.
Returns TRUE if it is playing (even during pause), and FALSE if it is 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

Format

    #include "sgl.h"

    Uint8 map;

    void *slSndMapChange( map );

argument

    Uint8 map - map number.

Return number

    void* - Address of the current sound map.

function

Change the current sound map.
After transferring the sound data, set the transferred bit in the work area.
The return value is the address of the command buffer where the parameters were set.
Returns NULL if there is no space in the command buffer.

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 change */
      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 available pronunciation management numbers

Format

    #include "sgl.h"

    Uint8 slSndSeqNum( void );

argument

    void - gives nothing.

Return number

    Uint8 - Vacant pronunciation management number

function

    Returns a free pronunciation management number.
0 is returned if there is no space, and 1 to 7 is returned if the process completes normally.

example

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

reference

 slSequenceOn
 slSequenceOff
 slSequenceFade
 slSequenceTempo
 slSequencePause
 slSequenceCont
 slSequencePan
 slSequenceReset
 slSequenceStat

return
Copyright SEGA ENTERPRISES, LTD., 1997