Contents |
Effect
Initializes MSX-MUSIC and optionally MSX-MIDI by selecting mode and channels.
This instruction must be used first.
Note: When CALL MUSIC is executed, it will link the system interruptions hooks to MSX-MUSIC, clear all variables and secure the work area by decreasing in size the memory space available for MSX-BASIC (807 bytes are used by MSX-MUSIC).
Syntax
CALL MUSIC (<Mode>,0,<ChannelsPlayString1>,<ChannelsPlayString 2>, ...,<ChannelsPlayString9>)
Parameters
<Mode> is a number that defines the mode used by MSX-MIDI and MSX-MUSIC
Note: the choice between FM and MIDI will be made with the PLAY instruction.
FM | MIDI | |||||
---|---|---|---|---|---|---|
Mode | Melody | Rhythm | Melody | Rhythm | ||
0 | 9 channels | 0 | 9 channels | 0 | ||
1 (default value) | 6 channels | 3 channels | 8 channels | 1 channel |
0 (zero) needs always to be specified as second parameter.
<ChannelsPlayString> for each string related to FM or MIDI melody in the PLAY instruction allows to specify how many channels are used for this string. The number of channels can't be zero, except on Turbo R with MSX-MIDI for the seventh and eighth strings when mode 1 is used: if zero if specified for these strings, they will be ignored as FM sounds, but not as MIDI sounds.
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. When using MIDI, you actually assign one specific MIDI channel to each PLAY string; even if you specify a value of 2 or more, it will not produce a different effect than with value 1.
Channel of FM tone generator is automatically allocated from the smaller channel. The MIDI channel is set to 1, 2, 3, ... in order from the first character string; however, you can change that by using the @H<channel> MML instruction of PLAY.
If you use CALL MUSIC without parameter, MSX-MUSIC will be initialized as with CALL MUSIC(1, 0, 1, 1, 1), what means
- when playing FM sounds
- mode 1 = maximum 6 melody channels + 3 rhythm channels
- 1 channel for PLAY string 1
- 1 channel for PLAY string 2
- 1 channel for PLAY string 3
- PLAY string 4 will be used for FM rhythm
- PLAY strings 5 to 7 will optionally be used for the 3 PSG channels
- when playing MIDI sounds
- mode 1 = maximum 8 melody channels + 1 rhythm channel
- 1 channel for PLAY string 1
- 1 channel for PLAY string 2
- 1 channel for PLAY string 3
- PLAY string 4 will be used for MIDI rhythm
- PLAY strings 5 to 7 will optionally be used for the 3 PSG channels
Examples
10 ' MSX-MUSIC in mode 0 - 1 channel for each PLAY string (1 to 9) 20 CALL MUSIC(0,0,1,1,1,1,1,1,1,1,1)
10 ' MSX-MUSIC in mode 1 - 2 channels for PLAY string 1 20 ' 1 channel for PLAY string 2, 3 channels for PLAY string 3 30 CALL MUSIC(1,0,2,1,3)
10 ' Mode 1 with zero channel for 7th and 8th PLAY strings (on Turbo R) 20 ' The two last PLAY strings will be ignored if FM, not if MIDI 30 CALL MUSIC (1,0,1,1,1,1,1,1,0,0)
MSX-MUSIC and MSX-AUDIO
When a MSX system is equipped with both sound chips, the general rule is: CALL MUSIC will initialize MSX-MUSIC and CALL AUDIO will initialize MSX-AUDIO.
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.
MSX-MUSIC and FM Sound Synthesizer Unit
The Yamaha modules SFG-01 and SFG-05 use CALL MUSIC to start the software built in these modules.
If the module is used on a machine with MSX-MUSIC in a lower slot, you need to make the distinction between both extensions:
- to initialize the MSX-MUSIC sound chip, enter CALL MUSIC
- to start the SFG firmware, enter CALL MUSIC plus any additional letter or number (eg _MUSICA)
If the SFG module is inserted in a lower slot than MSX-MUSIC, both CALL MUSIC and CALL MUSICA will always run the SFG firmware.
Note that on the MSX2+ Sanyo and Sony machines with built-in MSX-MUSIC, this ROM is in slot 3-3. The SFG-01 module can only be added into a lower numbered slot, therefore CALL MUSIC will always run the SFG firmware when this module is present (even with additional letter or number).