Changes

Jump to: navigation, search

SOUNDCHIP SFG-01 MBIOS

7,561 bytes added, 13:23, 27 June 2021
5.1.4 Manual play by MK
Nippon Gakki Co., Software Development
=Introduction=
This reference manual is intended to explain the utilization of the "SFG-01" Control Program version 1.0" which resides within the internal 16Kbyte ROM of the "SFG-01".
=Chapter I Outline=
TABLE OF CONTENTS==1-1 Program Configuration====1-2 Design Concept== The MBIOS was designed with the following main concepts in mind. First, MBIOS users should not have to worry directly about the hardware. The controls of the built-in FM sound chip, and that of midi interface, are all carried out by the MBIOS, freeing the user from this task. Second, the concept of a virtual instrument should be defined in the user's program space. By instrument, we mean the processing system for real-time key-on/key-off requests (events).MBIOS defines the instrument by using an IDB(Instrument Definition Block) that is linked to the built-in FM sound generator IC or MIDI interface as the actual instrumental outputs.Thus (considering event data being input to the instrument), once the instrument is defined, the user can control the FM sound generator IC by manipulating only the event data. Third, the slot management of the MSX system should be left up to user. This enables a multiple number of slots to be used together with the M-BIOS. In other words, the M-BIOS does not address the slots by itself (with some exceptions). This enables the user to call out the IRQ processing module of the MBIOS by switching the slot to SFG-01 , even when the interrupt is received at the user's slot.
Chapter I OutlineFourth, there may be parallel prcessing by service calls.That is, the processes of Keyboard Scanning and Instrument Performance (PLAY), as well as the real-time processes such as event buffer handling for automatic reformance, can run simultaneously by appropriately issuing MBIOS calls in the user's main program or in his interrupt routines.
==1-1 Program Configuration==
==1-2 Design Concept==
==1-3 Hardware Configuration==
==1-4 Interface with MSX BASIC==
==1-5 Versions==
=Chapter II Basic Functions=
==2-1 Keyboard, Queue, Musical Instrument, Event==
 
===2-1-1 Musical Instrument, Event===
 
In this manual. 'instrument is meant to be an event processing
system.
There are 8 -general instruments and 4 special instruments .
The general Instrument is meant to be a normal instrument that
plays most of the music. accepting keyboard performance events
Isuch as melody,
The special instrument is specifically designed ka- rhythmic
performance It is possible for the MBIOS us, to program these
rhythmic instruments by us, general instruments and
appropriately designing the performance buffer.
However. MBI. already provides some useful rhythmic
instruments for the user who does not want to specifically
program the rhythm instruments
These are Chord. Bass, Percussion .0. and Percussion,
instruments
 
