Electronic music - Gaming synth

From Helpful
Jump to: navigation, search
The physical and human spects dealing with audio, video, and images

Vision and color perception: objectively describing color · the eyes and the brain · physics, numbers, and (non)linearity · color spaces · references, links, and unsorted stuff

Image: file formats · image processing

Video: format notes · encoding notes · On display speed


Audio physics and physiology: Basic sound physics · Human hearing, psychoacoustics · Descriptions used for sound and music

Digital sound and processing: capture, storage, reproduction · programming and codescs · some glossary · Audio and signal processing - unsorted stuff


Electronic music: Some history, ways of making noises · Gaming synth · Notes on audio latency ··· microphones · studio and stage notes · Effects ·

Music electronics: device voltage and impedance, audio and otherwise · amps and speakers · basic audio hacks · Simple ADCs and DACs · digital audio · multichannel and surround ·

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions · (tape) noise reduction


Unsorted: Visuals DIY · Signal analysis, modeling, processing (some audio, some more generic) · Music fingerprinting and identification

For more, see Category:Audio, video, images

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


Intro

So, any digital output pin can make at least squarewave sounds, because digital ports are designed to swing quickly.

But making that that musical on a CPU requires tight timing control that will take cycles away from, well, everything else it should be doing.

Particularly in early there wasn't much speed to go around, so we quickly offloaded sound generation (also video signal generation to separate ICs, timing is significant in both audio and video) to separate ICs.


Even the earliest gaming machines usually had dedicated sound (and graphics) ICs, some of which could do little more than make squarewave beeps.

Later variants on the same idea include the SID chip (which is a subtractive synth), and things started Yamaha introduced FM chips, and things moved fast and made sample-based sound cards feasible and common.

So PSGs are basically precursors to what we'd later call sound cards.


See https://en.wikipedia.org/wiki/Sound_chip


Among the better known:



PSGs

Programmable Sound Generators (PSGs) are some of the ealiest and simplest dedicated sound chips, controlled by a more central CPU.

While the sounds these make are mostly squarewaves, so fairly shrill and simple, some could do more interesting things via e.g. envelope trickery (There is even a simple PCM-like trick that can be done on many of them [1], akin to the SID's PCM trick).


These became fairly cheap, and were were common in early arcade games, some home computers, and more, some using multiple PSGs in combination.


Early on they were discrete, later designs occasionally placed such things on the same die as the CPU, as e.g. in the NES's CPU (see 2A0x below).

You could call those PSGs, but especially now (and especially from chiptune enthusiasts) the term PSG is used more for the dedicated, earlier ones.


AY-3-8910

AY-3-8910 and basic variants (e.g. AY-3-8912 and AY-3-8913) were some of the earliest well known Programmable Sound Generator chips, seen in the MSX, ZX Spectrum Atari ST, Amstrad, varied arcade games, and some early sound cards.

Some used several, e.g. the arcade version of Gyruss had five(verify).


It can produce three squarewaves, has envelopes for each, plus a noise channel.

Note that having an envelope/mixer under fast control means you can actually get a decent approximation of saw and triangle waves as well. There are tricks that allow for simple forms of AM, and lo-fi PCM. These tricks require fast changes so moderate controlling CPU power.


Clones and variants include:

  • AY8930 (AY-3-8930), slightly enhanced, backwards compatible with the AY-3-8910
  • Yamaha YM2149 (official licensed clone) (and variants like YM3439, YMZ294, YMZ284, YMZ285)
  • Toshiba T7766A (official clone, used in some MSXes)
  • https://www.msx.org/wiki/PSG

Clones are still made.


It's still used e.g. by chiptune enthusiasts, and can e.g. be emulated in software and hardware[2] fairly easily.


See also:


SN76489

Sega (Master System, Game Gear, Genesis), arcade games, BBC Micro,

3 square waves, one noise

apparently a competitor with the 8910

https://en.wikipedia.org/wiki/Texas_Instruments_SN76489

Combination designs

Atari TIA

The Television Interface Adaptor is a combined audio/video interface used in the Atari 2600.

It had two oscillators (AUD0 and AUD1), each with

  • 5-bit frequency divider (from 30kHz), which takes some work to make it musical
  • 4-bit audio control register which effectively selected different sorts of waveforms
  • 4-bit volume control register per channel.

Ricoh 2A0x series

The 2A03 / 2A07 are basically the main CPU (contains a MOS 6502 core) used in the NES and Gameboy, extended with some IO, and audio processing unit (APU).

NES mainly used the 2A03 (more fully Ricoh RP2A03) / 2A07, respectively the NTSC and PAL versions that differ only in clock divider.


NES

The NES APU has five single-purpose channels:

  • pulse wave
  • pulse wave
  • triangle wave
  • optionally-looped samples, mostly DPCM
  • noise

http://wiki.nesdev.com/w/index.php/APU

http://famitracker.com/wiki/index.php?title=Sound_hardware#Internal_2A03.2F2A07_channels


Gameboy

Gameboy is very similar but slightly more basic, omitting the triangle wave

  • two square waves with adjustable duty
  • a wave table (32-sample)
  • noise

https://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware


If you like having a physical thing, check out LSDJ for gameboys.

You'll want either

a microSD based reader to put that on, or
~30EUR of gear (e.g. GBxCart) to rewrite a cartridge you don't like (e.g. the shittiest ~EUR5 game you can find), and can do that to (which isn't all). There are a bunch of footnotes to this.



