CALL AUDIO
This page was last modified 17:07, 6 November 2019 by Mars2000you.

Contents

Effect

Initializes MSX-AUDIO/PCM by selecting mode and channels.

This instruction must be used first.

Note: when CALL AUDIO is executed, it wil link the system interruptions hooks to MSX-AUDIO, clear all variables and secure the work area by decreasing in size the memory space available for MSX-BASIC. Using the Music Keyboard has also an effect on the MSX-BASIC memory space.

Syntax

CALL AUDIO (<mode>,<channels with instrument>,<channels PLAY string 1>,<channels PLAY string 2>, ...,<channels PLAY string 9>)

Parameters

<mode> is a number that defines the mode used by MSX-AUDIO

Mode FM melody PCM FM rhythm Type
0 9 channels - - Normal
1 (default value) 6 channels - 3 channels Normal
2 9 channels 1 channel - Normal
3 6 channels 1 channel 3 channels Normal
4 9 channels - - CSM (*)
5 6 channels - 3 channels CSM (*)
6 9 channels 1 channel - CSM (*)
7 6 channels 1 channel 3 channels CSM (*)

(*) In CSM mode, the control of all the FM sounds (melody and rhythm) becomes invalid. CSM stands for Composite Sinusoidal Modeling. Using all operators in parallel, this mode can be used to synthesize speech.

<channels with instrument> is a number to define how many channels are assigned to an instrument.

<channels PLAY string> for each string related to FM melody in the PLAY instruction allows to specify how many channels are used for this string.

The number of FM melody channels used in a PLAY sentence needs to be

  • 9 or less when not using rhythm
  • 6 or less when rhythm is used

If you use CALL AUDIO without parameter, MSX-AUDIO/PCM will be initialized as with CALL AUDIO(1,0,2,2,2), what means
- mode 1 = maximum 6 FM melody channels + 3 FM rhythm channels
- channels are not assigned to an instrument
- 2 channels for PLAY string 1
- 2 channels for PLAY string 2
- 2 channels for PLAY string 3
- no PLAY string for PCM (will be replaced by a comma)
- PLAY string 4 will be used for FM rhythm
- PLAY strings 5 to 7 will eventually be used for the 3 PSG channels
- CSM mode is not used

Examples

10 ' MSX-AUDIO in mode 0 - 1 channel for each PLAY string (1 to 9)
20 ' All channels are assigned to an instument, no PCM, normal mode
30 CALL AUDIO(0,9,1,1,1,1,1,1,1,1,1)
10 ' MSX-MUSIC in mode 3 - 2 channels for PLAY string 1
20 ' 1 channel for PLAY string 2, 3 channels for PLAY string 3
30 ' Channels not assigned to an instrument, PCM, normal mode
40 CALL AUDIO(3,0,2,1,3)

MSX-AUDIO and MSX-MUSIC

When a MSX system is equipped with both sound chips, the general rule is: CALL AUDIO will initialize MSX-AUDIO and CALL MUSIC will initialize MSX-MUSIC.

However, version 1.3 of the MSX-AUDIO BIOS allows to use CALL MUSIC to initialize MSX-AUDIO instead of CALL AUDIO. This way, it is no longer required to modify the beginning of a BASIC listing.

An utility (OPLLOFF) allows to temporary disable the internal MSX-MUSIC chip of the Panasonic MSX2+ and Turbo R computers; this utility is not required for Sanyo and Sony MSX2+ machines with built-in MSX-MUSIC chip, because this chip is in slot 3-3 and CALL MUSIC will initialize the MSX-AUDIO chip found in a lower slot.

Reference: FRS MSX Page - Tools.

Related to

CALL MUSIC, PLAY

Compatibility

MSX-AUDIO BASIC