Skip to content

Instantly share code, notes, and snippets.

@bryc
Last active October 1, 2024 12:36
Show Gist options
  • Save bryc/e997954473940ad97a825da4e7a496fa to your computer and use it in GitHub Desktop.
Save bryc/e997954473940ad97a825da4e7a496fa to your computer and use it in GitHub Desktop.

DX7

image

Note: One of the algorithms is incorrect due to a missing operator. Need to update the image. Will have to get on that soon.

These are the original 32 algorithms as used in Yamaha DX7.

The later Yamaha FS1R and Yamaha SY77 may have compatibility with these algorithms, but that's beyond the current scope. The FS1R contains 88 algorithms, while the SY77 contains 45 algorithms.

DX9

image

The DX9 uses the original DX7 chips, but its firmware ignores operators 1 and 2, thus effectively turning a 6-op synth into a 4-op synth. Algorithms 1 through 8 of the DX9 are hard-coded to specific DX7 algorithms: 1, 14, 8, 7, 5, 22, 31, 32.

These algorithms are chosen because operators 1-2 form an independent 2-op layer, which can be eliminated.

These 8 algorithms form the basis for all later 4-op devices. This includes DX21, DX27, DX100, DX11, V50, YS100, YS200. It was also used in many soundchips for computers, arcades and home consoles: YM2151/OPM, YM2612/OPN2, YM2608/OPNA, YM2203/OPN.

Despite having the same algorithms, it should be noted that there are differences between these devices.

OPL

image

The OPL series is quite different, because it originally had only 2 operators per channel. This means that only two algorithms are possible. The OPL2 tried to improve sound quality by adding additional waveforms other than just a sine wave. This was pretty new, the DX7 and many of the 4-op synths only had sine waves (aside from DX11 and some others for example). The OPL3 expanded on this to allow for 4-op modes. This added a custom set of 4 additional algorithms. Two from the DX9 series, and two completely unique to OPL3.

Later in 2002, the MA-3/MA-5 synth chip used in cell phones expanded on the OPL3 greatly, adding much more waveforms and two extra algorithms. It also modifies algorithm 6, adding a second feedback loop. It's quite an oddity in that these chips are the only Yamaha FM chips that use more than one feedback loop in the algorithms.

Reface DX

image

The Reface DX is an interesting device. I haven't looked heavily into it, but it uses 12 algorithms instead of 8! It uses 7 of the 8 DX9 algorithms. ALG4 from DX9 is removed because it is a duplicate due to Reface's extended feedback support. Two of the algorithms are custom. Three are additional 4-op algorithms derived from DX7: ALG 25, 13 and 30.

All operators have modifiable feedback. This allows for all 4 operators to have a different waveform, modulated from SAW<-SINE->SQUARE. This extends the capabilities of the DX in an interesting way.

ADSR envelope (OPM/OPL/MA)

The original DX7 line had an envelope generator with 4 levels and 4 rates, not quite a traditional ADSR, but more flexible:

image

However, the 4-op synths (YM2151, DX21/DX100/DX27/DX11 + many others) use a traditional ADSR with a bit of a twist:

adsr_opm

The "Sustain Rate" or "Sustain Decay Rate" is a secondary decay rate targetting the sustain period, while the key is pressed. If enabled, it will slowly decay back down to 0. This allows for greater modulation control without requring any automation of parameters (like TL). However this part of the envelope does not exist in the OPL series of chips, or MA-1 and MA-2 of the MA series (which are largely OPL based).

There are also variations in paramater resolution, which means converting between them can only be approximations.

Here are some mnemonic strings for the different envelope profiles. I've omitted the "Sustain Level" because it uses 4-bit resolution universally. Definitions: T=Total Level, A=Attack Rate, D=Decay Rate, R=Release Rate, S=Sustain Rate

A = OPL/OPL2/OPL3 + MA-1/MA-2

T6-A4-D4-R4

B = MA-3/MA-5

T6-A4-D4-R4-S4

(Same as A but with Sustain Rate)

C = MA-7

T6-A5-D5-R5-S5

(The only one with a 5-bit Release Rate)

D = OPM + OPN/OPNA/OPN2 + DX 4-op series (DX21/27/100 + DX11)

T7-A5-D5-R4-S5

(The only one with a 7-bit Total Level. This is the envelope used in Sega Genesis and arcades via YM2151..)

Notes:

  • The TL parameter is supposedly compatible, just that OPM has an extra bit for -48 dB, which is very quiet and probably doesn't come up as a problem in practice. But I haven't looked into it.

Frequency Multiplier differences

Unfortunately, there are different sets of frequency multipliers. The differences are minor, essentially OPM/OPN can do 11, 13 and 14 while OPL/MA cannot. MA1 is limited to 7, and MA7 redefines the list to include inharmonic frequencies.

Model 0 1 2 3 4 5 6 7 8 9 A B C D E F
MA1 .5 1 2 3 4 5 6 7
OPL .5 1 2 3 4 5 6 7 8 9 10 10 12 12 15 15
OPM .5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
OPN .5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
MA2—MA5 .5 1 2 3 4 5 6 7 8 9 10 10 12 12 15 15
MA7 .5 .891 1 1.414 1.498 2 3 4 5 6 7 8 9 10 12 15

Note that multipliers 0.5, 1, 2, 4, and 8 represent frequency doublers, and thus are octave switches. You can go one octave down and 2 octaves up. The other multipliers are still supposed to be harmonic despite not being in tune.

DT2 + DX21/27/100

The 4-op series of DX synths have a supposedly carefully hand-picked list of ratios, 64 in total. In comparison, the OPM has only 15, but supposedly the chip used in the 4-op DX synths are based on the OPM...

Here is that list:

dx27

It turns out that the DT2 ("Detune 2") parameter of OPM is what is used to produce the ratio list in 4-op line, although their list appears to have been sorted by value.

Here is a little script that calculates the ratios based on MUL and DT2 values.

var DT2TAB = [0/768, 384/768, 500/768, 608/768], OUT = [];

for(let c = 0, MUL = 0; MUL <= 15; MUL++) {
	let d = MUL === 0 ? 0.5 : MUL;
	for(let DT2 = 0; DT2 <= 3; DT2++, c++) {
		let ratio =  ""+(Math.pow(2,s[DT2]) * d).toFixed(2);
		console.log(c.toString(2).padStart(6,0), ratio);
		OUT.push((ratio));
    }
}

Some strange rounding errors aside, it is quite close to the values in the DX user manuals.

Interesting to note that the resulting pitches aren't linear. When MUL >= 4 and DT2 != 0, the resulting ratio is higher than when DT2 = 0. This could be why they sorted the numbers in the list. I wonder if the firmware has a hard-coded 6-bit number that iterates over the sorted list?