NES Cart sound

The NES cartridge bus has an audio return that is mixed into the output, so some cartridges contained extra sound hardware. Some of similar design, so effectively adding voices, others more sophisticated.


Includes:

  • VRC6 (Konami Virtual ROM Controller 6)
Two PWM channels, one sawtooth
  • VRC7 (Konami Virtual ROM Controller 7)
similar to a YM2413 (OPLL) FM chip
  • MMC5 (Multi Memory Controller 5)
two squarewave channels, an 8-bit PCM DAC
  • N163 (Namco 163)
up to eight channels of 4 to 32 sample waveforms
  • FDS (Famicom Disk System)


http://famitracker.com/wiki/index.php?title=Sound_hardware

http://wiki.nesdev.com/w/index.php/Category:Expansion_audio

Sample based

Super Nintendo S-SMP

The SNES's S-SMP[3], a.k.a. SPC700, is effectively a dedicated sound co-processor.

It has

a CPU core similar to a MOS 6502,
64KB SRAM for (4-bit packed) samples (an ADPCM format that has 16 samples per 9 bytes)
eight channels that can play 16-bit sound, at varied sample speed, panning, ADSR envelope control, echo, filtering, and white noise.


Intuitively, you could consider its capabilities similar to an 8-track MOD tracker.

A decent example of what it can be made to do might be Chrono Trigger's music [4] or a mix like [5]


https://en.wikibooks.org/wiki/Super_NES_Programming/Loading_SPC700_programs

Nintendo 64 RCP / AI

Nintendo 64's media/graphics coprocessor (RCP) includes AI ('Audio Interface') which largely takes waveform data from RAM and puts it in a DAC, but can also do processing on it.

Could do 48kHz and mix many channels, but with increasing amounts CPU and RAM use.

Apparently many games essentially did something MOD-file-like on a sound/sample database, with a handful of voices, because of said constraints.


SID chip

The Sound Interface Device used mainly in the Commodore 64 and Commodore 128 is better known as the "SID chip", and refers to MOS Technology's SID 6581 and 8580 models (there's a spec sheet for a 6582, which seems to be an early 8580 spec).

Both models also have a series of minor revisions (just silicon level?(verify)).


Not only was it one of the earlier chips to do more than basic squarewave bleeps, it was the first subtractive synth seen near gaming and home computers.


The filter is also why it has only wave shapes with noticeably overtones, and e.g. no sine.

The ring modulation also made for some interesting sounds, though was probably mostly used for sound effects.

The characteristic sound of the SID, dirty and somewhat bassy, comes largely from the imperfections of the filter (particularly the 6581's, as the 8580's is cleaner), and is one reason it is still sought after.

(There ware also some programming tricks, possible on other chips but apparently just more habitually applied on SID)


Features:

  • Three oscillators
    • ~16-4000Hz (divided from ~1Mhz clock pin)
    • choice between sawtooth, triangle, pulse, noise, (and one or two combinations(verify))
    • ADSR envelope
  • shared programmable filter
