Yamaha OPL2 reference
Terminology
Term Definition
Operator A single independently controllable oscillator.
Carrier A signal that can be modulated by other signals.
Modulator A signal that is used as a modulation source and generally not directly output.
Slot A set of properties of an operator (e.g. envelope, amplification)
Channel A mix bus that collects the processed signal of a carrier and its modulators.
Capabilities of the OPL family
Type OPL2 OPL3 Notes
Slots 18 36 Some slots are reserved while rhythm mode is enabled.
Channels 9 18 Some channels are reserved while rhythm mode is enabled.
Waveforms 4 8 OPL3 waveforms are backward compatible.
2op Melodic Mode
Channel Modulator Slot Carrier Slot Notes
0 0 3
1 1 4
2 2 5
3 6 9
4 7 10
5 8 11
6 12 15
7 13 16
8 14 17
2op Rhythm Mode
Channel Modulator Slot Carrier Slot Notes
0 0 3
1 1 4
2 2 5
3 6 9
4 7 10
5 8 11
BD 12 15 Pitch affected by channel 6.
Only slot 12 controls volume.
SD 16 Pitch affected by channel 7.
TOM 14 Pitch affected by channel 8.
TC 17 Pitch affected by channels 7 and 8.
HH 13 Pitch affected by channels 7 and 8.
Slot Register Map
Slot Offset Notes
0 - 5 0x00 - 0x05
6 - 11 0x08 - 0x0D
12 - 17 0x10 - 0x15 Used by drums in rhythm mode.
Register Map (read-only: status on 0x388)
Register 0x80 D7 0x40 D6 0x20 D5 0x10 D4 0x08 D3 0x04 D2 0x02 D1 0x01 D0 Description
IRQ FT1 FT2 This register can be reset by writing 1 to RST.
IRQ: IRQ flag.
  • 0: Neither FT1 or FT2 are set.
  • 1: Either FT1 or FT2 are set.
FT1: Timer 1 flag.
  • 0: TIMER1 has not overflowed.
  • 1: TIMER1 overflowed.
FT2: Timer 2 flag.
  • 0: TIMER2 has not overflowed.
  • 1: TIMER2 overflowed.
Register Map (write-only: register to 0x388, then data to 0x389)
Register 0x80 D7 0x40 D6 0x20 D5 0x10 D4 0x08 D3 0x04 D2 0x02 D1 0x01 D0 Description
0x001 TEST WSE TEST TEST: LSI test data
  • Always 0.
WSE: Wave Select Enable (bit 5)
  • Only available on OPL2.
  • 0: use only waveform 0
  • 1: enable waveforms 0-3
0x002 TIMER1 TIMER1: Timer 1 Count
  • 80 µs resolution
0x003 TIMER2 TIMER2: Timer 2 Count
  • 320 µs resolution
0x004 RST MT1 MT2 ST2 ST1 RST: IRQ reset (bit 7)
  • 1: Reset timer and IRQ flags in the status register. All other bits are ignored when this bit is set.
MT1: Timer 1 Mask (bit 6)
  • 0: Timer 1 will not raise IRQ on overflow.
  • 1: Timer 1 will raise IRQ on overflow.
MT2: Timer 2 Mask (bit 5)
  • 0: Timer 2 will not raise IRQ on overflow.
  • 1: Timer 2 will raise IRQ on overflow.
ST2: Timer 2 Enable (bit 1)
  • 0: Timer 2 is stopped.
  • 1: Timer 2 is running.
ST1: Timer 1 Enable (bit 0)
  • 0: Timer 1 is stopped.
  • 1: Timer 1 is running.
0x008 CSM NTS CSM: Speech synthesis mode (bit 7)
  • OPL2 only.
  • 0: CSM is disabled
  • 1: CSM is enabled
  • Not much is known about this mode.
NTS: Note select (bit 6)
  • 0: Operators are active at all frequencies.
  • 1: Operators are active based on bit 7 of FB.
0x020
+ slot register
AM VIB EGT KSR MULTI This is a slot register.
AM: Tremolo (bit 7)
  • 0: Tremolo is disabled.
  • 1: Tremolo is enabled, affected by DAM.
VIB: Vibrato (bit 6)
  • 0: Vibrato is disabled.
  • 1: Vibrato is enabled, affected by DVB.
EGT: Sustain type (bit 5)
  • 0: Release envelope is triggered immediately after the decay envelope.
  • 1: Release envelope is triggered at note-off.