The instruments are defined by the control block, called 1DB
(Instrument Definition Block
8 general IDB's are referenced as IDEI.O. IDB.7.
Chord, Bass. Percussion are referenced as IDB.C. IDB.B. IDB.P0.
and IDB.PI respectively
Hereafter, depending on the situation, the instrument may be
refered to as MB.
 
The GSM vocal synthesizer. to be discussed later. is also defined by
1DB. and is referenced as IDEIR.M
 
IDB. =0 thru 7 IDES.0 to 1DB.7
IDB.0
 
 
1DB.P1
 
 
Fig. 2.3 1DB numbers
 
==2-2 Major parameters by which the FM sound generator IC creates sounds==
==2-3 Music Keyboard==
==2-7 Recording, Playback==
=Chapter III M-BIOS Interface=
==3-1 User Interface==
==3-2 Memory Management==
 
The management of the cartridge slot is left up to the user.
For example, assume that 0000h-3FFFh of the BASIC interpreter is
mapped in front, and when an interrupt needing MBIOS service just arrives
to the system. It is then the user's responsibility to switch the slot so as to
map the MBIOS slot in front, then get IRQC service by MBIOS, and finally
switch back to the original slot in order to exit from that interrupt.
 
However, as an exception, when loading/saving into the CMT. upon the CMT
service call request. MBIOS switches the slot ( assuming the primary
slot#0 for BASIC only) by itself appropriately to appropriate the CMT
service provided in the BIOS of BASIC interpreter.
 
The memory allocation under MBIOS control is as shown in FIG. 3.1.
The area from ED00h to F37Fh is a fixed work space for MB..
The area from EC00h to ECFFh is for the MIDB.
Other areas such as MB, EVB, RHB, UVL, and the stack area can be allocated
anywhere between 8000h (or 4000h when CMT routine is not used) and
EC00h.
 
==3-3 Supervisor Call==
==3-4 IRQ Processing==
==3-5 TRAP==
==3-6 Direct Commands by Asscessing MIDB,1DBIDB==�Chapter =Chapter IV M-BIOS Syntax=
==4-1 I-Call==
==4-12 Setting up information==
=Chapter V Writing Programs=
==5-1 Program Example==
 
The following sample program will demontrate the following instruments.
 
-manual performance by MY with IDB#0
 
-auto play of IDB#1
 
-auto rhythm of IDB#PO and IDB#P1
 
Program explanations will be made in the following sections.
With the example program, it is assumed that the VDP and PPI of the MSX system have already been Initialized by MSX-BASIC
 
===5.1.1 Program structure===
 
Lines between 35 and 50 show the framework of the sample program.
Here, the IRQ mode is set to mode-1. Stack area is defined, and SFG-01 is set to slot 3. As well as initializing the system, UISV and AST vectors are defined in the MIDB.
Note the clock-B vector, defined M line 46, routes the control to interrupt processing entry lines 195 and 196); then real time rhythm handler "auto:" (lines 224 to 244) is invoked. The idea of the program is to use clock-B for the auto-rhythm clock, handle the events there, and play them in the main loop of the program.
 
===5.1.2 Definition of instruments===
 
In the sample program, IDB#P0, IDB#P1 and IDB#0 are defined in the line numbers between 59 and 129. Between lines 141 and 144, the channels tithe FM sound generator IC are assigned to the above IDB's.
Assignment details are;
 
IDB#0 channels 0,2,3,4,5
IDB#1 channel 1
IDB#P0 channel 6
IDB#P1 channel 7
 
===5.1.3 Performance of IDB#1===
 
IDB#1 is supposed to play the performance data that is defined in the lines between 246 and 262.
With the auto-thythm clock synchronized to IDB#P0/1, the event data is loaded into queue (QU#1). This is done in the lines between 225 and 244. This routine "auto:" is of course driven by the interrupt, and the event requests in the queue are then played by the main loop between line 165 and 178. The playing is carried out by the lines from 166 arid 168.
 
===5.1.4 Manual play by MK===
 
MK is initialized in the lines between 136 and 139. Here, CHORD-MK is not used. Velocity is set to a default value of 80h. MK is linked up with QU#O.
 
With this setting, the lines 169 to 170 in the main loop issue the MK scanning request. If key actuation is detected, the events are sent into QU#O, which will be played by a P-call between lines 166 and 168.
 
In this example, since the MK scan is placed in the main loop, no MK trapping is used. The method of detecting MK events via MK trap (by defining AST vector in MIDB) would also be possible.
 
===5.1.5 Auto-rhythm performance===
 
Between lines 146 and 148, the queue for auto rhythm is selected. Here only QU#P is chosen.
 
Then between lines 149 and 151, the RHB (rhythm buffer) to be used is selected. This determines the rhythm pattern. Here, preset pattern .0 is
chosen.
Clock handling for the rhythm i3 done in clock-B handler 'auto,' between
lines 225 and 244.
Here, with lines 225 and 226, an auto-rhythm clock is issued in synchronization to the clock-B interrupt.
Actual start of the auto rhythm is specified in the lines between 152 and 155. In this case, the rhythm is will begin with the first note-on from MK.
 
Note that, as explained before, the IDB#1 performance is supposed to be synchronized to the auto rhythm. Therefore in "auto:" routine, line 227 checks if the rhythm has already started or not (before it loads the event into QU#1).
 
==5-2 Supplementary explanation for recording and playback programming==
==5-3 supplementary explanation for autorhythm generator==
==5-4 Supplementary information for CMT handling== -Use the S-03 call to define the UVL. -Use the S-21 call to load the UVL into memory (from the CMT). -Use S-22 call to save the UVL to the CMT-For the UVL load/save, the file name is fixed to ..V010E.. -Use the S-23 call to load the EVB into memory.-U. the S-29 call to save the EVB to the CMT.-The file name for the EVB can be specified via <M.FEVB> of the MIDS 
==5-5 M-Monitor usage==
==5-3 Problems and Solutions==

Navigation menu