Reverse-engineering the Yamaha DX7 synthesizer’s sound chip from die images
The Yamaha DX7 digital synthesizer was launched in 1983 and have become
“some of the essential advances within the historical past of contemporary well-liked music”1.
It outlined the sound of Nineteen Eighties pop music, utilized by bands from A-ha and Michael Jackson to Dolly Parton and Whitney Houston.
The DX7’s electrical piano sound might be heard in over 40% of 1986’s prime hits.2
In comparison with earlier synthesizers, the DX7 was compact, cheap, straightforward to make use of, and supplied a brand new soundscape.3
Whereas digital synthesis is easy these days, microprocessors4
weren’t quick sufficient to do that within the early Nineteen Eighties.
As an alternative, the DX7 used two customized chips: the YM21290 EGS “envelope” chip generated frequency and envelope information,
which it fed to the YM212805 OPS “operator” chip that generated the sound waveforms.
On this weblog submit, I examine the operator chip and the way it digitally produced sounds utilizing a method referred to as FM synthesis.6
21
I created the high-resolution die photograph under by compositing over 100 microscope images.6
Across the edges, you may see the 64 bond wires hooked up to pads; these join the silicon die to the chip’s 64 pins.
The chip has one layer of steel, seen because the whitish strains on prime. (Energy and floor are the thick steel strains.)
Beneath the steel, the polysilicon wiring layer seems reddish or greenish.
Lastly, the underlying silicon is grayish.
The general structure of the chip is dense rectangles of circuitry with the house between them used for sign routing.
I’ll focus on these circuitry blocks intimately under.
Die photograph of the DX7’s YM21280 Operator chip. Click on this photograph (or another) for a magnified model.
The photograph under exhibits the built-in circuit with the steel lid eliminated, displaying the silicon die inside.
The pins have been flattened within the photograph; they’re usually bent downwards, however in a staggered sample.7 The 4 rows of pins make this a quad in-line
package, with twice the pin density as an everyday DIP chip.
Because of this, this 64-pin chip has a smaller bundle than an ordinary 40-pin DIP chip.
The built-in circuit bundle with the steel lid eliminated, revealing the silicon die. Pin numbers are printed on the bundle, which is uncommon.
Analog and digital
Within the Nineteen Sixties and Nineteen Seventies, synthesizers had been largely analog.8
An oscillator was managed by the keyboard, producing a wave on the acceptable frequency.
This sign was fed by means of a filter, which formed the frequency spectrum to supply the specified tone high quality (timbre).
Lastly, the sign had its quantity formed by an envelope generator that
made the amount ramp up when the important thing was pressed, and die off steadily when the important thing was
launched.9
An analog synthesizer was constructed from elements reminiscent of resistors, capacitors, and op-amps, with analog voltages because the
indicators.
One drawback was that the analog synthesizers wanted to be tuned since these part values may drift over time.
One other drawback was that the advanced circuitry generated one notice, so analog synthesizers had been sometimes monophonic,
producing a single notice at a time.
The features of an analog synthesizer had been sometimes managed by patch cords, potentiometer knobs, and switches, which
allowed all kinds of sounds to be produced.
This made it tough to pick the specified sound, since all of the parameters wanted to be set manually.
Digital synthesis supplied a totally totally different method of producing sounds.
The sound values had been produced digitally by an algorithm that generated numeric values.
These values had been transformed to the output sign voltages by a digital-to-analog converter (DAC).
Digital synthesizers solved most of the issues of analog synthesis:
they may simply play a number of notes without delay (i.e. polyphony), configurations might be saved as digital recordsdata,
they might be managed digitally10, they changed precision analog elements with cheaper digital circuits,
and so they produced new lessons of sounds.
The DX7 wasn’t the primary digital synthesizer, nevertheless it was the primary to attain industrial success. It turned one of many
best-selling synthesizers ever, with over 150,000 bought.
FM synthesis
The DX7 makes use of FM synthesis to generate its sounds.11
The thought is that you simply begin with a sine wave (the provider sign) and perturb it with one other sign (the modulating sign).
The modulating sign modifications the part (and thus the frequency) of the provider, creating advanced harmonic buildings.
The digital implementation of frequency modulation begins with a lookup desk that holds a digitized sine wave.
By stepping an index by means of the desk at a particular charge, you may produce a sine wave of a hard and fast frequency.
To make this concrete, suppose the desk is 4096 entries lengthy and the index is up to date at 40960 Hertz.
In case you increment the index by 100 every time, you will cycle by means of the desk 1000 instances each second, so a sine wave at 1 kHz will probably be produced.
The index represents the part of the sign: because the index strikes by means of the desk, this corresponds to a part of 0 to 2π
and an output of sin(0) by means of sin(2π).
Altering the increment worth controls the frequency. For example, an increment of 44 would produce 440 Hz.12
The subsequent step is to modulate the output by including a modulation sign to the index.
When the modulation sign will increase, the index will transfer by means of the
desk sooner, growing the output frequency. When the modulation sign decreases, the index will step by means of extra slowly, lowering the
output frequency.
Digital synthesis might be applied with easy {hardware}:
a sine-wave desk, an increment worth that controls the frequency,
and an adder that provides the increment to the desk index (part angle) every time step.
Frequency modulation might be applied by one other adder so as to add the modulation worth to the desk index (part angle).
The interactive device under illustrates FM synthesis and the results of fixing the modulation frequency and quantity of modulation.13
The modulation sign is proven in yellow and the output is proven in purple. (The provider is mounted at 440 Hz.)
Low ranges of modulation distort the output waveform, whereas excessive ranges create very advanced waveforms.
If the modulation and provider frequencies have integer ratios, the output is periodic.
However a detuned modulation frequency leads to a posh, extra bell-like sound.
Modulation stage: 1
Modulation frequency ratio: 2
As you may see, a single modulator produces a wide range of timbres and complicated, unpredictable waveforms.
Nevertheless, the DX7 gives a number of modulators mixed in varied methods, making the sounds vastly extra diversified.
For every notice, the DX7 gives six oscillators (referred to as operators) that may be mixed in 32 alternative ways (referred to as algorithms), proven under.
For instance, in algorithm 1, operator 6 modulates operator 5 which modulates operator 4 which modulates operator 3, which produces a sound.
In the meantime, operator 2 modulates operator 1, producing a second sound.
Different algorithms mix the six operators in several methods.
The extent of every operator is managed by a special envelope, so the notice’s timbre can evolve in advanced methods over time.14
Contained in the DX7
The DX7 can play 16 notes without delay and every notice has 6 operators, so there are 96 oscillators/operators in complete.
Nevertheless, the circuitry operates sequentially, updating one oscillator and computing one operator at a time.
The DX7 shops the present index (part) values for every of the 96 oscillators however shares the circuitry that makes use of these values.
As an alternative of RAM, the DX7 makes use of shift registers to carry information, specifically 96-stage shift registers to carry the 96 part values.
This strategy drastically reduces the {hardware} necessities in comparison with utilizing 96 separate oscillator circuits.
The diagram under exhibits the primary architectural elements of the DX7, with the elements applied within the operator chip highlighted.
(The diagram, from the patent, is sophisticated nevertheless it exhibits the essential options.)
Within the higher left, the keyboard circuitry detects when a key’s performed, producing a key code (KC), and a key-on sign (KON).
The important thing code determines the frequency quantity, the increment used to compute the part.
The part generator (blue) provides the increment to compute the part, and the tone generator (yellow) produces the output sound worth.
The setting part within the decrease left gives the person interface to configure the synthesizer.
Within the decrease proper (inexperienced), the sequence management generator sends management indicators to the tone generator to implement the chosen algorithm.
In additional element, the part generator (blue)
implements the part counters for the 96 digital oscillators. The “frequency quantity generator” within the envelope chip gives the increment values to the adder. The part
values are saved within the 96-stage shift register.
The tone generator (yellow) is the place the modulation occurs. It takes the part values, modulates them, and converts them to sine waves, producing the output sound worth.
It additionally modifies the extent of the indicators, as specified by the envelope generator.
The sequence code generator (inexperienced) generates management indicators (A, B, C, D, E, S) that choose how modulation takes place at every step.
The implementation of those elements will probably be described in additional element under.
Logarithms and exponentials
The chip makes use of logarithms and exponentials for most of the inside values.
The underlying drawback is that multiplication is far more durable to carry out with {hardware} than addition, particularly with Nineteen Eighties-era know-how.
The answer is that the chip makes use of base-2 logarithms in lots of locations as a result of including logarithms is equal to multiplying the values.
(The chip makes use of lookup ROMs together with bit shifting to acquire the logarithms and exponentials.)
The primary position for logarithms is within the frequency enter to the chip: as a substitute of a part increment worth, it receives the base-2 logarithm of the increment.
The motivation is that notice frequencies are associated exponentially: as an illustration, going up one octave doubles the frequency.
Thus, shifting a notice requires multiplying the frequency.
Because the envelope chip represents frequencies as logarithms, the multiplication turns into a fast addition. The envelope chip then passes the
corresponding part increment to the operator chip as a logarithmic worth. The operator chip makes use of an exponential look-up ROM to transform this worth
again to a linear worth.
The second position for logarithms is to use the envelope that shapes the sign’s amplitude.
The envelope is a time-varying multiplicative scale issue, scaling the amplitude to, say, 70% or 30%.
To keep away from multiplication, the logarithm of the size issue and the logarithm of the sign are added. A second exponential look-up ROM converts the consequence
again to a linear worth.
The envelope is supplied to the operator chip by the envelope chip in logarithmic kind.
The logarithm of the sine-wave sign is conveniently obtained by storing log2(sin(x)) within the waveform ROM as a substitute of sin(x), so the logarithm is obtained “free of charge”.15
A take a look at the die
The diagram under labels the pins and the primary practical blocks of the chip.
The shift registers are the biggest blocks of the chip, particularly the part shift registers within the higher left.
ROMs are the second-largest blocks, particularly the sine ROM and the 2 an identical exponential ROMs.
Adders present a lot of the logic circuitry; there is not a lot “random” logic in comparison with a processor chip, as an illustration.
The chip has a number of bit shifters that shift a numeric worth, multiplying or dividing it by an influence of two.16
On this part, I take a look at the low-level circuitry of the die and the way the features are applied.
Die with the pins and main practical blocks labeled. (Click on for a bigger model.)
Shift registers
The primary part of the chip is storage: the parameters for every operator, the part counters for every oscillator, the output values for every
notice, and so forth.
The storage just isn’t applied as RAM or mounted registers as you would possibly anticipate, however as loops of shift registers with bits continuously transferring in a cycle.
The thought of a shift register is that it consists of plenty of levels, say 16. Throughout every clock cycle, the bits are shifted, with every bit transferring to
the subsequent stage. One bit exits the shift register. This bit (or a brand new bit) might be fed into the shift register enter, and it’ll seem on the output
16 clock cycles later.
Because the circuitry works on one oscillator/operator at a time in mounted order, shift registers are an environment friendly method of storing information and offering
it on the proper time, with out the necessity for addressing logic.
In different phrases, throughout every time interval, the suitable information pops out of the shift registers for processing.
The info (unmodified or modified as acceptable) is then fed again into the inputs of the shift register to move by means of one other cycle.
For instance, every of the 16 notes requires 8 bits of configuration storage: 5 to specify the algorithm and three to specify the suggestions stage.
This storage is applied with 8 shift registers, every 16-bits lengthy, as proven under.
To pick out an algorithm, the exterior CPU writes the suitable worth into the shift register.
Word that in contrast to RAM, entries within the shift register can’t be learn and written arbitrarily. The system can solely use values after they seem on the shift register output.
The configuration information shift registers are organized as eight 16-bit shift registers.
The schematic under exhibits how one stage of the shift register is applied.
The chip makes use of a two-phase clock. Within the first part, clock ϕ1 goes excessive, turning on the primary transistor.
The enter sign goes by means of the inverter, by means of the transistor, and the voltage is saved within the capacitor.
Within the second part, clock ϕ2 goes excessive, turning on the second transistor. The worth saved within the capacitor goes by means of the second inverter,
by means of the second transistor, and to the output, the place it enters the subsequent shift register stage.
Thus, in a single clock cycle (ϕ1 after which ϕ2), the enter bit is transferred to the output.
(The circuit is much like dynamic RAM within the sense that bits are saved in capacitors.
The clock must cycle earlier than the cost on the capacitor drains away and information is misplaced. The inverters amplify and regenerate the bit at every stage.)
Schematic of 1 stage of the shift register.
The diagram under exhibits the bodily implementation of 1 shift register stage.
It’s kind of complicated as a result of there are three layers: the whitish steel on prime, doped silicon areas on the underside (which seem outlined in black), and polysilicon strains within the center (which seem reddish or greenish).
Transistors are fashioned when a polysilicon line crosses doped silicon.
A capacitor is created equally, with a polysilicon line and doped silicon forming the 2 plates of the capacitor.
An inverter is created from a transistor that pulls the output to floor, together with a pull-up resistor. (The pull-up resistor is definitely one other transistor,
specifically doped to make it a depletion transistor.)
Implementation of 1 little bit of the shift register. This matches the sooner schematic, however exhibits the elements of the inverters.
ROMs
The subsequent constructing block of the chip is ROM storage, used for the numeric look-up tables and different functions.
One ROM computes the log2 sine for the waveform.
The chip has two an identical exponential ROMs computing 2x.
One converts the log-frequency increment worth right into a linear increment worth.
The second converts the log waveform worth right into a linear waveform worth.
An algorithm ROM defines the 32 algorithms, specifying the conduct of every of the 6 operators in every algorithm.
One other ROM modifications the conduct of various notes and operators in a method that’s nonetheless a thriller to me.
A ROM is organized in a grid. At every place, silicon is doped to both create a transistor or no transistor, representing a 0 or 1.
In a typical ROM, 5 deal with bits energize one among
32 vertical choose strains to pick one column of the ROM.
The rows are organized in teams of 8 and
three extra deal with bits choose one row from every group to yield output bits.
The diagram under exhibits a part of the ROM circuitry.
The magnified portion has been coloured to point out the bits.
The vertical column choose strains of polysilicon are coloured yellow.
The ROM is programmed by the sample of doped silicon (blue).
A transistor (purple) is fashioned when a polysilicon line crosses a doped silicon area; the transistors are indicated in purple and point out the bit sample.
Closeup of the log-sine ROM displaying particular person bits.
The ROMs use a number of tips to cut back house. Duplicate rows are folded collectively, reminiscent of high-order bits which might be zero for a variety of values.
The sine ROM apparently makes use of delta encoding for alternating values; for the reason that delta values are small, they’ve plenty of zero bits that may be folded.
Because of this, the values saved within the ROM aren’t apparent from the bit patterns.
I am nonetheless investigating the ROM representations and can focus on them later.
Adder
One other key constructing block of the chip is the adder, which sums two binary numbers.
The chip has a number of adders: for the part accumulators, contained in the operators, and to use the envelope.
A multi-bit adder is constructed from full adders, a circuit that provides two bits
(together with a carry-in bit), and produces a sum bit (together with a carry-out bit).
The diagram under exhibits how a one-bit full adder is applied, including bits A and B together with a carry-in, producing an output sum bit and a carry bit.17
Word that the outputs are inverted; different components of the circuitry cope with that.
Construction of the full-adder circuit used within the chip.
By combining a number of one-bit adders, multi-bit binary numbers might be added as proven within the 23-bit adder under.
Word that the adder is at an angle relative to the shift registers. This can be a intelligent trick for efficiency.
One drawback with adders is coping with carries, which can must propagate by means of all of the bits. (The binary equal of needing to repeatedly carry the 1 when computing 999999+1.)
The answer is to interrupt the sum into 6 components. Solely 4 bits of every sum are added in every clock part, so the carry solely must propagate by means of 4 bits reasonably than all 23. The subsequent chunk is added within the subsequent clock part, and so forth.18
The part adder is on the left of the shift registers that maintain the 96 part values.
Bit shifter
The ultimate constructing block that I am going to focus on is the bit shifter, which shifts a binary worth left or proper numerically, which is equal to
multiplying or dividing by an influence of two.
A typical shifter is in-built two layers: the primary layer shifts by 0, 1, 2, or 3 positions.
The second layer shifts by 0, 4, 8, or 12 positions. The mix of the 2 layers permits any shift between 0 and 15 bit positions.
The diagram under exhibits a part of the shifter that shifts by 0, 1, 2, or 3 positions, managed by the horizontal strains.
I’ve highlighted one of many bits in inexperienced. If the “shift 0” line is activated, the leftmost inexperienced transistor (circled) will activate and the inexperienced enter bit
will exit unshifted on the first output place.
Likewise, if the “shift 1” line is activated, the second inexperienced transistor will activate and the inexperienced bit will exit on the second place, shifted one place to the suitable.
The “shift 2” and “shift 3” strains will trigger the inexperienced bit to exit two or three positions to the suitable.
The remaining transistors (circled in black) act in the identical method to shift the opposite bits.
The result’s that each one the bits will move straight throw (shift 0), or be shifted 1, 2, or 3 positions to the suitable.
Element of a shifter circuit.
Shifters are utilized in mixture with the exponential ROMs to compute 2x.
The ROM is utilized to the fractional a part of x, whereas the shifter is managed by the integer half.
That is way more environment friendly than utilizing a big ROM to search for the entire worth.
One other shifter gives a shift of 0 to six bits to scale the operator suggestions worth.
A shifter additionally scales the output worth to extend the dynamic vary.
Combining and modulating operators with an algorithm
The DX7 generates every notice by combining and modulating six operators (oscillators) in accordance with a specific algorithm.
This occurs sequentially: the chip processes operator 6 for channels 1 by means of 16, then operator 5 for all of the channels, and so forth, ending with operator 1.
This cycle of 96 operations repeats, offering new sound values 49096 instances a second.19
The diagram under exhibits a typical algorithm. Operator 6 modulates operators 4 and 5, whereas operator 3 modulates operators 1 and a couple of, in addition to itself.
Operators 1, 2, 4, and 5 produce outputs, that are mixed to create the ultimate sound worth.
This part discusses the circuitry that performs the modulations for the desired algorithm.
Algorithm #19 combines the 6 operators in a particular method.
The diagram under exhibits the implementation of the circuitry to course of operators.
The decrease “operator” field is the circuitry beforehand mentioned:
the primary adder provides the modulation worth f(ωmt) to the present part worth kωt and appears up the worth within the sine desk. The second and third adders apply the envelope.
Lastly, the log/linear converter is applied by the exponential ROM and shifter described earlier.
The higher half of the diagram determines the suitable modulation worth f(ωmt) for the chosen algorithm and operator.
This circuitry is sophisticated, since there are 5 totally different instances that the circuitry should deal with, chosen by the
selector.20
The highest circuit (selector enter 5) implements the suggestions of an operator to itself.
To offer suggestions, the earlier two values are saved in 16-stage shift registers,
scaled by the suggestions stage parameter (FBL), and output because the modulation worth.
(Two earlier values are averaged to stabilize the suggestions.)
Because the 16 channels are processed in sequence, the 16-stage shift registers retailer the suggestions values till the subsequent cycle.
The subsequent circuit (selector 4) makes use of the worth of the self-feedback operator to modulate one other operator.
Selector 3 gives a shift register and adder to sum or delay values. (It’s the place a number of values are summed to supply the ultimate output.)
Selector 2 permits a sum for use for modulation.
Selector 1 is the straightforward case the place the earlier operator gives the modulation (e.g. 6 modulating 5).
Lastly, if no worth is chosen, the sign stays unmodulated.
Management indicators A, B, C, D, and E choose the precise sign paths.
The diagram under exhibits the implementation of the modulation circuitry on the die.
This circuitry corresponds to the higher a part of the patent diagram above; the part numbers match the patent numbers.
This circuitry occupies the center portion of the die,
with the shift registers taking over the majority of the house.
The adders and suggestions stage shifter are additionally seen.
Implementation of the modulation circuitry on the die.
The algorithms are specified by the algorithm ROM (under). This 192×9 ROM produces 9 management indicators for the 6 operators within the 32 algorithms.
The 16-stage shift register described earlier holds the chosen algorithm numbers and gives the enter to the ROM.
Curiously, it seems that the chip permits every of the 16 notes to make use of a special algorithm, despite the fact that the DX7 doesn’t help this function.
The algorithm ROM. The circuitry on the prime decodes the deal with (algorithm and operator quantity), choosing a column from the physique of the ROM under. The 9 outputs (A, B, C, D, E, and S) are on the left.
Conclusion
The DX7 was a groundbreaking synthesizer and this chip was on the coronary heart of it, so in a way this chip was liable for the 80’s sound.
Learning the chip’s die reveals some attention-grabbing circuits.
Uncovering the secrets and techniques of how the chip operates might assist construct extra correct DX7 emulators.
The chip is advanced and this text simply scratches the floor so I plan to check the chip in additional element. Specifically, I intend to extract the info
from the ROMs to seek out out precisely how the waveforms are represented.
In any case, I hope you have discovered this deep dive right into a sound chip attention-grabbing.
I announce my newest weblog posts on Twitter, so comply with me @kenshirriff. I even have an RSS feed.
Due to Jacques Mattheij and Anthony Richardson for offering the chip and dialogue.