Each voice (and also EXT IN) can be routed through or past the filter
the frequency response varied somewhat bit between chips
uses external capacitors. Exact values varied, affecting the strength of filter(verify)
can be switched between low/high/bandpass, and combine how+high to do a notch
6dB/oct falloff for bandpass, 12 for low and high
can control resonance (not very stable)
can control cutoff
intended for subtractive synthesis approach, and filter cutoff can be varied in realtime
the voice that will be modulated must be set to triangle
oscillator 1 can be modulated by oscillator 3, and only oscillator 3's output can be muted, so unless you want to hear both, you're only interested in this combination
oscillator 2 can be modulated by oscillator 1,
oscillator 3 can be modulated by oscillator 2,
  • volume control (overall, including EXT IN)
  • the oscillators can be synced (1 to 3, 2 to 1, 3 to 2 (which not-coincidentally the same as the modulation combinations))
mostly useful to get another step, so a dual frequency


Playing these comes down to live programming of registers that control the oscillators and filter.

(Within the C64 this was done by their main processor, the 6510 and family variants), but it's not hard doing this with some other TTL-level device (there are some clocking details).


Pins and IO

Playing a SID means programming its registers.

In a C64 that would be its CPU, today you might want to use a microcontrollers, particularly 5V ones since the SID has TTL-compatible voltage levels.


Minimal hookup requirements:

  • 8 data pins
  • 5 address pins
  • CS (TTL level input)
chip select
usually high, taken low for reads and writes (on next Φ2 high?)
  • Φ2
clock, both for oscillators and communication
Should be ~1Mhz.
In the C64 this was divided from a single quartz (which varied slightly between PAL and NTSC because it was also used for video output)
if controlled from an uC, then see if it's possible to divide this from your uC's clock, because if not then it'd have to be an external oscillator which you'd have to do work to keep in sync with your chip select.
e.g. on AVR, use a timer to divide the AVR's own clock (preferably external, in that internal clock's precise frequency varies a little, apparently largely with IC production).
  • Vcc: 5V
  • Vdd: 12V for the 6581, 9V for the 8580
  • Two capacitors on the four filter-cap pins
6581: 470pF
8580: 22nF
actually this is flexible; the choice of capacitance determines the frequency range of the filter.
Larger values means it sits more in the bass frequencies, which you may like.
  • Audio out:
    • AC-coupling (e.g. 1uF electrolytic), because its output is a 3Vpp signal riding 6V DC and you want to remove that 6V
    • add 1kOhm between output and ground
    • you may want an op amp to as a buffer, and attenuate that range


Optional:

  • RES is reset.
If you don't care, tie to 5V (resistor?(verify))
If you care, add the ability to make this low for at least ten clocks.


  • R/W is direction
for write-only, tie to ground
if you want to also read out data, connect to GPIO to allow setting it high


  • Various projects use shift registers (like 74HC595) to be able to control all of data, address, cs, res, and rw from approx 4 output pins rather than approx 16.


  • EXT IN
input impedance of this pin is ~100 KOhms
expects 3V peak-to-peak riding 6V DC(verify) (TODO: check whether 8580 is different)
can be switched through the filter (and use it as a sort of VCF)
can be switched past the filter (e.g. to chain SIDs, though it can make more sense to op-amp-mix them instead)
when not using, you probably want to tie it to ground through a resistor (not directly!(verify))
(instead of leaving it floating, as C64s did. Note that there, disconnecting it at the socket already helped, as leaving it connected just made for a longer usually-unused trace)
also reintroduces DC offset for louder samples on an 8580
when using, AC-couple signals with a 1-10uF capacitor (to avoid currents from DC level differences)


Good idea:

  • bypass capacitors on Vcc and on Vdd
  • op amp on the output (or some other current buffer)
  • Capacitor from EXT IN to Gnd, to reduce noise,
if you use EXT IN, try 1000-2200pF
if you don't use it, higher values make sense (a stronger passive lowpass)
  • if you want the DSP trick, a resistor between EXT IN and Gnd


Options:

  • Various projects out there use a shift register.
This is purely so that you don't need to occupy ~16 pins on your uC.
Which is not strictly necessary - but useful if you want some other pins for other reasons


Debug notes:

  • pay attention to the inverted gates
  • output volume level


See also:

http://www.waitingforfriday.com/?p=661
http://www.sidmusic.org/sid/sidtech3.html

Some inner workings, Imperfections, and differences

Note that in particular the imperfections (particularly the filter's) being unintended, and not well quantified, makes the chip hard to emulate. It sounds too clean if you don't.


This is less true of the relatively poor isolation between the parts (before being amplified) of the the 6581 (and the 8580 to a lesser degree), which means it picked up noise from nearby components (and itself). Within the C64 this could be reduced by disconnecting the EXT IN pin - because much of it was picked up via trace that connected it to the cartridge slot, which few things used anyway.


The waveforms come from the fact that the oscillator is a 24-bit phase accumulator, where pitch comes from programming the lower 16 bits.

Sawtooth is effectively the 12 upper bits
Triangle is some inverting gates to mirror the sawtooth shape
Pulse is a comparator of the top 12 bits
Noise is the upper 12 bits from a PRNG (a Fibonacci LFSR[6], which is irrelevant unless you're designing a chip)

At this point, each is still bits, and selecting multiple waveforms is effectively a binary AND of each (which in some cases is nothing, and combinations with NOISE would essentially stop it).


The envelope

is an 8-bit counter
attack is linear
decay and release are exponential, or rather a piece-wise linear approximation by dividing the clock to the envelope generator


Oscillator sync is done by clearing the accumulator based on the previous one.


"Ring Modulation

remember that ring modulation is two waveforms multiplied.
For analog that means ADC and DAC, or transformers or whatnot
but since here we just have the two values that should be multiplied, you just do that, and the extra tones come out because math.

Quoth the patent:

In order for ring modulation to be audible,
the triangular waveform of oscillator [1] must be selected 
and oscillator [3] must be set to some frequency other than zero.
No other parameters of voice 3 have any effect on ring modulation.

The bit hackery is interesting if you want to replicate this. Yannes:

"Ring Modulation was accomplished by substituting the accumulator MSB 
of an oscillator in the EXOR function of the triangle waveform generator 
with the accumulator MSB of the previous oscillator.
That is why the triangle waveform must be selected to use Ring Modulation."

https://www.kvraudio.com/forum/viewtopic.php?t=167771





The filter is more interesting.

The filter is, in general, not particularly stable.

Different 6581 chips, and revisions, will sound a little different.


The 8580's filter is redesigned and works a little differently and closer to original specs, so is a lot more stable, more reproduceable in general and between its revisions. Its resonance is also stronger.

But also it's cleaner, so musicians might prefer the imperfections of the 6581, as it makes for grittier, dirtier-sounding bass, and you can get more distortion.


The reason it varied so much, according to Yannes:

"The filter is the worst part of SID because I could not create high-gain 
op-amps in NMOS, which were essential to a resonant filter. 
In addition, the resistance of the FETs varied considerably with processing,
so different lots of SID chips had different cutoff frequency characteristics.
I knew it wouldn't work very well, but it was better than nothing 
and I didn't have time to make it better."
"The Filter was a classic multi-mode (state variable) VCF design. 
There was no way to create a variable transconductance amplifier 
in our NMOS process, so I simply used FETs as voltage-controlled resistors 
to control the cutoff frequency. An 11-bit D/A converter generates the
control voltage for the FETs (it's actually a 12-bit D/A, but the LSB had
no audible affect so I disconnected it!)."
"Filter resonance was controlled by a 4-bit weighted resistor ladder.
Each bit would turn on one of the weighted resistors and allow a portion
of the output to feed back to the input. 
The state-variable design provided simultaneous low-pass, band-pass and
high-pass outputs. Analog switches selected which combination of outputs
were sent to the final amplifier (a notch filter was created by enabling
both the high and low-pass outputs simultaneously)."

This is a mixed bag. The dirty nature worked out nicer than intended {{{1}}}, the fact that sound is not so predictable less so.



PCM, sorta

The 6581 had a design flaw in that it had a DC offset due too poor isolation. This means you could cause a tick in the output - and if you tick fast enough, at audio rates (which took most CPU) could be abused to reproduce samples, pulse modulation style. A few dozen games used this for speech-like effects (e.g. Mission Impossible), and more rarely in-game.


The improved quality of the 8580 meant the flaw that allowed the PCM trick was smaller, so the effect much quieter. This mattered only to things that used it, which was a few games, and a bunch of music composers.

There's a trick to get it back: solder a resistor between EXT IN and ground. Because this is mixed in, it reintroduces the DC offset.



Myths and unchecked things

Some people say that flaws in the 6581 meant that certain combinations were very susceptible to other odd behaviour.

Some simply less predictable (so some things composed on one chip will sound different, sometimes even wrong, on the other chips), some in the area of venerable myth.

In particular that selecting multiple waveforms on one voice will mix them with a binary AND. In theory it could do something like that, but inner workings mean this doesn't work so well. Some people with oscilloscopes have also said it looks fine.


They haven't been produced for a while, so are now harder hard to find. Around 2017 you could get them for EUR30ish, around 2019 they're 40-50.





See also:

http://sid.kubarth.com/articles/interview_bob_yannes.html.

http://insidious6581.blogspot.nl/2015/06/how-on-earth-does-someone-copy-30-year.html

http://insidious6581.blogspot.nl/2015/06/insidious-6581-part-3-when-filter.html

https://insidious6581.blogspot.nl/2016/11/insidious-6581-what-makes-sid-sound.html

https://bel.fi/alankila/c64-sw/index-cpp.html


http://www.lemon64.com/forum/viewtopic.php?t=11002&sid=8a8e9eba4f3e6ef43ceb77a07c6899f3


http://sidplay-residfp.sourceforge.net/docs/classreSIDfp_1_1Filter6581.html



https://en.wikipedia.org/wiki/Sound_chip

http://www.lemon64.com/forum/viewtopic.php?t=49736&sid=63ba1d1aad1b6b50641609bb50e5fcd6


http://www.joogn.de/sid.html

Imitation

Since the internals are all-digital, you can imitate the idealized workings from the specs fairly easily, and there are emulators.

There are even relatively simple hardware emulators running on relatively minimal hardware, such as the (see e.g. [7] or the drop-in SwinSID[8], being firmware for a $3 AVR chip (also needs a DAC).


But they sound cleaner than the real thing, because the filter is either missing or too clean.

So whether you're in it for chiptunes or modular or whatnot (also part of why SID chips are hard to get now) or repairing broken C64s, you can find options that actively try to model the imperfections of the filter (FET abused as a voltage controlled resistor) and possibly more

This includes:

  • teensy3 running reSID library [9]
uses relatively considerable computing power it takes to run its model, so assume it's all it will be doing
EUR25 for the teensy
not a drop-in without a bunch of work around it
  • FPGASID
http://www.fpgasid.de/
drop-in
EUR75 from the site

Registers

Note that envelope and frequency are based on the clock rate. (filter frequency largely on the external capacitors)


There are 29 8-bit registers:

  • 25 write registers
7 registers for oscillator 1
7 registers for oscillator 2
7 registers for oscillator 3
4 registers for the filter
  • 4 read registers
POTX read (updated every ~512 cycles)
POTY read
OSC3 read - reads values from the OSC3 waveform
ENV3 read - reads values from the OSC3 envelope

Under realtime control, reading values from the oscillator and envelope allows some further effects.

Reading from OSC3 set on noise was a nice source of (pseudo-)random numbers in the C64 (where you had no other easy source of randomness).


POTX and POTY were often unused. They are essentially simple ADCs sampling at ~1950Hz (512 clocks), and while wired to the joystick ports (switched between the two ports with a CIA, two bits in DC00), only paddles and mice used them, and neither were common on the C64.


The three oscillator sets are basically identical, except

in what oscillator they sync with, if set
in what oscillator output they ring-modulate with, if set
(maybe another osc3 detail or two?)


Each of the oscillator's register set:

  • frequency, low bits
  • frequency, high bits
  • pw duty cycle, low bits
  • pw duty cycle, high bits
  • control is 8 bits:
GATE - controls the envelope
note that quick gating means the envelope starts not from zero but from whatever level it was at, which under precise real-time control allows some fancier waveforms
SYNC - whether to sync
RING - whether to ring-modulate
TEST - resets at zero (can be useful under real-time control for some better-defined behaviour)
TRIANGLE
SAW
PW
NOISE

selecting multiple of the last four sounds types effect apparently bitwise-ANDed their waves together. It has been suggested it doesn't do exactly that, but even if it did it would not be hugely helpful.

Triangle and a (faster) Square makes for a fairly scratchy sound
Triangle plus saw is pretty quiet.


Which is usually quiet or uninteresting.(verify)

  • AD
4 bits for attack
4 bits for decay
  • SR
4 bits for sustain - 16 levels (linear)
4 bits for release

Attack

2, 8, 16, 24, 38, 56, 68, 80, 100, 240, 500, 800, 1000, 3000, 5000, 8000ms

Decay and release

6, 24, 48, 72, 114, 168, 204, 240, 300, 750, 1500, 2400, 3000, 9000, 15000, 24000ms


Filter:

  • frequency lo
  • frequency high
for cutoff/center
  • res/filt
FILT1 - route OSC1 into filter?
FILT2 - route OSC2 into filter?
FILT3 - route OSC3 into filter?
FILTEX - route EXITIN into filter?
RES0..RES3 - amount of resonance
  • MODE/VOL
VOL0..VOL3: filter's output volume. Useful for tremolo, some combinations of things going past and through the filter, and potential multi-SID stereo effects
LP
BP
HP
OSC3 quiet (useful when using it for modulation)

LP. BP, and HP may be combined, e.g. LP+HP combine to a notch, though most other combinations don't seem to make sense(verify)


See also:

http://www.sidmusic.org/sid/sidtech2.html
http://www.oxyron.de/html/registers_sid.html

Use as a synth

If you're not just piping through SID files (which are essentially commands as-is),


...then you probably want to use it as a synth -- but then you'll need to figure out how you want to control it.

You could adapt MIDI for the SID, but playing from a keyboard you would not be using most parameters, or real-time control tricks.

If you want it to be more than a three-waveform source, you probably want to combine it with a bunch of knobs, and/or some presets.

Putting it in modular synth would would allow open more options, though still not everything.

You might even add things, like an LFO for the filter (e.g. synced to CV / midi clock), arpeggiation, and perhaps modes like separate notes, detuned chorus, or automatic chords, and such.


It's probably interesting to browse through these Existing projects and/or products:


MIDIbox SID

up to 4 SIDs per PIC controller, up to 8 SIDs total
http://www.ucapps.de/midibox_sid.html

Extended variants of that, like [10]

seems to have added an LFO, and some presets (verify)


SIDboard

AVR, SID, and serial interface for register-based playing from e.g. ACID64
https://www.youtube.com/watch?v=qnngOMU8Wp0
https://github.com/Noah1989/SIDboard


SammichSID

MIDI
http://www.midibox.org/dokuwiki/doku.php?id=sammichsid


Cynthcart

cartridge to use an intact C64
https://www.qotile.net/cynthcart.html


Sid Station

MIDI
discontinued
https://www.elektron.se/legacy-products/


SID guts deluxe (modular)

knob/CV for pulse width, pitc, filter freq, filter resonance, filter type, modulation/sync
adds chords (up to 3-voice), inversion
mod?
http://busycircuits.com/alm012/
https://vimeo.com/74211996


HyperSID

http://www.hypersynth.com/hypersid.html


TherapSID

lots of parameters under knobs, reacting to notes from MIDI {{verify}
https://twisted-electrons.com/product/therapsid/
https://www.youtube.com/watch?v=f3_3pWIvdg4


TherapKid

simulated
2 voices (4 oscillators each)
https://twisted-electrons.com/product/therapkid/


HardSID

early (1999) PC card (ISA, later PCI and USB) that does little mode than adapt it for control
https://en.wikipedia.org/wiki/HardSID

Unsorted

http://www.sidmusic.org/sid/sidtech5.html


FM

Yamaha OPsomething chips

Mostly FM synthesis chips with a bunch of channels, and various specializations.

Internally all-digital via some lookup tables (mostly for speed?).

Various have only sine waves, some have more interesting waveforms.


Perhaps best know for some specific OPL used in Adlib and Sound blaster series of sound cards, some game consoles and some arcade games.

If you include variants of these chips, then you include more games, and a bunch of keyboard synths - which could sound a little more interesting when they also added things like filters.

They were also one option to play MIDI - yet FM chip timbre was usually fairly basic, and if this was a PC then you had enough CPU and memory to do something sample/wavetable based.


Many of these chips spit out floating point numbers at ~49.7kHz (comes from a TV rate divided down), so needs a fairly specific DAC external to it - look at the YAC512, YAC513, YAC516, YM3012, YM3014 and others.

A few variants speak something more standard, or have have integrated DACs.


Some of the better known variants:

YM3526, a.k.a. the OPL

9 channels
belongs in the same line as OPL2 and OPL3 (verify), but not really used
http://www.oplx.com/opl.htm


YM3812, a.k.a. the OPL2

9 channels, or rather choice of:
9 2-operator channels
5 2-operator channels with 5 FM drums
each with selectable waveform,freq,a,d,s,r, and two possible combinations of two operators (verify)
four waveforms: sin, half-sin, abs-sin, quarter-sin
can sacrifice three "full" channels for five simpler drum sounds
mono
(SB pro did stereo by having two separate OPL2 chips; some keyboards did for stereo and/or to have drums without giving up polyphony)
https://www.youtube.com/watch?v=QLJSdNYcdpk


YMF262, a.k.a. the OPL3

18 channels, or rather a choice
18 two-operator FM channels (sort of a double OPL2)
6 four-operator FM channels + 6 two-operator FM channels
15 two-operator FM channels + 5 FM drums (which is sort of 20 channels, as some ad people noticed)
6 four-operator FM channels + 3 two-operator FM channels + 5 FM drums
eight waveforms: OPL2's sin, half-sin, abs-sin, quarter-sin, plus alternating-sine, camel-sine, square, logarithmic sawtooth
four internal output channels (A..D), configurably routed to two DAC outputs (A+B, C+D)
keep in mind various games used the OPL3 as an OPL2 just because it covered more hardware out there and was simpler, so there's a little more sound in there.
http://map.grauw.nl/resources/sound/yamaha_ymf262.pdf
http://www.oplx.com/opl3.htm

YMF278

roughly a OPL3, plus mapping up to 4MB of sample playback
https://en.wikipedia.org/wiki/Yamaha_YMF278
http://map.grauw.nl/resources/sound/yamaha_opl4.pdf



Notes:

  • A lot of software of the time didn't really use the rhythm mode (FM drums)
While technically it let you make more sounds at the same time, the simple nature was fairly obvious and you could make better drum sounds yourself (e.g. shaping noise)
  • games of the time regularly used less of the OPL3's ability, because sound engines were often designed to also work on OPL2(verify)
and e.g. 2-operator voices was sometimes the easier way to go even where 4-operator might sound more interesting(verify)
  • but when they did aim for the OPL3, they basicall never used its 18 channels because they chose a fancier-operator mode(verify)


Two-operator voices have two configurations:

adding two waves
basic FM

Four-operator voices have basically four distinct configurations (more configuration-wise, but most are equivalent)


Layer Yamaha keyboards, such as the DX-7, seems to be extensions of the same idea, with 6 operators (32 possible configurations(verify)) plus what seems to be more flexibility in its generation.

https://www.gearslutz.com/board/electronic-music-instruments-and-electronic-music-production/970692-whats-inside-yamaha-dx7.html


Since these are based on lookup tables and entirely digital (no oscillators, no filters), they can be emulated as perfectly as their workings are known. e.g. the DX-7's internals are still not fully known, but most of the common OPL chips were known from basically the start.

https://www.doomworld.com/vb/everything-else/46440-getting-a-classic-opl3-sound-via-windows..

fmmidi
http://opl3.cozendey.com
MAME (OPL2)
DosBox (OPL3)
Zdoom's
it seems the Korg Volca is based on this idea


Akemie's Castle (modular) seems to use a YMF262 (OPL3)


https://www.doomworld.com/vb/everything-else/46440-getting-a-classic-opl3-sound-via-windows..

http://www.shikadi.net/moddingwiki/OPL_chip#Programmer.27s_Guide_to_Yamaha_YMF_262.2FOPL3_FM_Music_Synthesizer




...and a whole bunch of variants beyond this, e.g.

YMF289 is a low-power variant of the YMF262 (OPL3)
YM2413 (OPLL) and derivatives
https://en.wikipedia.org/wiki/Yamaha_YM2413
http://www.smspower.org/Development/YM2413

Arcade?

YM2612 (OPN2) - Sega (MegaDrive/Genesis, some others)
six 4-operator channels(verify)
stripped down version of the YM2608 (verify)
http://www.smspower.org/maxim/Documents/YM2612#chanoparrangements
YMF271
https://minirevver.weebly.com/ymf271opx-music.html
YMF278B
YM3526 OPL
YM2610/B
YMF701, YMF711, YMF715 - OPL3 variants made for PCs
YM2203 OPN
YM2608 OPNA
YM2610 OPNB
YM2164 OPP
YM2414 OPZ
YMF292


(plus practical variants, like YMF7xx series is a few families, mostly most of a sound card on one chip, including OPL3 variant)


Note:

OPL stands for FM Operator Type-L
2 operators per voice (not really true; see OPL3)
OPN series (FM Operator Type-N)
4 operators per voice
OPM series (FM operator Type-M)
4 operators per voice
OPLL series (FM operator Type-LL),
2 operators per voice


OPS series (FM operator Type-S)
OPP (FM Operator Type P)
OPZ (FM Operator Type Z)


https://gist.github.com/bryc/e85315f758ff3eced19d2d4fdeef01c5

https://commons.wikimedia.org/wiki/Category:Yamaha_FM_sound_chips

http://www.vorc.org/text/column/hally/yamahaindex.html


These letters seem to be rough grouping of Yamaha's, and people have guessed at what they roughly mean[11] [12]:

OPLL seems to be "OPL limited" (reduced design)

OPN seems to mean "with noise"

OPN/M chips tend to have 4 operators per voice, OPL usually only 2 operators per voice.


OPL3 practical notes

24-pin, of which:

Vdd, Gnd
8 data (D0..D8 for i/o)
5 inputs (mostly controlling between address write, data write, status read)
5 DAC outs (towards YAC512 or similar)
you usually need only 4; YMF262 is technically a 4-channel chip, so you can connect two YAC512 chips for four separate channels, but in most applications it's used as 2-channel.
input clock (14.318MHz for expected tuning (note: /288=49.7kHz), though should accept 10..16MHz )

and a few more


Early PC sound card notes

Adlib [13] (1987)

YM3812 (OPL2)
(...only, it could not do PCM)


The original line of sound blasters were introduced between 1989 (original Sound Blaster) and 1995ish (64, AWE). After that it became just one of many possible sound card lines


Sound Blaster

OPL2
fully backwards compatible with Adlib (was a selling point for the first generations of sound blaster)
8-bit PCM, mono, up to 23 kHz
(compatible with Adlib)

Sound Blaster 2

OPL2
8-bit PCM, mono, up to 44 kHz

Sound Blaster Pro

double OPL2 (verify)
22 kHz stereo or 44 kHz mono PCM

Sound Blaster Pro 2

One OPL3 instead, otherwise identical


Sound blaster 16

OPL3: a discrete YMF262, a YMF262 core in the CT1747, or the (compatible) YMF289 instead.
some cost-reduced versions had CQM synthesis (to save a chip)
16-bit PCM

Sound Blaster 32, 64 and AWE variants

OPL3: variants with discrete YMF-262, and a YMF-262 core in the CT-1747, or CQM synthesis


(Creative Quadrature Modulaton (CQM) Synthesis is basically a specific emulation of the Yamaha OPL3 hardware FM synthesis chip (used in some later cards, and some cost-reduced sound blasters for OPL compatibility). Note that some variants, like the YMF7xx series, and CQM synthesis, do not sound identical, mostly differing in higher frequencies.)


Also of interest is the Covox Speech Thing, which was a resistor ladder on a parallel port (and a capacitor for a basic lowpass). It puts all the timing on the main CPU, which is not what you generally want, so this was mostly used on trackers, a few games used it only for intro but not during gameplay. Only a few put the work into using it well - see e.g. Pinball Fantasies.