KSR: Keyboard scaling rate (bit 4)
  • 0: Envelope is unaffected by frequency.
  • 1: Envelope is shortened relative to frequency.
MULTI: Frequency multiplier (bits 3..0)
  • 0: Multiply the operator frequency by 0.5
  • 1: Frequency is unaffected
  • All others: Multiply the operator frequency by the specified value
0x040
+ slot register
KSL TL This is a slot register.
KSL: Key scale level (bits 7..6)
  • 0: No attenuation based on pitch.
  • 1: Attenuate the operator by 3dB/octave.
  • 2: Attenuate the operator by 1.5dB/octave.
  • 3: Attenuate the operator by 6dB/octave.
TL: Total level (bits 5..0)
  • Attenuates the operator by TL * 0.75dB
0x060
+ slot register
AR DR This is a slot register.
AR: Attack rate (bits 7..4)
  • Rate at which an operator fades on at note-on.
  • Higher values indicate shorter time.
DR: Decay rate (bits 3..0)
  • Rate at which an operator will fall to the sustain value after attack.
  • Higher values indicate shorter time.
0x080
+ slot register
SL RR This is a slot register.
SL: Sustain level (bits 7..4)
  • Level at which a note will be held until note-off.
  • Attenuation is SL * 3dB
RR: Release rate (bits 3..0)
  • Rate at which an operator will fade out after note-off.
  • Higher values indicate shorter time.
0x0A0
+ channel register
FNUM(L) This is a channel register.
FNUM(L): Frequency number
  • Determines the base pitch of a channel.
  • From Hz: x * 2^(20 - BLOCK) / 49716
0x0B0
+ channel register
KON BLOCK FNUM(H) This is a channel register.
KON: Key on (bit 5)
  • 0: The channel is in note-off state.
  • 1: The channel is in note-on state.
  • The attack envelope starts when transitioning from off to on.
  • The release envelope starts when transitioning from on to off.
  • This acts on all operators associated with a channel.
BLOCK: Block number (bits 4..2)
  • Acts as a power-of-two multiplier for FNUM.
  • See FNUM(L) above for more details.
FNUM(H): Frequency number (bits 1..0)
  • Contains the upper 2 bits of FNUM to form a 10-bit value.
  • See FNUM(L) above for more details.
0x0BD DAM DVB RYT BD SD TOM TC HH DAM: Tremolo depth (bit 7)
  • 0: Tremolo depth is 1dB. 1: Tremolo depth is 4.8dB.
DVB: Vibrato depth (bit 6)
  • 0: Vibrato depth is 7% of base frequency.
  • 1: Vibrato depth is 14% of base frequency.
RYT: Rhythm mode enable (bit 5)
  • 0: Rhythm mode is disabled; channels 6-8 are standard channels.
  • 1: Rhythm mode is enabled; channels 6-8 are used by drums.
BD: Bass drum note-on (bit 4)
  • 0: Bass drum is in note-off state.
  • 1: Bass drum is in note-on state.
SD: Snare drum note-on (bit 3)
  • 0: Snare drum is in note-off state.
  • 1: Snare drum is in note-on state.
TOM: Tom tom note-on (bit 2)
  • 0: Tom tom is in note-off state.
  • 1: Tom tom is in note-on state.
TC: Top cymbal note-on (bit 1)
  • 0: Top cymbal is in note-off state.
  • 1: Top cymbal is in note-on state.
HH: Hi-hat note-on (bit 0)
  • 0: Hi-hat is in note-off state.
  • 1: Hi-hat is in note-on state.
0x0C0
+ channel register
FB CNT This is a channel register.
FB: Feedback amount (bits 3..1)
  • 0: No operator feedback.
  • 1: Feedback factor is π/16
  • 2: Feedback factor is π/8
  • 3: Feedback factor is π/4
  • 4: Feedback factor is π/2
  • 5: Feedback factor is π
  • 6: Feedback factor is 2π
  • 7: Feedback factor is 4π
CNT: Operator connection (bit 0)
  • 0: Operator 1 modulates Operator 2
  • 1: Operator 1 sums Operator 2
0x0E0
+ slot register
WS This is a slot register.
WS: Waveform select (bits 1..0)
  • 0: Sine.
  • 1: Half sine.
  • 2: Abs-sine.
  • 3: Quarter sine.