CALL MGSND
This page was last modified 14:09, 17 May 2020 by Mars2000you.

Contents

Effect

Makes a special effect, stops or restarts the current played background music or sound effect from a file in Compile format.

Syntax

CALL MGSND (<Action>,<EffectType>,<EffectSpeed>)

The two last parameters are optional. Parameters can not end with a comma alone.

Parameters

<Action> is a number between 4 and 6:

  • 4 = effect, needs to be completed with the two other parameters to be effective
  • 5 = stop
  • 6 = re-start (after having used the value 5)

Note: With value 5, the PSG initialisation is modified, you need to use _MGSND(6) or CALL PSGINT to re-initialise it.

<EffectType> is a number between 0 and 255, recommended value is 128 (&H80) for a nice fade-out without alterations (very small values are without any effect).

<EffectSpeed> is a number between 0 and 255, 0 is without any effect, recommended values are between 4 and 32.

Example

10 BLOAD"MUSIC.OBJ",R
20 _PSGINT: _SOUT(2,0)
30 A$=INPUT$(1)
40 _MGSND(4,128,4)

Related to

CALL CLRSD, CALL PSGINT, CALL SOUT

Compatibility

CompileBGM BASIC