Category:MSX-AUDIO BASIC
This page was last modified 13:42, 2 June 2023 by Mars2000you. Based on work by Takamichi and Gdx and others.

Contents

Description

MSX-AUDIO BASIC is a BASIC extension that is only included on the complete MSX-AUDIO cartridge, the Panasonic FS-CA1.

However, it is possible to upgrade the other MSX-AUDIO cartridges: Philips NMS 1205 (Music Module) and Toshiba HX-MU900 (FM-Synthesizer Unit).

Notes :

  • The extra instructions linked to any built-in software (CALL MUSICBOX, CALL SYN) are not part of the MSX-AUDIO BASIC instructions.

Stricto sensu, it should also be the case of CALL SYNTHE, as this instruction is not compatible with CALL AUDIO that is required to initialize the MSX-AUDIO system and use MSX-AUDIO BASIC. In a similar way to CALL FMPAC on the FM-PAC cartridge, it launches a built-in software and you can't use MSX-AUDIO BASIC (or MSX-MUSIC BASIC) inside the launched application.

However, the MSX-AUDIO standard specifies that this instruction must always be present in a complete MSX-AUDIO cartridge, to allow the launching of an MSX-AUDIO application and each manufacturer can include any MSX-AUDIO application. Only Panasonic did that by including a modified version of an application created by Toshiba. Theoretically, it would be possible to replace this application by another MSX-AUDIO application, that would be launched by CALL SYNTHE.

This hybrid situation explains why CALL SYNTHE is mentioned in the tables below, but when you use MSX-AUDIO BASIC in your own programs, you will actually never use this instruction.

  • MSX-AUDIO BASIC was initially planned to also be used for MIDI, but this was not realised until MSX-MIDI was finally supported on MSX turbo R machines by an updated version of MSX-MUSIC BASIC, also named MSX-MIDI BASIC.

Instructions (general info)

MSX-AUDIO BASIC extends the PLAY instruction and adds 37 new instructions, that can be generally divided into four types.

Notes:

  • CALL can be replaced by the character underscore (_). A space is not required after this character. See CALL for more info.
  • With exception for CALL APEEK, CALL APOKE and CALL AUDIO, all the general MSX-AUDIO BASIC instructions are also used by MSX-MUSIC BASIC, sometimes they work a little differently. CALL AUDIO is replaced by CALL MUSIC in MSX-MUSIC BASIC.
  • In version 1.3 of the MSX-AUDIO BIOS, CALL MUSIC can also initialize MSX-AUDIO.
  • All these instructions are designed for the standard MSX1 to MSX2+.

Instructions (ordered per category)

ADPCM/PCM

Instruction Effect
CALL CONVA Converts a PCM file into an ADPCM file
CALL CONVP Converts a ADPCM file into an PCM file
CALL COPY PCM Copies part or entirety of an ADPCM/PCM file into another file
CALL LOAD PCM Loads an ADPCM/PCM file from disk, while keeping original audio format and sampling frequency
CALL PCM FREQ Sets the sampling frequency to play an ADPCM file in local mode, using Sample RAM/ROM
CALL PCM VOL Sets the volume to play an ADPCM/PCM file
CALL PLAY PCM Plays an ADPCM/PCM audio file
CALL REC PCM Records an ADPCM/PCM audio file
CALL SAVE PCM Saves an ADPCM/PCM file to disk
CALL SET PCM Initializes an ADPCM/PCM file to be used as sound instrument (voice)


MSX-AUDIO Initialization

Instruction Effect
CALL AUDIO Initializes MSX-AUDIO/PCM by selecting mode and channels


MSX-AUDIO Performing

Instruction Effect
CALL BGM Specifies whether to perform MSX-AUDIO/PCM/PSG music in the background
Extended to some cases of recording and playback of ADPCM or Music Keyboard record
CALL PLAY Checks if music is being played via the channels activated by CALL AUDIO and/or the PSG channels
CALL STOPM Stops background operations: performing of a MSX-AUDIO/PCM/PSG music, ADPCM
recording using external memory, playback, recording and reproduction by Music Keyboard


MSX-AUDIO Settings