┌──────────────────────────────────────────────────────────────────────────────┐
│ │
│ The Ad Lib Music Synthesizer Card │
│ │
│ P R O G R A M M I N G G U I D E │
│ │
│ │
│ Written by Tero Töttö │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
CHAPTER 1: DESCRIPTION OF THE SYNTHESIZER 1
Operators 1
Operating Modes 1
Melodic and Percussive Mode 2
CHAPTER 2: PROGRAMMING THE SYNTHESIZER 3
Card location in I/O channel 3
Card addresses 3
CHAPTER 3: ALMSC REGISTER MAP 4
Status Register 4
Write registers 4
Operator offsets 4
Channel formation 5
CHAPTER 4: ALMSC REGISTER REFERENCE 6
Status Register 6
Registers 01h - 04h 6
Registers 08h - 55h 7
Registers 60h - BDh 8
Registers C0h - F5h 9
APPENDIX A: INSTRUMENT BANK (.BNK) FILE STRUCTURE 10
APPENDIX B: NOTE FREQUENCIES 11
DISCLAIMER: IN NO EVENT WILL I BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING
ANY LOST OF PROFITS, LOST SAVINGS OR OTHER INCIDENTIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF YOUR USE OR INABILITY TO
USE THIS MANUAL, OR FOR ANY OTHER CLAIM BY ANY OTHER PARTY.
TRADEMARKS: Ad Lib is registered trademark of Ad Lib Inc.
COPYRIGHT: This manual can be distributed freely if not modified.
DESCRIPTION OF THE SYNTHESIZER (1)
──────────────────────────────
Ad Lib Synthesizer is made up of oscillators and envelope generators. An
oscillator, an envelope generator, and a level controller are linked together
to form an "operator":
┌────────────┐ ┌────────────────────┐ ┌──────────────────┐
│ Oscillator ├─>│ Envelope Generator ├─>│ Level Controller ├──> OUTPUT
└────────────┘ └────────────────────┘ └──────────────────┘
The Ad Lib Music Synthesizer card (ALMSC) contains 18 operators which are
generally grouped into pairs in order to produce instrumental sounds. The
operators can be combined in three different ways:
* FM synthesis uses two operators in series. The first operator,
the modulator, modulates the second operator, the carrier, via
its modulation data input.
┌─────────────┐ ┌─────────────┐
Frequency │ Operator │ │ Operator │
Modulation │ 1. ├─>│ 2. ├─> SPEAKER
synthesis │ (Modulator) │ │ (Carrier) │
└─────────────┘ └─────────────┘
* Additive synthesis uses two operators in parallel, adding both
outputs together. This method of synthesis is not as interesting
as FM synthesis, but it can generate good organ-type sounds.
┌─────────────┐
│ Operator │
│ 1. ├──┐
│ │ │
Additive └─────────────┘ │
synthesis ├─> SPEAKER
┌─────────────┐ │
│ Operator │ │
│ 2. ├──┘
│ │
└─────────────┘
* Composite sine wave synthesis (CSW) may be used to generate speech
or other related sounds by playing all 9 voices simultaneously. When
using this method, the card cannot generate any other sounds. This
mode is not explained here, because other methods have proved to
provide better quality speech.
The ALMSC produces either 9 melodic sounds or 6 melodic sounds and 5 (2)
percussion instruments. For the 9 melodic sounds, the operators are
grouped in pairs. For the percussion mode, the opearators are arranged
as follows:
* 6 melodic instruments (12 operators)
* 1 Bass Drum (2 operators)
* 1 Snare Drum (1 operator)
* 1 Tom-Tom (1 operator)
* 1 Cymbal (1 operator)
* 1 Hi-Hat (1 operator)
Because ALMSC has only 9 registers for frequency information (one for
each melodic channel), Cymbal and Hi-Hat pitches are fixed.
In percussion mode, a white noise generator is used to create rhythm sounds.
This white noise generator uses voices 7 and 8 (Snare Drum and Tom-Tom)
frequency information (Block, Frequency Number, Multiplication), and the proper
phase output. Various rhythm sounds are produced by combining this output signal
with white noise. The result is then sent to the operators. Best ratio for the
two frequencies is 3:1 (Snare Drum frequency = 3 * Tom-Tom frequency). Finally,
envelope information is multiplied with the wave table output. As the envelope
is set for one operator which corresponds to a single rhythm instrument, the
values are set in the parameter registers in the same manner as for melodic
instruments.
PROGRAMMING THE SYNTHESIZER (3)
───────────────────────────
The ALMSC may be located at four different addresses:
218h , 288h , 318h , 388h
The port address is currently hard-wired to 388h, but jumpers may be added in
the future, so you should take into account the possibility of using different
addresses when programming. Later on this manual, I will refer only to the
address 388h.
The card decodes two addresses:
388h - Index register (write), Status register (read)
389h - Data register (write only)
The index register is used to select the register address, and then data is
written to data register. Status register returns the state of two timers on
the card.
Because of the nature of the card, you must wait 3.3 µsec after a register
select write, and 23 µsec after a data write. Best way to handle this is to read
ALMSC status register in loop, because bus speed is always the same regardless
of processor speed. 6 reads after register select write and 36 reads after data
write should do the job.
ALMSC REGISTER MAP: (4)
───────────────────
Status Register (388h):
┌───────────────────────────────────────────────────────────────────────┐
│ D7 D6 D5 D4 D3 D2 D1 D0 │
├────────┼────────┼────────┼────────┴────────┴────────┴────────┴────────┤
│IRQFlag │ T1Flag │ T2Flag │ │
└────────┴────────┴────────┴────────────────────────────────────────────┘
Write Registers (389h):
┌─────┬───────────────────────────────────────────────────────────────────────┐
│ REG │ D7 D6 D5 D4 D3 D2 D1 D0 │
├─────┼────────┴────────┼────────┼────────┴────────┴────────┴────────┴────────┤
│ 01 │ │WSEnable│ Test Register │
├─────┼─────────────────┴────────┴────────────────────────────────────────────┤
│ 02 │ Timer 1 Count (80 µsec resolution) │
├─────┼───────────────────────────────────────────────────────────────────────┤
│ 03 │ Timer 2 Count (320 µsec resolution) │
├─────┼────────┬────────┬────────┬──────────────────────────┬────────┬────────┤
│ 04 │IRQReset│ T1Mask │ T2Mask │ │T2 Start│T1 Start│
├─────┼────────┼────────┼────────┴──────────────────────────┴────────┴────────┤
│ 08 │ CSW │NOTE-SEL│ │
├─────┼────────┼────────┼────────┬────────┬───────────────────────────────────┤
│20-35│Tremolo │Vibrato │Sustain │ KSR │ Frequency Multiplication Factor │
├─────┼────────┴────────┼────────┴────────┴───────────────────────────────────┤
│40-55│ Key Scale Level │ Output Level │
├─────┼─────────────────┴─────────────────┬───────────────────────────────────┤
│60-75│ Attack Rate │ Decay Rate │
├─────┼───────────────────────────────────┼───────────────────────────────────┤
│80-95│ Sustain Level │ Release Rate │
├─────┼───────────────────────────────────┴───────────────────────────────────┤
│A0-A8│ Frequency Number ( Lower 8 bits ) │
├─────┼─────────────────┬────────┬──────────────────────────┬─────────────────┤
│B0-B8│ │ KEY-ON │ Block Number │ F-Num (hi bits) │
├─────┼────────┬────────┼────────┼────────┬────────┬────────┼────────┬────────┤
│ BD │Trem Dep│Vibr Dep│PercMode│ BD On │ SD On │ TT On │ CY On │ HH On │
├─────┼────────┴────────┴────────┴────────┼────────┴────────┴────────┼────────┤
│C0-C8│ │FeedBack Modulation Factor│Additive│
├─────┼───────────────────────────────────┴─────────────────┬────────┴────────┤
│E0-F5│ │ Waveform Select │
└─────┴─────────────────────────────────────────────────────┴─────────────────┘
For some of the parameters, there is one register per output channel. For those
parameters, channel number can be used as an offset into the map. For many
parameters, there is one register per operator. However, there are holes in the
address map so that in this case, the operator number CANNOT be used as an
offset. The operator offsets for those registers are (in hex form):
┌─────┬────────────────────────────────────────────────────────────────────────┐
│ OPR │ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 │
├─────┼────────────────────────────────────────────────────────────────────────┤
│ OFS │ 00 01 02 03 04 05 08 09 0A 0B 0C 0D 10 11 12 13 14 15 │
└─────┴────────────────────────────────────────────────────────────────────────┘
The next two tables illustrates which operators together form a channel: (5)
┌───────────────────────────────────────────────────┐
│ M E L O D I C M O D E │
├──────┬────┬────┬────┬────┬────┬────┬────┬────┬────┤
│ CHAN │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │
├──────┼────┼────┼────┼────┼────┼────┼────┼────┼────┤
│ OPR1 │ 1 │ 2 │ 3 │ 7 │ 8 │ 9 │ 13 │ 14 │ 15 │
│ OPR2 │ 4 │ 5 │ 6 │ 10 │ 11 │ 12 │ 16 │ 17 │ 18 │
└──────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘
┌─────────────────────────────────────────────────────────────┐
│ P E R C U S S I O N M O D E │
├──────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┤
│ CHAN │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ BD │ SD │ TT │ CY │ HH │
├──────┼────┼────┼────┼────┼────┼────┼────┼────┼────┼────┼────┤
│ OPR1 │ 1 │ 2 │ 3 │ 7 │ 8 │ 9 │ 13 │ 17 │ 15 │ 18 │ 14 │
│ OPR2 │ 4 │ 5 │ 6 │ 10 │ 11 │ 12 │ 16 │ │ │ │ │
└──────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘
ALMSC REGISTER REFERENCE: (6)
─────────────────────────
Status Register:
D7 IRQ Flag. Set if D5 and/or D6 are/is set.
D6 Timer 1 Flag. Set when the preset time in Timer 1 has elapsed.
D5 Timer 2 Flag. Set when the preset time in Timer 2 has elapsed.
Timer interrupts are not wired, but the timers can be used to detect
the presence of the card as follows:
1. Reset T1 and T2: write 60h to register 4.
2. Reset the IRQ: write 80h to register 4.
3. Read status register: read at 388h. Save the result.
4. Set timer 1 to FFh: write FFh to register 2.
5. Unmask and start timer 1: write 21h to register 4.
6. Wait in a delay loop for at least 80 µsec.
7. Read status register: read at 388h. Save the result.
8. Reset T1,T2 and IRQ as in steps 1 and 2.
9. Test the results of the two reads: the first should
be 0, the second should be C0h. If either is incorrect,
then the ALMSC is not presents.
NOTE1: You should AND the result bytes with E0h because
the unused bits are undefined.
NOTE2: This testing method doesn't work in SoundBlaster.
01: Test Register / WSE:
D5 Waveform Select Enable. If clear, all channels will use normal
sine wave. If set, register E0-F5 (WS) contents will be used.
D4-D0 Test Register, must be reset to zero before any operation.
02: Timer 1 Count:
Upward 8 bit counter with a resolution of 80 µsec. If an overflow
occurs, the status register bit is set, and the preset value is
loaded into the timer again.
03: Timer 2 Count:
Same as Timer 1, but with a resolution of 320 µsec.
04: IRQ-Reset / Mask / Start:
D7 IRQ-Reset. Resets timer and IRQ flags in status register.
All other bits are ignored when this bit is set.
D6 Timer 1 Mask. If 1, status register is not affected in overflow.
D5 Timer 2 Mask. Same as above.
D1 Timer 2 Start. Timer on/off.
D0 Timer 1 Start. Same as above.
08: CSW / NOTE-SEL: (7)
D7 Composite sine wave mode on/off.
D6 NOTE-SEL. Controls the split point of the keyboard. When 0, the
keyboard split is the second bit from the bit 8 of the F-Number.
When 1, the MSb of the F-Number is used.
20-35: Tremolo / Vibrato / Sustain / KSR / Frequency Multiplication Factor:
D7 Tremolo (Amplitude vibrato) on/off.
D6 Frequency vibrato on/off.
D5 Sound Sustaining. When 1, operator's frequency will be held at
its sustain level until a KEY-OFF is done.
D4 Envelope scaling (KSR) on/off. When 1, higher notes are shorter
than lower notes.
D3-D0 Frequency Multiplication Factor (MULTI):
┌───────┬────────┐
│ MULTI │ Factor │
├───────┼────────┤
│ 0 │ ½ │
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
│ 4 │ 4 │
│ 5 │ 5 │
│ 6 │ 6 │
│ 7 │ 7 │
│ 8 │ 8 │
│ 9 │ 9 │
│ 10 │ 10 │
│ 11 │ 10 │
│ 12 │ 12 │
│ 13 │ 12 │
│ 14 │ 15 │
│ 15 │ 15 │
└───────┴────────┘
40-55: Key Scale Level / Output Level:
D7-D6 Key Scale Level. Attenuates output level towards higher pitch:
┌─────┬─────────────┐
│ KSL │ Attenuation │
├─────┼─────────────┤
│ 0 │ - │
│ 1 │ 1.5 dB/oct │
│ 2 │ 3.0 dB/oct │
│ 3 │ 6.0 dB/oct │
└─────┴─────────────┘
D5-D0 Output Level. Attenuates the operators output level. In additive
synthesis, varying the output level of any operator varies the
volume of its corresponding channel. In FM synthesis, varying
the output level of the carrier varies the volume of the channel.
Varying the output of then modulator will change the frequency
spectrum produced by the carrier.
60-75: Attack Rate / Decay Rate: (8)
D7-D4 Attack Rate. Determines the rising time for the sound. The
higher the value, the faster the attack.
D3-D0 Decay Rate. Determines the diminishing time for the sound.
The higher the value, the shorter the decay.
80-95: Sustain Level / Release Rate:
D7-D4 Sustain Level. Determines the point at which the sound ceases
to decay and chages to a sound having a constant level. The
sustain level is expressed as a fraction of the maximum level.
Note that the Sustain-bit in the register 20-35 must be set for
this to have an effect.
D3-D0 Release Rate. Determines the rate at which the sound disappears
after KEY-OFF. The higher the value, the shorter the release.
A0-A8: Frequency Number:
Determines the pitch of the note. Highest bits of F-Number are stored
in the register below.
B0-B8: Key On / Block Number / F-Num(hi bits):
D5 KEY-ON. When 1, channels output is enabled.
D4-D2 Block Number. Roughly determines the octave.
D1-D0 Frequency Number. 2 highest bits of the above register.
The following formula is used to determine F-Number and Block:
F-Num = Music Frequency * 2^(20-Block) / 49716 Hz
BD: Trem Dep / Vibr Dep / PercMode / BD/SD/TT/CY/HH On:
D7 Tremolo (Amplitude Vibrato) Depth. 0 = 1.0dB, 1 = 4.8dB.
D6 Frequency Vibrato Depth. 0 = 7 cents, 1 = 14 cents.
A "cent" is 1/100 of a semi-tone.
D5 Percussion Mode. 0 = Melodic Mode, 1 = Percussion Mode.
D4 BD On. KEY-ON of the Bass Drum channel.
D3 SD On. KEY-ON of the Snare Drum channel.
D2 TT On. KEY-ON of the Tom-Tom channel.
D1 CY On. KEY-ON of the Cymbal channel.
D0 HH On. KEY-ON of the Hi-Hat channel.
C0-C8: FeedBack Modulation Factor / Additive: (9)
D3-D1 FeedBack Modulation Factor:
┌───────┬────────┐
│ MULTI │ Factor │
├───────┼────────┤
│ 0 │ 0 │
│ 1 │ π/16 │
│ 2 │ π/8 │
│ 3 │ π/4 │
│ 4 │ π/2 │
│ 5 │ π │
│ 6 │ 2∙π │
│ 7 │ 4∙π │
└───────┴────────┘
D0 Additive. 1 = Additive synthesis, 0 = Frequency Modulation
E0-F5: Waveform Select:
D7-D2 Not used
D1-D0 WaveForm Select (WS):
┌────┬────────────┐
│ WS │ WaveForm │
├────┼────────────┤
│ 00 │ Sine │
│ 01 │ Half-Sine │
│ 10 │ Abs-Sine │
│ 11 │ Pulse-Sine │
└────┴────────────┘
APPENDIX A: INSTRUMENT BANK (.BNK) FILE STRUCTURE (10)
─────────────────────────────────────────────────
Field Size Type Description
───────────────────────────────────────────────────────────────────────────────
HEADER SECTION
1 1 byte file version, major
2 1 byte file version, minor
3 6 byte signature: "ADLIB-"
4 2 integer number of list entries used
5 2 integer total number of list entries in file
6 4 longint absolute offset in file of start of name list
7 4 longint absolute offset in file of start of data
8 8 byte pad (set to zero)
INSTRUMENT NAME SECTION RECORD
1 2 integer index into data section
2 1 byte flag: 0 if record used, else 1
3 9 byte instrument name (max 8 chars + NULL)
DATA SECTION RECORD
1 1 byte mode (0=melodic,1=percussion)
2 1 byte voice number (if percussion mode)
modulator (operator 0) parameters:
3 1 byte key scale level
4 1 byte frequency multiplier
5 1 byte feedback modulation factor
6 1 byte attack rate
7 1 byte sustain level
8 1 byte sound sustaining
9 1 byte dacay rate
10 1 byte release rate
11 1 byte output level
12 1 byte amplitude vibrato (tremolo)
13 1 byte frequency vibrato
14 1 byte envelope scaling
15 1 byte 0=FM synthesis, 1=additive synthesis
carrier (operator 1) parameters (for melodic channels and bassdrum only):
3 1 byte key scale level
4 1 byte frequency multiplier
5 1 byte feedback modulation factor
6 1 byte attack rate
7 1 byte sustain level
8 1 byte sound sustaining
9 1 byte dacay rate
10 1 byte release rate
11 1 byte output level
12 1 byte amplitude vibrato (tremolo)
13 1 byte frequency vibrato
14 1 byte envelope scaling
15 1 byte unused
29 1 byte waveform for modulator
30 1 byte waveform for carrier
APPENDIX B: NOTE FREQUENCIES (11)
────────────────────────────
The following table contains frequencies in Hertz for the notes in octaves
1 to 8. Middle C is in octave 5.
┌──────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
│ NOTE │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │
├──────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
│ C │ 16.352 │ 32.703 │ 65.406 │ 130.81 │*261.63*│ 523.25 │ 1046.5 │ 2093.0 │
│ C# │ 17.324 │ 34.648 │ 69.295 │ 138.59 │ 277.18 │ 554.37 │ 1108.7 │ 2217.5 │
│ D │ 18.354 │ 36.708 │ 73.416 │ 146.83 │ 293.66 │ 587.33 │ 1174.7 │ 2349.3 │
│ D# │ 19.445 │ 38.890 │ 77.781 │ 155.56 │ 311.13 │ 622.25 │ 1244.5 │ 2489.0 │
│ E │ 20.601 │ 41.203 │ 82.406 │ 164.81 │ 329.63 │ 659.26 │ 1318.5 │ 2637.0 │
│ F │ 21.826 │ 43.653 │ 87.307 │ 174.61 │ 349.23 │ 698.46 │ 1396.9 │ 2793.8 │
│ F# │ 23.124 │ 46.249 │ 92.499 │ 184.99 │ 369.99 │ 739.99 │ 1480.0 │ 2960.0 │
│ G │ 24.499 │ 48.999 │ 97.998 │ 195.99 │ 391.99 │ 783.99 │ 1568.0 │ 3136.0 │
│ G# │ 25.956 │ 51.913 │ 103.82 │ 207.65 │ 415.31 │ 830.61 │ 1661.2 │ 3322.4 │
│ A │ 27.500 │ 55.000 │ 110.00 │ 220.00 │ 440.00 │ 880.00 │ 1760.0 │ 3520.0 │
│ A# │ 29.135 │ 58.270 │ 116.54 │ 233.08 │ 466.16 │ 932.32 │ 1864.7 │ 3729.3 │
│ B │ 30.867 │ 61.735 │ 123.47 │ 246.94 │ 493.88 │ 987.77 │ 1975.5 │ 3951.1 │
└──────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
┌──────────────────────────────────────────────────────────────────────────────┐
│ EdLib v1.05a rev 055 ................... AdLib editor by Jens-Christian Huus │
├──────────────────────────────────────────────────────────────────────────────┤
│ │
│ │
│ INTRODUCTION │
│ ──────────── │
│ │
│ At last you can lay your hands on an editor which makes full use │
│ of the OPL2 AdLib capabilities of your AdLib card or compatibles │
│ such as the entire Sound Blaster series! The editor you now have │
│ in your possession was in fact developed mainly in 1992-1993. In │
│ 1993 I enhanced it furthermore, this time mostly cosmetical only │
│ but also a few userfriendly additions such as a filesystem which │
│ packs the work tune on your harddisk to save space. Since 1993 I │
│ hardly touched it - however, it was used a lot in games projects │
│ such as LollyPop from Brain Bug (released by Rainbow Arts). │
│ │
│ Actually it was my intention to keep the editor for ourselves in │
│ order to support AdLib in games. However, since the development │
│ of the editor I have experienced a generel hostility towards the │
│ old AdLib standard. People begun to actually hate FM sounds. The │
│ arrival of GUS and AWE 32 made wavetable techniques very popular │
│ and indeed it sounds very good, but there are some things in the │
│ old FM standard that is unique. You can't fiddle with samples in │
│ the same way as you can with FM. I personally never quite liked │
│ sampling, I find it downright boring. With a FM chip it is like │
│ on a C64; you have a few parameters and everything you do has to │
│ be done within these parameters. These boundaries makes it funny │
│ to make music, to see how far you can actually push AdLib. To do │
│ sounds on FM requires expertice but if you're good at it, almost │
│ any instrument can be reproduced properly, except perhaps drums. │
│ │
│ This is the reason why I decided to release my editor. It uses a │
│ system very similar to the ordinary tracker system, but has been │
│ enhanced with individual sequences for each track. Each sequence │
│ can even vary in size. Because of the natural way of designing │
│ my system, I find it vastly superior to the tracker system. It │
│ uses much less memory and allows each sequence to be transposed │
│ individually. This is the exact same system as I used on the C64 │
│ editor which was heavily used in that scene. │
│ │
│ Freaks from the good old C-64 with the editing system used there │
│ should be able to use the editor right away. Just tap ALT-F1 and │
│ a list of keys will appear. :) │
│ │
│ As an extra bonus I have included a player with the instructions │
│ on how to use the finished music in your own programs! Please go │
│ to the "USE" directory and read the DOC file there for some more │
│ information on this. │
│ │
│ All files in this archive is freeware - if you payed for it, you │
│ have been cheated! However, I reserve the rights to maintain all │
│ copyrights. Do NOT reverse engineer my code or else! :( │
│ │
│ If you make some nice tunes in it, why not let it be "EDL-Ware"? │
│ I would be very happy to hear what you can do with this! :) │
│ │
│ │
│ FEATURES │
│ ──────── │
│ │
│ The archive contains both the editor and loads of demo songs to │
│ demonstrate the editor. Below is just some of the things you can │
│ do with the editor... │
│ │
│ │
│ - Edit and play 9 voices of AdLib while viewing and editing 1024 │
│ instruments complete with a name for each instrument. │
│ │
│ - Save all music and instruments in a work file of approximately │
│ 3 to 9 Kb size. These files will have the extension "EDL". │
│ │
│ - Pack the music to a compressed format (around 1 - 6 Kb), which │
│ is directly playable in your own programs. Extension is "D00". │
│ Packed music also uses much less processor time. │
│ │
│ - Edit song name and composer name. This information also exists │
│ in the compressed D00 format. │
│ │
│ - Because EDL and D00 is not compatible, you can be sure the D00 │
│ cannot be ripped and edited. The editor does not load D00. You │
│ may find this bad, but I actually see this as an advantage. Do │
│ you like people to mess around in your source tune? ;) │
│ │
│ - All AdLib parameters editable, with extra enhancements such as │
│ hard restart, arpeggio, modulation programs and finetune. │
│ │
│ - Both tune speed and timer IRQ speed may be edited. The normal │
│ tune speed uses a floating point system to access more speeds │
│ with a smaller granularity than normally possible. │
│ │
│ - Use "+++" to hold a note in sequences and "---" to release it. │
│ This makes it easier to control the ADSR of an instrument. │
│ │
│ - Play with instruments using "QWERT..." - and if your keyboard │
│ is connected via a MPU-401 compatible MIDI interface, you can │
│ even play the AdLib instruments on it, complete with velocity │
│ and aftertouch. And polyphonic too of course. I've tested this │
│ on both the original MPU-401 and the Sound Blaster 16. I only │
│ use the UART mode on the interface. │
│ │
│ - Very flexible track and sequence system taking less memory and │
│ is much more efficient than the standard tracker system. Every │
│ sequence is piled on top of each other to show you exactly how │
│ the music is played. │
│ │
│ - Unique tienote command makes it possible to play notes without │
│ restarting the effects set for the instruments. │
│ │
│ - Full delete, insert, copy and other similar editing facilities │
│ available in both tracks and sequences. │
│ │
│ - Use "FollowPlay" to see the music scroll as it is being played │
│ at the same time. You may even use fast forward in this mode. │
│ │
│ │
│ REQUIREMENTS │
│ ──────────── │
│ │
│ The editor requires a PC with 80x50 text screen capabilities and │
│ an AdLib card or compatible. Anything that is equipped with an │
│ OPL2 chip or better. I wouldn't recommend using the SBOS program │
│ for the GUS however - it doesn't emulate FM sounds 100% correct. │
│ │
│ Enhanced keyboard is optional - F11 and F12 is used but has been │
│ duplicated elsewhere to support all keyboards. │
│ │
│ If you have a MPU-401 interface (or compatible) you can use your │
│ synthesizer to play with AdLib instruments through MIDI. │
│ │
│ │
│ FILES │
│ ───── │
│ │
│ The following files should be present in the archive. If they're │
│ not, the archive has been tampered with and should be replaced │
│ by a new copy. Remember to unzip with the "-d" switch. │
│ │
│ │
│ EDLIB.001 7382 Part of the main editor │
│ EDLIB.002 7350 Part of the main editor │
│ EDLIB.DOC 96022 This documentation │
│ EDLIB.EXE 19184 The main editor │
│ EDLIB.REV 1722 Revision update list │
│ │
│ PLAYER\DATA.BIN 164 Initialized player data │
│ PLAYER\INTERFAC.BIN 801 Combines player with editor │
│ PLAYER\PLAYER.BIN 4576 AdLib player v04.01 │
│ │
│ SONGS\DRX_BUS.EDL 3593 Drax - "Bus" │
│ SONGS\DRX_FLAS.EDL 4513 Drax - "Flash2" │
│ SONGS\DRX_HUMA.EDL 3962 Drax - "Human Nature" │
│ SONGS\DRX_SAD.EDL 3253 Drax - "Sad" │
│ SONGS\DRX_STRE.EDL 3671 Drax - "Street Wise" │
│ │
│ SONGS\JCH_INS8.EDL 2526 Jch - "Instrument Test #8" │
│ SONGS\JCH_PH6.EDL 2383 Jch - "Phase" (TEST) │
│ │
│ SONGS\MSK_FRSH.EDL 2782 Msk - "Fresh" │
│ SONGS\MSK_OBER.EDL 3086 Msk - "En lille test" │
│ │
│ SONGS\MTL_ALTT.EDL 3173 Metal - "Alttoga" │
│ SONGS\MTL_HY11.EDL 4185 Metal - "Hybrid" │
│ SONGS\MTL_NM11.EDL 4212 Metal - "Soul Shock" │
│ SONGS\MTL_SL12.EDL 3477 Metal - "Sulfo12" │
│ SONGS\MTL_SP13.EDL 4087 Metal - "Space13" │
│ │
│ SONGS\PJO_ARGH.EDL 2483 Jo - "Aaaaarggghhh" │
│ SONGS\PJO_DIP.EDL 2137 Jo - "Dip" │
│ SONGS\PJO_GALW.EDL 2549 Jo - "Like Galway" │
│ SONGS\PJO_HORR.EDL 2461 Jo - "Fly in Spiders Web!" │
│ SONGS\PJO_KOER.EDL 2472 Jo - "Koere" │
│ SONGS\PJO_LAL.EDL 2707 Jo - "Drums are hard to do" │
│ SONGS\PJO_MTHS.EDL 2748 Jo - "Submission to -X-" │
│ SONGS\PJO_REGG.EDL 2293 Jo - "Reggae" │
│ SONGS\PJO_SUND.EDL 2513 Jo - "Boring Sunday" │
│ SONGS\PJO_TRY2.EDL 2784 Jo - "Hard Guitar" │
│ SONGS\PJO_WAIT.EDL 2393 Jo - "1st Interstellar Jmp" │
│ │
│ SONGS\VIB_FIS3.EDL 2812 Vibrants - "Fis3" │
│ SONGS\VIB_VOL3.EDL 2619 Vibrants - "Volly3" │
│ │
│ USE\- 277 MakeFile for Borland "MAKE" │
│ USE\GLOBALS.INC 2937 Labels used by the player │
│ USE\MPLAYER.DOC 32636 Documentation on how to use │
│ USE\MPLAYER.OBJ 5783 Player v04.00 OBJ link file │
│ USE\STR_WISE.D00 3082 Drax - "Street Wise" tune │
│ USE\TEST.ASM 12523 Example source code │
│ USE\TEST.EXE 5869 Run this to hear the music │
│ USE\TEST.OBJ 1285 Test OBJ link file │
│ │
│ USE\DOS\THE_EGA.CPI 9805 New character set for DOS │
│ │
│ │
│ CPI FILE │
│ ──────── │
│ │
│ I have included a file named "THE_EGA.CPI" which you can use in │
│ your AUTOEXEC.BAT instead of the old "EGA.CPI" file. It contains │
│ a new 80x25 character set by Claus Marn¢e (Banshee/Bonzai) and a │
│ great new 80x50 character set by Niels Krogh Mortensen (Who made │
│ the original Hugo TV character for SilverRock Productions). When │
│ using EdLib the editor will look much better with this installed │
│ in your AUTOEXEC.BAT. The editor redefines a few characters, but │
│ still uses the rest of the character set in DOS. If you live in │
│ Denmark as I do, these lines will do the trick: │
│ │
│ C:\DOS\MODE CON CP PREP=((865) C:\DOS\THE_EGA.CPI) │
│ C:\DOS\MODE CON CP SELECT=865 │
│ │
│ Remember to copy the file in USE/DOS into your DOS directory and │
│ you are off running with the new character set. Look in your DOS │
│ manual for other contry codes specific for your country. │
│ │
│ │
│ INSTRUCTIONS │
│ ──────────── │
│ │
│ In the following chapters I will try to describe all the things │
│ that you really need to know. I will not go into detail on how │
│ to make music, enter notes and build up a tune from scratch - I │
│ leave that up to you to figure that out. If you have previously │
│ been using trackers, you should have no trouble using my editor. │
│ │
│ During these chapters I will discuss the commands available in │
│ the tracks and sequences, the instrument and SpFX tables, keys │
│ available in the entire editor - and the command line switches. │
│ Other things global to the editor will be discussed here. │
│ │
│ While editing tracks, sequences and tables you can benefit from │
│ the help window in the lower left corner of the screen. I advise │
│ you to read this DOC at least once, however. │
│ │
│ All the three-letter box values in the lower right corner of the │
│ screen will be discussed in the section over keys. The space you │
│ see above the "Oc?" box (octave) will be ticked whenever a tune │
│ has been modified without saving. This way, you can always check │
│ if it is time to save your tune. However, this version of EdLib │
│ does not check the box if you only alter the tables. This is due │
│ to technical reasons; the table routines have been placed in a │
│ seperate module - and frankly, I was too lazy to fix it! ;) │
│ │
│ The version v04.01 of the player is displayed in the upper right │
│ corner of the screen. In the subdirectory "PLAYER" you will find │
│ the file "PLAYER.BIN" which is the actual player. It is possible │
│ that later versions of the editor only requires this player to │
│ be replaced - in case of player updates only. In the upper right │
│ corner you will also find a tune clock. Useful if you want to │
│ measure the exact length of the song. │
│ │
│ When using the load/save requester, all EDL files will be placed │
│ in a subdirectory called "SONGS". Later I may enhance the editor │
│ with diretories and path input, but until then you must save and │
│ load all your songs in this directory. Note that when saving the │
│ song you can type the new name at the input prompt in the bottom │
│ of the requester. Songs with an EDL extension will be compressed │
│ to save disk space. │
│ │
│ It is possible to predefine the contents of all sequences in the │
│ editor before actually using them. Edit sequence #000 until it │
│ has the appearance you want all sequences to have and then press │
│ Shift-F1 to fill all other sequences with it. Because this is │
│ really happens when the song is cleared; sequence #000 is copied │
│ into all the other sequences! │
│ │
│ │
│ SEQUENCE COMMANDS │
│ ───────────────── │
│ │
│ The first column of two in the sequences may take any command of │
│ four hexadecimal digits each. The commands in player v04.01 is: │
│ │
│ │
│ 6000 Cut/Stop the voice instantly. Instrument #000 in │
│ the instrument table is used to cut the voice. │
│ │
│ 7XYY Vibrato - X defines the speed (0-F), and YY the │
│ depth (00-FF) of the vibrato effect. This effect │
│ does NOT make use of the internal OPL2 vibrato. │
│ │
│ 90XX New level - XX defines the level (00-3F), where │
│ 3F is silent. Level is another word for volume. │
│ │
│ BXXX Pointer to SpFX table. The SpFX table is the one │
│ you can access with the "K" key. Refer to this │
│ table for more information. This command works │
│ like an instrument, thus it overrides a CXXX. It │
│ may range from 000-7FF. │
│ │
│ CXXX Instrument. XXX may range from 000 to 3FF. It is │
│ good practise to leave #000 as a "no sound" as │
│ this instrument is in fact used when typing the │
│ cut command (6000). The table may be entered by │
│ pressing the "M" key. Refer to this table for │
│ more information. │
│ │
│ DXXX Slide up. XXX defines the speed of sliding. │
│ │
│ EXXX Slide down. XXX defines the speed of sliding. It │
│ does not automatically "tie unto" the next note │
│ like in other music players. You must "tie" the │
│ next note yourself with the ½-key and adjust the │
│ speed of sliding until it is perfect. This may │
│ sound awkward at first, but this way of sliding │
│ is much more flexible. │
│ │
│ │
│ TRACK COMMANDS │
│ ────────────── │
│ │
│ The track consists of a DWORD in the editor, but the table is in │
│ fact interpreted word for word internally. │
│ │
│ │
│ 8XYY???? The 8000 command defines the transposition of a │
│ sequence. X is the direction, 0=Up. YY defines │
│ the number of halftones to transpose. A value of │
│ 810C transposes the sequence down one octave but │
│ does not change the on-screen appearance of the │
│ notes in the sequence. Using the transposition │
│ feature properly, you can save a LOT of space │
│ compared to the average tracker system! The word │
│ ???? defines the sequence number itself. │
│ │
│ FFFFXXXX When this DWORD is met, the voice will restart │
│ at the position defined in XXXX. It is important │
│ to know that it counts in WORD steps. This means │
│ that if you have ten sequences in a row with a │
│ FFFFXXXX in the end, use FFFF0006 to wrap to the │
│ fourth sequence - like this: │
│ │
│ 80000001 0 - 1 1st... │
│ │
│ 80000003 2 - 3 2nd... │
│ │
│ 80000001 4 - 5 3rd... │
│ │
│ ┌> 80000004 6 4th... │
│ │ │
│ │ 80070001 5th... │
│ │ │
│ │ 80070003 6th... │
│ │ │
│ │ 80070001 7th... │
│ │ │
│ │ 80070005 8th... │
│ │ │
│ │ 80000002 9th... │
│ │ │
│ │ 80000006 10th... │
│ │ │
│ └─ FFFF0006 Wrap... │
│ │
│ The player interpretes the wraps independantly │
│ from voice to voice. This means that neither the │
│ wrap position nor the length of tracks has to be │
│ aligned. │
│ │
│ FFFE???? This command stops the voice entirely. The ???? │
│ WORD will be ignored. Very useful for jingles! │
│ │
│ │
│ THE INSTRUMENT TABLE │
│ ──────────────────── │
│ │
│ This is the table you enter when pressing "M". You can also use │
│ the "L" key to toggle between this table and the SpFX table. If │
│ the table window is not active, it will be made active (pop-up) │
│ before entering the table. │
│ │
│ The instrument table consists of 400h (1024) instruments, each │
│ of 16 bytes in size. The bytes mainly controls the hardware OPL2 │
│ registers on the card, but I have added a few of my own as well. │
│ When an instrument has been defined, use the CXXX command in the │
│ sequences to use it. │
│ │
│ But first, lets have a look at the instrument itself: │
│ │
│ │
│ FFFF 3F 20 00 FFFF 3F 20 00 01 02 03 04 05 06 │
│ └─────────────┘└─────────────┘ │
│ Carrier Modulator │
│ │
│ │
│ The parameters in both carrier and modulator uses the exact same │
│ parameters, only the "modulator" part usually changes the color │
│ of the sound while the "carrier" changes the volume and pitch. I │
│ said "usually", because this depends on the way the operators is │
│ connected. More about this later. │
│ │
│ NOTE: It is wise to leave instrument #0000 at the values defined │
│ in the example above since this instrument is in fact used when │
│ executing a CUT command (6000 in the command column). │
│ │
│ The carrier and modulator parameters will be send to the OPL2 FM │
│ chip directly, as they are hardware based. Lets have a look at │
│ the parameters individually. │
│ │
│ │
│ FFFF This parameter controls the ADSR of the instrument. Some │
│ of you already knows what this means. If you come from │
│ the Commodore 64 and have been fiddling with ADSR here, │
│ all you have to know is that is behaves upside-down - it │
│ takes FF02 instead of 00FE! Otherwise it is very simple. │
│ Each nibble ("F", a halfbyte), takes a parameter from 0h │
│ to Fh, to define four parameters named the Attack, Decay │
│ Sustain and Release. The attack defines the speed of the │
│ volume to reach maximum level, Fh is fastest. As soon as │
│ this level has been reached, the Decay value defines the │
│ speed of the volume to reach the Sustain level. Again, │
│ Fh is fastest. Sustain is a pseudo-volume level (volume) │
│ where 0 is loudest. Release again defines the speed of │
│ the volume to go from the Sustain level to silence. All │
│ in all, a diagram like this can be drawn to illustrate │
│ the ADSR envelope: │
│ │
│ │
│ /\ │
│ / \ │
│ / \ │
│ / \________________ │
│ / \ │
│ / \ │
│ / \ │
│ │
│ │
│ └─────┴───┴───────────────┴───┘ │
│ A D S R │
│ │
│ │
│ In the sequence itself, the ADS part of the ADSR will be │
│ run as soon as the note is triggered, and maintained for │
│ as long as the HOLD events (+++) are present. As soon as │
│ the REST events is met (---), the note releases (R). An │
│ exception to this rule exists in the instrument however. │
│ If bit 5 is set to 0 in the 4th/9th byte (the bytes set │
│ to 20h above), the Sustain is ignored and only an ADR │
│ is executed. In other words, it ignores the HOLD (+++). │
│ │
│ In the modulator, the ADSR works is a similar way - only │
│ it affects the modulation instead of the volume. Use it │
│ to give "life" to the instrument. │
│ │
│ │
│ 3F This parameter is split into bit 0-5 for the main volume │
│ (level) and bit 6-7 for keyboard scaled level (KSL). The │
│ level is 00h-3Fh, where 00h is loudest. Add 40h, 80h or │
│ C0h for three rates of KSL. The KSL defines how much the │
│ volume decreases in volume as the notes climbs upwards. │
│ In other words, the higher the note, the lower the level │
│ of the note. This feature is not used very often. │
│ │
│ In the modulator part, the level affects the modulation │
│ instead of the volume. 00h is full modulation (100%). │
│ │
│ │
│ 20 This is a multiple purpose register of the FM chip. Bits │
│ 0-3 defines the multiplier, which works like an octave │
│ parameter only it steps in a rather absurd way. With it, │
│ you can change the pitch without editing the music - to │
│ some degree! Bit 4 (add 10h) sets the KSR - which means │
│ keyboard scaled rate. It works like KSL only it affects │
│ the speed of which the ADSR is processed. The higher the │
│ note, the faster the ADSR. Bit 5 (add 20h) selects ADSR │
│ or only ADR. Normally, you would set this to 1 (ADSR) or │
│ the HOLD/REST in sequences will be ignored; notes will │
│ release as soon as the note has been triggered. This may │
│ come in handy at times though. Bit 6 (add 40h) enables a │
│ hardware vibrato. This vibrato is quite insufficient at │
│ times to say the least, so I added my own vibrato to the │
│ sequence commands (7XYY). Last, bit 7 (add 80h) enables │
│ the hardware tremolo. Tremolo vibrates the level - think │
│ of it as the "Elvis Costello" bit! ;) │
│ │
│ │
│ 00 Only values from 00 to 03 is used here (bits 0-1). All │
│ other bits is ignored. This value defines the waveform │
│ of the operator. If you come from the Commodore 64 with │
│ its marvellous SID-chip, you will be disappointed to see │
│ what waveforms this chip has. They are not as flexible │
│ as the SID-chip waveforms. 00 is a sine and is loudest. │
│ I have also noticed that waveforms 02 and 03 seems to be │
│ one octave higher than 00 and 01. I will try my best to │
│ draw the waveforms now using the terrible ASCII chars. │
│ │
│ │
│ ┌──┐ │
│ ┌┘ └┐ │
│ │ │ │
│ ┌┘ └┐ │
│ │ │ │
│ │ │ │
│ 00 = └──────┼──────┐ │
│ │ │ │
│ │ │ │
│ └┐ ┌┘ │
│ │ │ │
│ └┐ ┌┘ │
│ └──┘ │
│ │
│ ┌──┐ │
│ ┌┘ └┐ │
│ │ │ │
│ ┌┘ └┐ │
│ │ │ │
│ │ │ │
│ 01 = └──────┴─────── │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ ┌──┐ ┌──┐ │
│ ┌┘ └┐ ┌┘ └┐ │
│ │ │ │ │ │
│ ┌┘ └┬┘ └┐ │
│ │ │ │ │
│ │ │ │ │
│ 02 = └──────┴──────┘ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ ┌─┐ ┌─┐ │
│ ┌┘ │ ┌┘ │ │
│ │ │ │ │ │
│ ┌┘ │ ┌┘ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ 03 = └───┴──┴───┴─── │
│ │
│ │
│ │
│ │
│ This should give you an idea of what the waveforms looks │
│ like. All waveforms are variations on the sine waveform. │
│ │
│ │
│ That concludes the five bytes in each operator, which constructs │
│ the actual sound. The last 6 bytes in the instrument all behaves │
│ globally to the instrument. │
│ │
│ │
│ 01 This is the last hardware register. In bit 0, you define │
│ the connection of the two operators. Normally it is set │
│ to 0 (modulation), but if set to 1 (additive), the modu- │
│ lator operator will behave exactly as the carrier. This │
│ is great for organ sounds! Bits 1-3 defines the feedback │
│ of the modulation (0,2,4...E), which is the number of │
│ times the output is fed right back into the modulation │
│ process, creating overtones. If you set it high (E or F) │
│ you get so many of them that you get...noise! So this is │
│ the parameter you use the make drums. Again, if you come │
│ from the Commodore 64 you will be a little disappointed. │
│ The noise is stuck at a high frequency, and cannot sound │
│ as good as the noise on the SID-chip. :( Often drums on │
│ AdLib can be improved by using a second voice, in which │
│ you create a bassdrum-like sine which is sliding down. │
│ │
│ │
│ 02 This is a software parameter. Use values 00-7F to fine- │
│ tune the instrument - if you are using two voices on top │
│ of each other, this may phase the two voices together in │
│ order to produce a chorus effect. │
│ │
│ │
│ 03 Hard restart timer value. Defines the number of frames │
│ BEFORE the next note, that the next value below is to be │
│ processed. 00h turns this OFF. Frames is a term for the │
│ smallest timeunit a player can measure, which of course │
│ is the number of times the player is called. If the IRQ │
│ value is set to 46h, the frame corresponds to 1/70'th of │
│ a second. Good values are 01-03. │
│ │
│ │
│ 04 Hard restart Sustain/Release value. When the timer is up │
│ in the previous byte above, this value is put into the │
│ Sustain/Release on the soundcard for that voice. This is │
│ useful to "cut down" on a long release before the next │
│ note in a sequence. ADSR usually continues on the Attack │
│ from whatever point the Release from the last note might │
│ have reached, but this is not always desirable. You can │
│ also use these parameters to make the music more funky. │
│ │
│ │
│ 05-06 These bytes are unused in player v04.01. Do not put any │
│ information into them as they may be used later on. Keep │
│ them at 00h. │
│ │
│ │
│ THE SpFX TABLE │
│ ────────────── │
│ │
│ This is the table you enter when pressing "K". You can also use │
│ the "L" key to jump between this table and the instrument table. │
│ If the table window is not active, it will be made active before │
│ entering the table. │
│ │
│ The SpFX (Special Effects) table consists of 800h (2048) effects │
│ lines, of 8 bytes in size. When an SpFX has been defined you can │
│ use the BXXX command in the sequences to point to it. │
│ │
│ A SpFX "set" may look like this: │
│ │
│ │
│ 0001 0C FF 10 20 0002 │
│ │
│ │
│ Let's have a look at these parameters individually. │
│ │
│ │
│ 0001 This WORD defines the instrument to use for the set. Use │
│ values 000-3FF. Add with 8000h to use locked frequencies │
│ with the next byte below. │
│ │
│ │
│ 0C Half note value, added to the actual note for as long as │
│ this "set" lasts. Eg, if the note in the sequence is C-2 │
│ and this value is 02, the note will sound as D-2. If you │
│ add the WORD value above with 8000h, the values will NOT │
│ be added. Instead, the values will refer to raw notes as │
│ if 00h equals C-0, 01 equals C#0 and so forth. When used │
│ to add the note, the value is signed; 00-7F for positive │
│ and FF-80 for negative (-01h - -80h). Locked frequencies │
│ can often be useful for drums which should be unaffected │
│ by tranpositions. │
│ │
│ │
│ FF New modulator level. The value overrides the 8th byte in │
│ the instrument. If this value is FF, the 8th byte is NOT │
│ replaced and this value will be ignored. Useful if you │
│ want to add to the original value in the instrument. │
│ │
│ │
│ 10 Modulator level add. Added each frame to the 8th byte in │
│ the instrument, as an alternative to the ADSR modulating │
│ process. The value is a signed byte; 00-7F for positive │
│ and FF-80 for negative (-01h - -80h). Use the byte above │
│ to set the start modulator level if needed. │
│ │
│ │
│ 20 Duration. Defines the number of frames (00-FF) of this │
│ set. 00h is ONE frame. When the counting is up, the next │
│ WORD specifies the next SpFX line to interprete. │
│ │
│ │
│ 0002 Pointer to next SpFX line. After the duration counter in │
│ the previous byte above is up, this WORD specifies the │
│ next line to jump to. Values ranges from 0000h-07FFh. │
│ │
│ │
│ This table is very useful if you want to make arpeggio or sounds │
│ with more life than the normal ADSR modulation can give you. Now │
│ I won't advise you to make arpeggio chords when you have as much │
│ as 9 voices, but it could come in handy when improving drums. As │
│ an example, here is the dreaded 0-3-7 arpeggio chord: │
│ │
│ │
│ 0000: 0001 00 FF 00 0001 │
│ 0001: 0001 03 FF 00 0002 │
│ 0002: 0001 07 FF 00 0000 │
│ │
│ │
│ The above example uses instrument #0001 to produce a 0-3-7 chord │
│ using arpeggio. The duration bytes are all 00, meaning that the │
│ arpeggio will run at the fastest possible speed. No modulation │
│ adding is involved. Notice how the pointers makes the three sets │
│ spin around in an endless loop! Use B000 in the sequence to try │
│ out this minor arpeggio chord. │
│ │
│ │
│ KEYS │
│ ──── │
│ │
│ Here is a list of all keys available in EdLib, some of them with │
│ a deeper description than found in the HELP pages (Alt-F1). │
│ │
│ │
│ F1 Play normally from StartPoint (SP) position. │
│ │
│ This key does not scroll the music, useful when │
│ editing the music while it is playing. │
│ │
│ │
│ F2 Stop all music activity. │
│ │
│ You can also use the ESCAPE key. If you're using │
│ a MIDI keyboard, you can also cut hanging voices │
│ with this key. │
│ │
│ │
│ F3 FollowPlay from StartPoint position. │
│ │
│ The music scrolls as the music plays to show the │
│ current position being played. Use the CTRL keys │
│ as a fast forward function in this mode. NOTE: I │
│ do not recommend using disk cache software such │
│ as "SMARTDRV" as it disrupts the scrolling! :( │
│ │
│ │
│ F4 Set new StartPoint position (SP). │
│ │
│ You can set the new position anywhere, no matter │
│ if you're halfway through a sequence or not. The │
│ hexadecimal stepcounter to the left of the main │
│ editing area will turn dark blue below the point │
│ and light blue after it. │
│ │
│ │
│ F5 Copy any sequence into the current sequence. │
│ │
│ Use this key to overwrite the sequence you are │
│ currently editing, with the contents of another. │
│ │
│ │
│ F6 Decrease the tune speed. │
│ │
│ Hold CTRL to specifically define it. │
│ │
│ │
│ F7 Increase the tune speed. │
│ │
│ Hold CTRL to specifically define it. The Spd box │
│ in the bottom right corner of the screen informs │
│ you of the current value. │
│ │
│ │
│ F8 Define new SuperInsert size. │
│ │
│ │
│ F9 Execute the SuperInsert in a sequence. │
│ │
│ When pressing this key you will insert as many │
│ events into the sequence as defined with the F8 │
│ key. The SpI counter in the bottom right corner │
│ of the screen informs you of the current value. │
│ Note that you can have no more than 5Fh events │
│ in a single sequence. If you want more than this │
│ you have to split it up into two sequences. │
│ │
│ │
│ F10 Goto any stepcounter line. │
│ │
│ The hexadecimal stepcounter is the column to the │
│ far left of the editing area. │
│ │
│ │
│ F11 Define new RhythmJump value. │
│ │
│ Sets the number of events the cursor jumps after │
│ pressing a note key in the sequence. The RtJ box │
│ in the bottom right corner of the screen informs │
│ you of the current value. │
│ │
│ │
│ F12 Load music in EDL format. │
│ │
│ Brings up a file requester from which you can │
│ choose an EDL file to load. You can also use the │
│ Ctrl-F3 key. │
│ │
│ │
│ Shift F1 Clear all tracks and sequences. │
│ │
│ Leaves the instruments and SpFX tables intact. A │
│ useful function when borrowing instruments from │
│ another song. Sequence #000 is actually used to │
│ fill all sequences, so if you edit this sequence │
│ before clearing you can userdefine all at once. │
│ │
│ │
│ Shift F2 Clear instruments and SpFX tables. │
│ │
│ Leaves the tracks and sequences intact. May come │
│ in handy if you disliked all the instruments and │
│ want to start all over defining them again. │
│ │
│ │
│ Shift F5 Copy any sequence into another sequence. │
│ │
│ As the F5 key, only it takes both a source and a │
│ destination input. │
│ │
│ │
│ Shift F12 Save music in EDL format. │
│ │
│ Brings up a file requester from which you can │
│ save your song. You can also use the Ctrl-F4 key │
│ instead. │
│ │
│ │
│ Ctrl F1 Decrease the IRQ timer speed. │
│ │
│ Ctrl F2 Increase the IRQ timer speed. │
│ │
│ The above keys changes the timer interrupt speed │
│ of the song. Be careful when using these! Better │
│ have a talk with the programmer using your music │
│ to make sure he accepts the new value. Normally │
│ they are set to 46h (70) which matches the speed │
│ of the screen update in 320x200 mode. This way, │
│ the music can be used in a vertical retrace. In │
│ some situations you can make use of a fast timer │
│ interrupt to speed up the arpeggio in an instru- │
│ ment. If you only want to change the speed of a │
│ song, use the F6/F7 keys instead. The Irq box in │
│ the bottom right corner of the screen keeps hold │
│ of the current timer interrupt speed. │
│ │
│ │
│ Ctrl F3 Load music in EDL format. │
│ │
│ You can also use the F12 key. │
│ │
│ │
│ Ctrl F4 Save music in EDL format. │
│ │
│ You can also use the Shift-F12 key. │
│ │
│ │
│ Ctrl F5 Convert the music to D00 format and save it. │
│ │
│ This brings up a requester asking for a filename │
│ of the packed tune. After typing this, the music │
│ will be packed and saved as a D00 file - to be │
│ used in your own programs. The packed tune can't │
│ be loaded into the editor again, so be sure you │
│ save your source with Shift-F12 or Ctrl-F4! Note │
│ that the packer goes into a 9-PASS process. It │
│ has been tested intensively with no problems so │
│ far - however, should the packer ever lock up at │
│ any time, please note the pass number and mail │
│ me this number. My address can be found in the │
│ end of this file. Thank you! │
│ │
│ │
│ Ctrl F6 Define new tune speed. │
│ │
│ Input the speed. Use F6/F7 to decrease/increase. │
│ │
│ │
│ Ctrl F7 Define new tune speed. │
│ │
│ Input the speed. Use F6/F7 to decrease/increase. │
│ │
│ │
│ Ctrl F9 Input music name in top of screen. │
│ │
│ The input takes 20 characters as the name of the │
│ music. Remember to do this before saving a tune │
│ to disk or packing it! D00-files also contains │
│ this string. │
│ │
│ │
│ Ctrl F10 Input composer name in top of screen. │
│ │
│ Again takes 20 characters. Remember to press it │
│ before saving or packing the tune! The D00-files │
│ also contains this string. │
│ │
│ │
│ M Enter instrument table. │
│ │
│ Will enter the instrument table at the position │
│ you left it at last time. If the table window is │
│ not active, it will be made active first. │
│ │
│ │
│ K Enter SpFX table. │
│ │
│ Will enter the table at the position you left it │
│ at last time. If the table window is not active, │
│ it will be made active first. │
│ │
│ │
│ L Toggle between instrument and SpFX tables. │
│ │
│ Enters the other table. If you type it outside a │
│ table it will enter the other table than the one │
│ you edited last time. If the table window is not │
│ active, it will be made active first. │
│ │
│ │
│ Alt Down Change main volume byte below the current voice. │
│ │
│ Beneath each voice you'll find a value which can │
│ be edited with this key combination. The volumes │
│ controls the main volume for that voice, and has │
│ priority over volume commands in the sequence. │
│ │
│ │
│ Alt Up Change logical voice byte above the voice. │
│ │
│ Using "Alt-Up" you can change the value above a │
│ voice. This value is the physical voice number │
│ attached to the voice. Changing the values, you │
│ can completely rearrange voices - you can even │
│ make the same voice appear at several places! It │
│ may come in handy when some voices has something │
│ in common, like chords or double-voice drums. │
│ │
│ │
│ Ctrl Fast forward while in FollowPlay mode. │
│ │
│ Only works when in FollowPlay mode. You cannot │
│ use fast forward when playing with F1. │
│ │
│ │
│ Alt 1-9 Toggles voices 1-9 ON or OFF. │
│ │
│ Note that the logical voice numbers above voices │
│ goes dark grey when a voice is OFF. │
│ │
│ │
│ Alt Tab Turn all voices OFF except the edited voice. │
│ │
│ │
│ , Turn all voices ON. │
│ │
│ │
│ . Turn all voices OFF. │
│ │
│ │
│ - Toggle current voice ON or OFF. │
│ │
│ │
│ Q2W3ER5... Play in note column or instrument/SpFX tables. │
│ │
│ Use these keys to play with the instrument or to │
│ type notes in the right column of a sequence. As │
│ you type a key the instrument last edited in the │
│ main instrument table will play. Use the Ctrl-Up │
│ and Ctrl-Down keys to change the octave. │
│ │
│ │
│ Spacebar Erase sequence command or a REST in note column. │
│ │
│ In the sequence itself you can erase commands or │
│ notes by tapping space on them. SPACE on a note │
│ enters a REST (---) event. │
│ │
│ │
│ X/C/V Put a HOLD (+++) in the note column. │
│ │
│ All 3 keys have the exact same meaning. I made │
│ this to make it easier for you to edit blindly. │
│ As the key is pressed, a HOLD (+++) appears. │
│ │
│ │
│ Z HOLD to the previous note, REST to the next. │
│ │
│ A very useful command that should be used when- │
│ ever possible instead of SPACE and X/C/V. Press │
│ it to put HOLD (+++) up towards the note and put │
│ REST (---) down towards the next one. It ignores │
│ the presence of old HOLD and REST. Also, it may │
│ be pressed in the command column - which is not │
│ possible with the other HOLD/REST keys. │
│ │
│ │
│ ½ Toggle tienote ON or OFF. │
│ │
│ On my keyboard it is the key just below the ESC │
│ and above the TAB key. When pressed on an event │
│ in a sequence, it toggles the note white/yellow. │
│ When white, the note is changed in the music but │
│ the effects of the instrument is NOT restarted. │
│ │
│ │
│ Enter Jumps between track editing or sequence editing. │
│ │
│ Also used to edit names in the instrument table. │
│ │
│ This is probably the most used key when editing │
│ notes as it jumps in and out of track values. In │
│ the instrument table you can edit the name of an │
│ instrument with this key. This name may contain │
│ up to 16 characters. │
│ │
│ │
│ Tab Jump to the right voice. │
│ │
│ Ctrl Tab Jump to the left voice. │
│ │
│ Use the above keys to switch between voices. As │
│ you enter a new voice the voice is "blown up" to │
│ show the entire voice (track, commands & notes). │
│ The other voices will be shrinked, so that only │
│ the notes can be seen - the most essential part! │
│ You can spot the beginning and end of sequences │
│ by observing the "> <" signs around the notes. │
│ │
│ │
│ Q Enter the next unused sequence in the track. │
│ │
│ Another useful function. When editing a song and │
│ deleting/inserting sequences, you may at times │
│ forget which sequences you have used and which │
│ you have trashed. By pressing the key on a track │
│ number, the editor will automatically find the │
│ first unused sequence number and enter the value │
│ for you. │
│ │
│ │
│ ↑/↓/←/→ Cursor keys, used globally in the editor. │
│ │
│ │
│ Home/End Used globally in the editor. │
│ │
│ │
│ Delete Delete in track or sequence mode. │
│ │
│ │
│ Insert Insert in track or sequence mode. │
│ │
│ Note that you can have no more than 5Fh events │
│ in a single sequence. If you want more than this │
│ you have to split it up into two sequences. │
│ │
│ │
│ ESC Exits modes, also stops the music. │
│ │
│ This is also used to remove the windows with the │
│ instrument and SpFX tables. │
│ │
│ │
│ Page Up/Down Used globally in the editor. │
│ │
│ │
│ Ctrl Up Increase the note octave. │
│ │
│ Ctrl Down Decrease the note octave. │
│ │
│ The above keys changes the octave available with │
│ "Q2W3ER5..." keys. The Oc? counter in the bottom │
│ right corner of the screen informs you of the │
│ current value. Also Ctrl-Right may decrease. │
│ │
│ │
│ Ctrl Pg Up Home to the absolute top. │
│ │
│ │
│ Ctrl Pg Down Home to the absolute bottom. │
│ │
│ Does not yet work in the voice editing area. │
│ │
│ │
│ S Toggle CPU rastertime ON or OFF. │
│ │
│ The rastertime is shown as a grey block in the │
│ outscan border. May be useful for the programmer │
│ but keep in mind that the music takes much more │
│ rastertime in the editor than when packed! │
│ │
│ │
│ Ctrl Break Exit to DOS. │
│ │
│ You can skip the palette fade with the /P switch │
│ on the commandline. │
│ │
│ │
│ COMMANDLINE PARAMETERS │
│ ────────────────────── │
│ │
│ Note that all switches may be preceeded with either a slash "/" │
│ or a minus "-" character. Slash is used in the examples below. │
│ │
│ You can load an EDL file from the commandline prompt, if needed. │
│ │
│ Usage: EDLIB [<Switches>] [<Name of EDL file>] │
│ │
│ │
│ /? Help page briefly describing the switches. │
│ │
│ │
│ /F Use followplay immediately. │
│ │
│ Useful when loading an EDL file from the command │
│ line and you want to play it right away. │
│ │
│ │
│ /P Do not fade colors when quitting. │
│ │
│ If you feel annoyed having to wait for the fade │
│ to get finished, use this switch to skip it. │
│ │
│ │
│ /C Convert EDL to D00 (NOT READY YET). │
│ │
│ Reserved for future expansion; may in later ver- │
│ sions of EdLib convert from EDL to D00 without │
│ having to enter the editor itself. Until this is │
│ implemented you must do it with Ctrl-F5 inside │
│ the editor. │
│ │
│ │
│ /M Use the MPU-401 interface. │
│ │
│ If you have an external synthesizer connected │
│ through you MPU-401 MIDI interface you can play │
│ the AdLib instruments on it. Cursor up and down │
│ in the instrument table to choose the instrument │
│ and change the octave with Ctrl-Up or Ctrl-Down. │
│ Now you can play this instrument on the keyboard │
│ synth, using full polyphony and velocity. Note │
│ that aftertouch uses a default vibrato setting │
│ which is independant of the bytes in the editor. │
│ You cannot use the MIDI to record music in this │
│ version of EdLib. │
│ │
│ │
│ /A Ignore AdLib detection. │
│ │
│ Useful at times when the detection routine might │
│ fail, even if an OPL2 IS present! E.g, if your │
│ computer uses both a Sound Blaster and a Gravis │
│ Ultrasound at the same time. The timer detection │
│ does not always work in those circumstances. │
│ │
│ │
│ CONTACT ADDRESS │
│ ─────────────── │
│ │
│ That does it for this DOC. I'm sorry if I haven't been nice to │
│ your printer making formfeeds, table of contents and other nice │
│ stuff. But what the heck - you only want to read this once - the │
│ help pages in the editor ought to do the rest. :) │
│ │
│ I hope you actually managed to read the DOC in spite of my awful │
│ grammar! I know it turns out a smile once in a while. As long as │
│ you can understand what I mean, I don't really give a damn... │
│ │
│ If you want to contact me for some (legal only!) reason, you can │
│ write to the following snail mail address: │
│ │
│ │
│ Jens-Christian Huus │
│ Tranegaardsvej 71 a │
│ 2900 Hellerup │
│ Denmark │
│ │
│ │
│ FidoNet: 2:236/86.22 (Kilroy BBS) │
│ │
│ │
│ THE BORING STUFF │
│ ──────────────── │
│ │
│ All files in the archive should be distributed in their original │
│ form - it is forbidden to modify anything. The player may not be │
│ used commercially in any way without permission from the author. │
│ │
│ The names Vibrants, the SirFace System and EdLib are trademarks │
│ of Jens-Christian Huus. Other product and company names are the │
│ trademarks of their respective owners. │
│ │
│ All warranties are disclaimed, including damage to your hardware │
│ and/or software from use of this product. In no event will I be │
│ liable to you for any damages - including any lost profits, lost │
│ savings or other incidental or consequential damages arising out │
│ of your use or inability to use the program, or any other claim │
│ by any other party. │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
Type Year Info
FM Operator Type-S? 1983 Soundchip: YM2128 (OPS) and YM2129 (EGS)
16 voices, 6 operators, 1 waveform (sin)
FM Operator Type-M✔ 1983 Soundchip: YM2151 (OPM)
8 voices, 4 operators, 1 waveform (sin)
FM Operator Type-N✔ 1984 Soundchip: YM2203 (OPN)
3 voices, 4 operators, 1 waveform (sin)
FM Operator Type-L✔ 1984 Soundchip: YM3526 (OPL)
9 voices, 2 operators, 1 waveform (sin)
FM Operator Type-P@ 1985 Soundchip: YM2164 (OPP)
8 voices, 4 operators, 1 waveform (sin)
FM Operator Type-N-A✔ 1985 Soundchip: YM2608 (OPNA)
6 voices, 4 operators, 1 waveform (sin)
FM Operator Type-L-2✔ 1985 Soundchip: YM3812 (OPL2)
9 voices, 2 operators, 4 waveforms
FM Operator Type-L-L✔ 1986 Soundchip: YM2413 (OPLL)
9 voices, 2 operators, 2 waveforms
FM Operator Type-S-2? 1986 Soundchip: YM2604 (OPS2) and YM3609 (EGM)
16 voices, 6 operators, 1 waveform (sin)
FM Operator Type-Z✔ 1987 Soundchip: YM2414 (OPZ)
8 voices, 4 operators, 8 waveforms
FM Operator Type-N-2✔ 1988 Soundchip: YM2612 (OPN2)
8 voices, 4 operators, 1 waveforms
FM Operator Type-L-3✔ 1988 Soundchip: YMF262 (OPL3)
18/n voices, 2/4 operators, 8 waveforms

Register memory maps

FM Operator Type-M / OPM (1983)

image

FM Operator Type-N / OPN (1984)

image

FM Operator Type-N-A / OPNA (1985)

image

FM Operator Type-Z / OPZ (1987)

Note: Light blue highlights differences between OPM image

FM Operator Type-N-2 / OPN2 (1988)

image

FM Operator Type-L / OPL (1984)

image

FM Operator Type-L-2 / OPL2 (1985)

image

FM Operator Type-L-3 / OPL3 (1988)

image

FM Operator Type-L-L (1986)

image

@jrmoserbaltimore
Copy link

This is an extremely useful reference. I'm working on a phase modulation synthesizer (what Yamaha markets as FM), hardware implementation, and getting an idea of how the various synthesizers differ on a technical level has proven enlightening.

@mmontag
Copy link

mmontag commented Nov 29, 2021

Agreed, I've looked all over and this is the only place I've been able to find a YM2414B / OPZ register map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment