CALL SET PCM
This page was last modified 11:13, 16 September 2019 by Mars2000you.

Contents

Effect

Initialises an ADPCM/PCM file to be used as sound instrument (voice).

Syntax

CALL SET PCM(<voice file>,<device>,<mode>,<specific parameter>,<length>[,<sampling frequency>][,<channel>])

Parameters

<voice file> is a number between 0 and 15, that specifies the ADPCM/PCM file. This number is also used in the following instructions: CALL CONVA - CALL CONVP - CALL COPY PCM - CALL LOAD PCM - CALL MK PCM - CALL PLAY PCM - CALL REC PCM - CALL SAVE PCM.

<device> is a number between 0 and 5, that specifies the location of the ADPCM/PCM file.

According the used device, the three next parameters can vary (and sometimes are not used).

Device Name Mode Specific parameter Length
0 Sample RAM of first MSX-AUDIO chip 0 or 1 not used used
1 Sample ROM of first MSX-AUDIO chip not used ROM audio file number used
2 Sample RAM of second MSX-AUDIO chip 0 or 1 not used used
3 Sample ROM of second MSX-AUDIO chip not used ROM audio file number used
4 Computer RAM 0 or 1 Array name not used
5 Computer VRAM 0 or 1 Address used


<mode> specifies the PCM mode (it is not used for files in Sample ROM as all these files have a built-in mode parameter):

  • 0 = ADPCM
  • 1 = PCM

<specific parameter> is not used for files in Sample RAM. Otherwise, it specifies the ROM audio file number (between 0 and 29) when Sample ROM is used, the array name for files in computer RAM or the address for files in computer VRAM.

<length> is not used for files in computer RAM. The unit of length is 256 bytes.

<sampling frequency> is exprimed in Hz and can vary from 1800 to 16000. The default value is 8000 Hz.

<channel> specifies the MSX-AUDIO channel for recording and playback:

  • 0 = channel of first MSX-AUDIO chip
  • 1 = channel of second MSX-AUDIO chip

When omitted, the device is not connected if you use device 0 to 3. For files in computer RAM or VRAM, channel 0 is used by default.

Note: after initialisation with CALL AUDIO, audio file number 0 is assigned to the Sample RAM of the first MSX-AUDIO chip and the other audio files have a length of 0. It is equivalent to CALL SET PCM(0,0,0,,128)

Example

CALL SET PCM(0,0,0,,32)

Related to

CALL AUDIO, CALL CONVA, CALL CONVP, CALL COPY PCM, CALL LOAD PCM, CALL MK PCM, CALL PLAY PCM, CALL REC PCM, CALL SAVE PCM

Compatibility

MSX-AUDIO BASIC