			OPL MIDI PATCH EDITOR v1.0

			  by Sulaiman Abdul-Khabir
			      November 19, 1999

Comments?Need Source Code?Bugs?
email: jupe_en@hotmail.com



Thank you for downloading my OPL editor program.


This DOS program is for someone who is familiar with the OPL cell 
operators and their parameters. It is very useful for creating
MIDI patches for different programs. Non-programmers may also find
it fun to make weird sounds. 

--Getting Start:
Unzip all files into the same directory.

Open the program and you will see the splash screen.
Press any key to go on to the main program.

Press F6 to load some default patches.

Now press or click the F5PLAY button. A tone should sound.

If you do not hear anything it is because your Sound Blaster card does 
not have the 0x220 base address. This will be easily resolved in the 
next version (a quick change in the source code).

Press ESC to quit the program.

Known Issues:
Precussion support is buggy.
-------------------------------------------------------------------
NOTE TO PROGRAMMERS: OK there will probably not be another version 
for a while. But if you wish to modify this version then please 
send me an e-mail at: jupe_en@hotmail.com
--------------------------------------------------------------------
- Tools Used-
Compiler: Borland C++ 5.02 (Borland specific routines used)
Microsoft Paint for Interface and Buttons

- Additional Credits:
Steven H Don  - Default patches
David G. Roberts - Mouse routines
Micheal Tischer - FM routines

-- FILE FORMAT - (files can be saved with any extension)


start of file 
---------------------
struct FMOPR - 5bytes (modulator cell data 0)
struct FMOPR - 5bytes (carrier cell data 0)
struct FMOPR - 5bytes (modulator cell data 1)
struct FMOPR - 5bytes (carrier cell data 1)
...
struct FMOPR - 5bytes(modulator cell data 127)
struct FMOPR - 5bytes(carrier cell data 127)
--------------------------------------
end of file

-- Header File
Below is an excerpt from the program's header file.
You can see that many formats can be saved if implemented.

//This structure allows for fast and easy manipulation
//of individual parameters of a cell without having to
//merge parameters every time a single parameter changes
//NOTE: any talk or reference to a register name means the (base_register + offset(cell/chan))
typedef struct operator_cell_mem_tag
{
char attack,sustain,release,decay,mutefac,highmute,trem,vib,envltype,envlreduc,multifact,wavetype;
}MEMOPR;

//The structure allow for easy setting of actual operators cells
//without having to merge parameters for use in the registers
typedef struct operator_cell_fm_tag
{
UINT8 reg20,reg40,reg60,reg80,regE0; //base register names
}FMOPR;

//defines parameters for a channel(voice)
typedef struct patch_tag_mem
{
MEMOPR modulator;
MEMOPR carrier;
}PATCHMEM;

//defines parameters for a channel(void);
typedef struct patch_tag_fm
{
FMOPR modulator;
FMOPR carrier;
}PATCHFM;
//we may what to add channel support later
typedef struct channel_fm_tag
{
UINT8 regA0;	//base register names
UINT8 regB0;
UINT8 regC0;
}CHANNELFM;

typedef struct channel_mem_tag
{
int freq;
char octave;//(Block number)
char connection;
char feedback;
char toneon;    //when bit 5 of reg 0xB0 is set then output is enabled
}CHANNELMEM;

typedef struct instrument_fm_tag
{
CHANNELFM voice; //channel parameters to play patch
PATCHFM patch;
char mode; //precussion ?  (if TRUE set TONE_OFF channels 6,7,8 (also set freq. and ADSR before))
}INSTRUMENT;
