CALL VOICE
This page was last modified 15:24, 17 May 2020 by Mars2000you. Based on work by Gdx and NYYRIKKI.

This instruction is available in MSX-AUDIO Basic and MSX-MUSIC Basic.

Contents

Effect

Directly sets a sound timbre (voice) for each channel of the FM tone generator. Sounds are selectable among 64 presets in Rom or by the user using an array variable.

Notes:

  • With MSX-MUSIC, you can not play multiple sounds defined with variable arrays
  • This instruction can't be used with MSX-MIDI, you need to use the @<voice> MML instruction of PLAY

Syntaxes

  • CALL VOICE (@<VoiceForChannel1>,@<VoiceForChannel2>,...,@<VoiceForChannel9>)
  • CALL VOICE (<ArrayForChannel1>,<ArrayForChannel2>,...,<ArrayForChannel9>)

A mix of both syntaxes is also possible, so it means that you can use @voice for some channels, an array for other channels. However, there are limitations with MSX-MUSIC.

Parameters

<VoiceForChannel> Is always preceded by @ (see below Voice Data Table). Each voice corresponds to an instrument defined by FM sound chip internal parameters (hardware) or generated from external parameters (software).

<ArrayForChannel> must be a numeric type variable array that can hold minimum of 32 bytes of RAW byte data (see below Voice Array Format). Using arrays enables creation of new instruments (only one in MSX-MUSIC, 32 in MSX-AUDIO). The value of the array can also be defined with CALL VOICE COPY.

When using MSX-MUSIC, values without * mark (voices generated by software) and array values are limited to 2 when used together:

  • if an array value is already used, only the last specified soft-value will be enabled
  • if a soft-value is already used, only the last specified array value will be enabled

Note that when 2 MSX-AUDIO chips are present, the new values are applied to both chips.

Voice Data Table

This is a list of the voices available for use with CALL MK VOICE, CALL VOICE, CALL VOICE COPY or the MML @ instruction of PLAY

Voice No. Name Voice No. Name
0 * Piano 1 32 Piano 3
1 Piano 2 33 * Wood Bass
2 * Violin 34 Santoor 2
3 * Flute 1 35 Brass
4 * Clarinet 36 Flute 2
5 * Oboe 37 Clavicord 2
6 * Trumpet 38 Clavicord 3
7 Pipe Organ 1 39 Koto 2
8 Xylophone 40 Pipe Organ 2
9 * Organ 41 P0hdsPLA
10 * Guitar 42 P0hdsPRA
11 Santoor 1 43 Church Organ L
12 * Electric bass 44 Church Organ R
13 Clavicord 1 45 Synth Violin
14 * Harpsicord 1 46 Synth Organ
15 Harpsicord 2 47 Synth Brass
16 * Vibraphone 48 * Horn
17 Koto 1 49 Shamisen
18 Taiko 50 Magical
19 Engine 1 51 Fuwawa
20 UFO 52 Wonderflat
21 Synth Bell 53 Hard Rock
22 Chime 54 Machine
23 * Synth Bass 55 Machine V
24 * Synthesizer 56 Comic
25 Synth drum 57 SE comic
26 Synth rhythm 58 SE laser
27 Harmo drum 59 SE noise
28 Cow Bell 60 SE star 1
29 Hi-Hat 61 SE star 2
30 Snare drum 62 Engine 2
31 Bass drum 63 User voice**


* Sounds built in to MSX-MUSIC sound chip (Sounds generated by software are without an *)
** User voice is silent by default, but can be altered with CALL VOICE COPY.

The names of the voices are given for reference only and they may not sound the same as the real instruments.

Voice Array Format

Offset Contents
Header:
0~7 Voice name
8 Voice transposition (LSB)
8 Voice transposition (MSB)
10

Bit 0= Algorithm (MSX-AUDIO only)
Bit 1~3= Feedback
Bit 4= Fixed pitch (MSX-AUDIO only)
Bit 5= AMD/PMD load function (MSX-AUDIO only)
Bit 6= PMD (MSX-AUDIO only)
Bit 7= AMD (MSX-AUDIO only)

11~15 Reserved
Operator 0:
16 Bit 0~3= Multiple

Bit 4= Key Scale Rate
Bit 5= EG-Type (Sustained/Percussive tone switch)
Bit 6= Vibrato switch
Bit 7= Amplitude Modulation

17 Bit 0~5= Total Level

Bit 6~7= Key Scale Level

18 Bit 0~3= Decay rate

Bit 4~7= Attack rate

19 Bit 0~3= Release rate

Bit 4~7= Sustain level

20 Bit 0~3= Unused

Bit 4~7= Velocity sensibility (0~8) (MSX-AUDIO only)

21~23 Reserved
Operator 1:
24 Bit 0~3= Multiple

Bit 4= Key Scale Rate
Bit 5= EG-Type (Sustained/Percussive tone switch)
Bit 6= Vibrato switch
Bit 7= Amplitude Modulation

25 Bit 0~5= Total Level (MSX-AUDIO only)

Bit 6~7= Key Scale Level

26 Bit 0~3= Decay rate

Bit 4~7= Attack rate

27 Bit 0~3= Release rate

Bit 4~7= Sustain level

28 Bit 0~3= Unused

Bit 4~7= Velocity sensibility (0~8) (MSX-AUDIO only)

29~31 Reserved


Examples

CALL VOICE (@16,@25,@40) ' Sound defined for channels 1 to 3
CALL VOICE(@26,,@27) ' Sound defined for channels 1 and 3
CALL VOICE(,,@21) ' Sound defined for channel 3
CALL VOICE(A,,B) ' Sound defined for channel 1 (array A) and channel 3 (array B)

Related to

CALL MK VOICE, CALL VOICE COPY, PLAY

Compatibility

MSX-AUDIO BASIC, MSX-MUSIC BASIC