Instruction Effect
CALL AUDREG Writes a value directly to a register of the sound chip
CALL PITCH Specifies the pitch of the FM melody sounds generated by the FM generator(s)
CALL TEMPER Sets the temperament for the FM sound
CALL TRANSPOSE Transposes in units of half tones the FM sounds (melody + rhythm) from the FM generator(s)
CALL VOICE Sets a sound timbre (voice) for each channel of the FM tone generator
CALL VOICE COPY Copies the sound timbre (voice) parameter data


MSX-AUDIO System

Instruction Effect
CALL SYNTHE Executes the MSX-AUDIO internal application (firmware)


Music Keyboard Performing

Instruction Effect
CALL APPEND MK Appends an additional recording from Music Keyboard to an existing recording
CALL CONT MK Resumes a playback/recording by the Music Keyboard that was stopped by CALL STOPM
CALL MK STAT Returns the status of Music Keyboard for recording
CALL PLAY MK Plays music from Music Keyboard after saving in an array or loading from computer RAM
CALL REC MK Records music from Music Keyboard in an array or a specific area of the computer RAM
CALL RECMOD Sets the recording mode from the Music Keyboard


Music Keyboard Settings

Instruction Effect
CALL INMK Returns changes for Music Keyboard, stored in the key buffer
CALL KEY OFF Disables a key of the MSX keyboard as instrument (*)
CALL KEY ON Sets a key of the MSX keyboard as instrument (*)
CALL MK PCM Specifies the ADPCM file to be used as instrument (voice) for the Music Keyboard
CALL MK TEMPO Sets the speed of the MK metronome function for performance, recording and playback
CALL MK VEL Sets the velocity for the sound (voice) from the Music Keyboard and initializes it
CALL MK VOICE Sets the sound timbre (voice) for the Music Keyboard
CALL MK VOL Sets the volume for the sound (voice) from the Music Keyboard

(*) A Music Keyboard can be simulated this way on the MSX keyboard

Sample RAM Access

Instruction Effect
CALL APEEK Returns the value read from a byte of the MSX-AUDIO Sample RAM
CALL APOKE Writes a value to a byte of the MSX-AUDIO Sample RAM


Instructions (alphabetical order)

Instruction Generation Type
CALL APEEK MSX1 Sample RAM Access
CALL APOKE MSX1 Sample RAM Access
CALL APPEND MK MSX1 Music Keyboard Performing
CALL AUDIO MSX1 MSX-AUDIO Initialisation
CALL AUDREG MSX1 MSX-AUDIO Settings
CALL BGM MSX1 MSX-AUDIO Performing
CALL CONT MK MSX1 Music Keyboard Performing
CALL CONVA MSX1 ADPCM/PCM
CALL CONVP MSX1 ADPCM/PCM
CALL COPY PCM MSX1 ADPCM/PCM
CALL INMK MSX1 Music Keyboard Settings
CALL KEY OFF MSX1 Music Keyboard Settings
CALL KEY ON MSX1 Music Keyboard Settings
CALL LOAD PCM MSX1 ADPCM/PCM
CALL MK PCM MSX1 Music Keyboard Settings
CALL MK STAT MSX1 Music Keyboard Performing
CALL MK TEMPO MSX1 Music Keyboard Settings
CALL MK VEL MSX1 Music Keyboard Settings
CALL MK VOICE MSX1 Music Keyboard Settings
CALL MK VOL MSX1 Music Keyboard Settings
CALL PCM FREQ MSX1 ADPCM/PCM
CALL PCM VOL MSX1 ADPCM/PCM
CALL PITCH MSX1 MSX-AUDIO Settings
CALL PLAY MSX1 MSX-AUDIO Performing
CALL PLAY MK MSX1 Music Keyboard Performing
CALL PLAY PCM MSX1 ADPCM/PCM
CALL REC MK MSX1 Music Keyboard Performing
CALL RECMOD MSX1 Music Keyboard Performing
CALL REC PCM MSX1 ADPCM/PCM
CALL SAVE PCM MSX1 ADPCM/PCM
CALL SET PCM MSX1 ADPCM/PCM
CALL STOPM MSX1 MSX-AUDIO Settings
CALL SYNTHE MSX1 MSX-AUDIO System
CALL TEMPER MSX1 MSX-AUDIO Settings
CALL TRANSPOSE MSX1 MSX-AUDIO Settings
CALL VOICE MSX1 MSX-AUDIO Settings
CALL VOICE COPY MSX1 MSX-AUDIO Settings


Links