Engineering:Yamaha OPL
![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
(Learn how and when to remove this template message)No issues specified. Please specify issues, or remove this template. |
The OPL (FM Operator Type-L) series are a family of sound chips developed by Yamaha. The OPL series are low-cost sound chips providing FM synthesis for use in computing, music and video game applications.
The OPL series of chips enabled the creation of affordable sound cards in IBM PC compatibles like the AdLib and Sound Blaster, becoming a de-facto standard until they were supplanted by "wavetable synthesis" cards in the early-to-mid 1990s.
Internal operation
The internal operation of the chips is completely digital. Each FM-tone is generated by a digital oscillator using a form of direct digital synthesis. A low-frequency oscillator and an envelope generator drive an FM operator to produce floating-point output for the DAC. Decapsulation of the chips shows two look-up tables, one for calculating exponents and one for log-sine.[1] This allows the FM operator to calculate its output without any multipliers, using the formula [math]\displaystyle{ \exp [\log \sin[\varphi_2 + \exp [\log \sin [\varphi_1] + A_1]] + A_2] }[/math] and two 256-entry look-up tables. Both tables are stored as pairs of values rounded to the nearest whole number, with the second value represented as the difference between it and the first value.
A quarter of the log-transformed sine waveform is stored as a sampled approximation in a 256-word read-only memory (ROM) table, computed by [math]\displaystyle{ 256\times -\log_2 \left(\sin\left(\frac{(x+0.5)\times\pi}{512}\right)\right) }[/math] for values of 0 to 255. The rest of the sine-waveform is extrapolated via its property of symmetry. Scaling the output of an oscillator to a wanted volume would normally be done by multiplication, but the YM3526 avoids multiplications by operating on log-transformed signals, which reduces multiplications into computationally cheaper additions.[2]
Another 256-word ROM stores the exponential function as a lookup table, used to convert the logarithmic scale signal back to linear scale when required, as the final stage where the oscillator-outputs are summed together (just prior to the DAC-output bus), with the modulator waveform always delayed by one sample before the carrier waveform.[3] This table is computed by [math]\displaystyle{ \left(\frac{2^x}{256}-1\right)\times 1024 }[/math] for values of 0 to 255. To compute the exponent, 1024 is added to the value at the index given by the least significant byte of input; this becomes the significand and the remaining bits of input become the exponent of the floating point output.
Chips in the series
OPL
The YM3526, introduced in 1984, was the first in the OPL family, providing a nine channel, two operator synthesizer. A very closely related chip is the Y8950, or MSX-AUDIO, which was used as an MSX expansion. It is essentially a YM3526 with ADPCM recording and playback capability.
The circuit has 244 different write-only registers. It can produce 9 channels of sound, each made of two oscillators or 6 channels with 5 percussion instruments available. Each oscillator can produce sine waves and has its own ADSR envelope generator. Its main method of synthesis is frequency modulation synthesis, accomplished via phase modulation of the phase of one channel's oscillators by the output of another.
The YM3526's output, a sequence of floating point numbers clocked at a sampling frequency of approximately 49716 Hz, is sent to a separate digital-to-analog converter (DAC) chip, the YM3014B.
Overview of a channel's registers:
For the whole channel:
- Main frequency (10 bits)
- Octave (3 bits)
- Note on/off
- Synthesis mode (FM or just additive)
- Feedback (0–7, the modulator modulating itself)
For each one of the two oscillators:
- Frequency multiply (can be set to 1⁄2, 1 to 10, 12 or 15)
- Waveform (Sine)
- Volume (0–63, logarithmic)
- Attack, decay, sustain, release (4 bits each, logarithmic)
- Tremolo (on or off)
- Vibrato (on or off)
- Sustain (on or off)
- Envelope scaling per key (on or off)
- Volume scaling per key (0–3)
There are also a few parameters that can be set for the whole chip:
- Vibrato depth
- Tremolo depth
- Percussion mode (uses 3 channels to provide 5 percussion sounds)
- Composite sine mode (see Sinewave synthesis)
OPL2
![](/wiki/images/thumb/a/a2/YM3812_waveforms_numbered.png/109px-YM3812_waveforms_numbered.png)
In 1985, Yamaha created the YM3812, also known as the OPL2. It is backwards compatible with the YM3526. Another related chip is the YM2413 (OPLL), which is a cut down version.
Among its newly-added features is the ability to pick between four waveforms for each individual oscillator by setting a register. In addition to the original sine wave, three modified waveforms can be produced: half-sine waves (where the negative part of the sine is muted), absolute-sine waves (where the negative part is inverted), and pseudo-sawtooth waves (quarter sine waves upward only with silent sections in between). This odd way of producing waveforms give the YM3812 a characteristic sound.[5]
Limited to two-operator FM synthesis, the chip is unable to accurately reproduce timbres of real instruments and percussive sounds. Melody polyphony is limited to nine voices in melodic mode and six voices in percussive mode.[6]:27.14-17.16
Having little competition on the market at the time of introduction of Adlib and Sound Blaster, the chip became the de-facto standard for "Sound Blaster compatible" sound cards.[6]:27.14
Decapsulated YM3812, showing the die surface
The YM3812 is used with the YM3014B external DAC chip to output its audio in analog form, like with the YM3526.
OPL3
![](/wiki/images/thumb/b/b1/OPL3-Waves.jpg/250px-OPL3-Waves.jpg)
An upgraded version of the OPL2, the YMF262 (a.k.a. OPL3), was released in 1990. It improved upon the feature-set of the YM3812, using four-operator FM synthesis, which produces harmonically richer sound similar to contemporary consumer synthesizer keyboards such as Yamaha DX100.[6]:27.16
The following features were added:[7]
- twice as many channels (18 instead of 9)
- simple stereo (hard left, center or hard right)
- 4 channel sound output
- 4 new waveforms (alternating-sine, "camel"-sine, square and logarithmic sawtooth)
- 4 operator mode, pairing 2 channels together to create up to six 4 operator FM voices
- reduced latency for host-register access (the OPL2 had much longer I/O access delays)
- subtle differences in the sine-wave lookup table and envelope generator to YM3812 (e.g. the modulator waveform on YM3812 is delayed by one sample, whereas both carrier and modulator waveforms on OPL3 are properly synchronized)[3]
The YMF262 also removed support for the little-used CSM (Composite sine mode) mode, featured on the YM3812 and YM3526.[3]
The YMF262's FM synthesis mode can be configured in different ways:[6]:27.16-27.18[7]
- Its basic mode provides 18 two-operator FM channels.
- One setting, common with the rest of the OPL line, converts 3 of the FM channels into a 5-channel percussion set.
- Another setting, introduced with this chip, causes 12 of the channels to be paired up into six four-operator channels. This trades in polyphony for more complex sound formation.
- These two settings above can be used separately or in conjunction, resulting in four total modes:
- 18 2-operator channels
- 15 2-operator channels + 5 drum channels (drum setting on)
- 6 2-operator channels + 6 4-operator channels (4-op setting on)
- 3 2-operator channels + 6 4-operator channels + 5 drum channels (both settings on)
Like its predecessors, the OPL3 outputs audio in digital-I/O form, requiring an external DAC chip such as the YAC512.
Competing sound chip vendors (such as ESS,[8] OPTi,[9] Crystal[10] and others) designed their own OPL3-compatible audio chips, with varying degrees of faithfulness to the original OPL3.
YMF262 was used in Media Vision cards, revised Sound Blaster Pro, Sound Blaster 16, AdLib Gold and Microsoft cards.[4]:45
Yamaha YMF289
Yamaha also produced a fully compatible, low-power variant of the YMF262 in 1995 called the YMF289 (OPL3-L), which targeted PCMCIA sound cards and laptop computers.[11] It was used in some Sound Blaster 16 sound cards made by Creative Technology. The YMF289B is paired with a YAC513 or YAC516 companion floating-point DAC chip.
The YMF289 is fully register-compatible with and retains the feature-set of the YMF262, with a number of differences:[11]
- Supports 5 or 3.3 volt operation.
- The registers can be read or written by the host CPU, whereas on the YMF262 they are write-only.
- 44,100 Hz (44.1 kHz) output sample rate.
- A power-down mode is added.
- Somewhat smaller overall footprint, including DAC, compared to a full YMF262 implementation.
- 33.868 MHz input clock, compared to the 14.32 MHz input clock used for the YMF262.
- Internal linear interpolator.
ESS ESFM
File:ESFM playing MELT1.AMD.ogg ESS Technology's in-house developed derivative, termed ESFM, is an enhanced 72-operator OPL3-compatible clone incorporating two operating modes, a Native mode and a Legacy mode, which controls its feature-set and behavior.[8] In Native mode, ESFM allows 18 4-operator FM voices to be mapped, each with per-operator frequency control and LFO depth,[12] potentially allowing for a significant increase in the complexity of tones generated. The drivers for Windows 9x incorporate their own custom instrument patches which make use of this extended mode. Conversely, Legacy mode provides full backward-compatibility with Yamaha's YMF262.[8] ESFM's output in this mode is moderately faithful to the YMF262 overall, but some tones are rendered quite differently, resulting in unique distortions in the sound and music of some games.
ESFM is available in ESS sound chips starting with the ISA-based ES1688 AudioDrive, up to the PCI-based ES1946 Solo-1E, whereas earlier chips required an external FM synthesizer chip (typically a Yamaha YMF262). ESS's Maestro series of PCI-based sound chips rely on a software implementation of FM synthesis that lacks ESFM's special features.
OPL3-SA, DS-XG, OPL4
Yamaha's later PC audio controllers, including the YMF278 (OPL4), the single-chip Yamaha YMF718/719S, and the PCI YMF724/74x family, included the YMF262's FM synthesis block for backward compatibility with legacy software. See YMF7xx for more information.
Products using the OPL series
The YM3526 was notably used in a Commodore 64 expansion, the Sound Expander, as well as several arcade games, such as Terra Cresta and Bubble Bobble. A modified version of the YM3526 with ADPCM audio known as the Y8950 (MSX-AUDIO) was used in the MSX computer as an optional expansion.
The YM3812 saw wide use in IBM PC-based sound cards such as the AdLib, Sound Blaster and Pro AudioSpectrum (8bit),[13] as well as several arcade games by Nichibutsu, Toaplan and others.
The YM2413 was used in the FM Sound Unit expansion for the Sega Mark III and the Japanese model Sega Master System, as well as the MSX-MUSIC standard, which was released both as separate enhancement cards (such as the Panasonic FM-PAC) and built-in into several MSX2+ and the MSX TurboR computers.
The YMF262 was used in many IBM PC-based sound cards, firstly with the popular Sound Blaster Pro 2 in 1991 and the Sound Blaster 16 ASP in 1992, as well as the Pro AudioSpectrum (16bit).[13] Later models of the Sound Blaster 16 and Sound Blaster AWE series integrated the OPL3 with other chips, with Creative Labs using an OPL3 clone chip, the CQM, integral with other chips in later models from late 1995.[14] It is also used in several arcade games by Tecmo.
The YMF278 was used in the Moonsound card for the MSX, as well as the SoundEdge card by Yamaha for IBM PC compatibles.
Synthesizers
Synthesizers that use the YM3812:[15]
- Yamaha PSR-11 49-keys 16-sounds (1986)
- Yamaha PSR-12 49-keys 32-sounds (1987)
- Yamaha PSR-21 49-keys 16-sounds, 2 steps sliders (1986)
- Yamaha PSR-22 49-keys 32-sounds, 2 steps sliders (1987)
- Yamaha PSR-31 61-keys 16-sounds, additional YM3301 chip[16] for drums (1986)
- Yamaha PSR-32 61-keys 32-sounds, additional YM3301 chip[16] for drums (1987)
- Yamaha PSS-360 49 mini-keys 21-sounds, 5 steps sliders, low-cost mono version of PSS-460 (1986)
- Yamaha PSS-460 49 mini-keys 21-sounds, 5 steps sliders (1986)
- Yamaha PSS-470 49 mini-keys 21-sounds, 5 steps sliders (1987)
- Yamaha PSS-560 49 mini-keys 21-sounds, 5 steps sliders, additional YM3301 chip[16] for drums (1986)
- Yamaha PSS-570 49 mini-keys 21-sounds, 5 steps sliders, additional YM3301 chip[16] for drums (1987)
Synthesizers that use the YM2413 (cost reduced YM3812):[15]
- Yamaha PSR-6 49-keys 100-sounds (1994)
- Yamaha PSS-140 37 mini-keys 100-sounds (1988); the PSS-140 actually uses the YM2420, a slightly modified variant of the YM2413 with different registers[17]
- Yamaha PSS-170 44 mini-keys 100-sounds (1986)
- Yamaha PSS-270 49 mini-keys 100-sounds (1986)
Variants and derivatives
An open-source RTL implementation of the OPL3 was written in SystemVerilog and adapted to an FPGA in 2015.[18]
See also
- List of sound chips
- List of Yamaha products
- Yamaha Y8950
- Yamaha YM2413
- Yamaha YMF278
References
- ↑ "Adlib / OPL2 / YM3812 – iki.fi/o". 11 January 2009. http://yehar.com/blog/?p=665.
- ↑ "OPLx decapsulated". https://docs.google.com/document/d/18IGx18NQY_Q1PJVZ-bHywao9bhsDoAqoIn1rIm42nwo/edit?usp=embed_facebook.
- ↑ 3.0 3.1 3.2 "Data". dev.kewl.org. http://dev.kewl.org/misc/ymf262/ymf262.c. Retrieved 2021-10-07.
- ↑ 4.0 4.1 4.2 Leinecker, Richard C (1994). Making noise : creating sounds on your PC. New York: M & T Books. ISBN 1558513868. https://archive.org/details/makingnoisecreat0000lein.
- ↑ Sanglard, Fabien (2019). "3.6.2. Music". Game Engine Black Book: Wolfenstein 3D. p. 95. https://www.google.co.uk/books/edition/Game_Engine_Black_Book_Wolfenstein_3D/hel6DwAAQBAJ?hl=en&gbpv=1&dq=YM3812&pg=PA94&printsec=frontcover.
- ↑ 6.0 6.1 6.2 6.3 Keyes, Jessica (1997). The Ultimate multimedia handbook. New York: McGraw Hill. ISBN 978-0-07-034530-0. https://archive.org/details/ultimatemultimed00jess/page/n457/mode/2up.
- ↑ 7.0 7.1 "YMF262 datasheet". http://www.fit.vutbr.cz/~arnost/opl/lost+found/ymf262.pdf. Retrieved 2021-10-07.
- ↑ 8.0 8.1 8.2 "Manual". ftp.alsa-project.org. ftp://ftp.alsa-project.org/pub/manuals/ess/DS1878A.PDF. Retrieved 2021-10-07.
- ↑ "82C925(100QFP) PDF Datasheet - OPTi Technologies, Inc.". https://www.datasheets360.com/pdf/-97977721078553128.
- ↑ "Archived copy". http://gd.tuwien.ac.at/linux/alsa/datasheets/cirrus/4236b.pdf.
- ↑ 11.0 11.1 "Info". doc.chipfind.ru. http://doc.chipfind.ru/pdf/yamaha/ymf289b.pdf. Retrieved 2021-10-07.
- ↑ "esfm". https://github.com/jwt27/esfm.
- ↑ 13.0 13.1 "Ad-Lib Sound Card for the Parallel Port". https://www.youtube.com/watch?v=z3DU2mNBa6M.
- ↑ "PC audio for luddites". https://flaterco.com/kb/audio/ISA/index.html.
- ↑ 15.0 15.1 "Meet the little-known "Soundblaster" Keyboards". The 8-Bit Guy, Youtube. https://www.youtube.com/watch?v=QLJSdNYcdpk.
- ↑ 16.0 16.1 16.2 16.3 "Edward D-tech, Yamaha Chips, YM series". Edward D-tech. http://www.dtech.lv/techarticles_yamaha_chips.html.
- ↑ "The Yamaha PSS-140 - a vintage keyboard that sounds like a Sound Blaster card". Preece Music, Youtube. https://www.youtube.com/watch?v=bAxzYN0UpQs.
- ↑ "opl3_fpga". September 28, 2021. https://github.com/gtaylormb/opl3_fpga.
External links
- http://www.oplx.com/ OPL series programming info
- MIDIbox FM, a YMF262-based DIY synthesizer
- AdlibTracker.net Adlib Tracker II (YMF262-Tracker)
- RAD Reality Adlib Tracker (YMF262-Tracker)
- An YMF262 emulator with an online player for OPL3 music.
- OPLx decapsulated (a reverse engineering report)
- OPL3_FPGA GitHub Reverse engineered OPL3 in an FPGA
- Analysis of the OPL3 math
![]() | Original source: https://en.wikipedia.org/wiki/Yamaha OPL.
Read more |