Skip to content

Instantly share code, notes, and snippets.

@bryc
Last active Aug 11, 2022
Embed
What would you like to do?
Collecting info on Yamaha FM soundchips

Yamaha GS1 / GS2 (1981)

  • GS1: 8 operators per voice: 4 carriers with one modulator each (crossmodulation between 2 modulators), 88-key velocity and poly-pressure sensitive weighted keyboard
  • GS2: 4 operators per voice: 2 carriers with one modulator each (crossmodulation between 2 modulators), 73-key velocity sensitive weighted keyboard
  • Non-programmable, uses magnetic "voice cards" to load new sounds. Has vibrato, tremolo, ensemble and equalizer controls.
  • 2x OPC (YM34501) "Operator-Carrier", 2x OPM (YM34502) "Operator-Modulator", 4x EC (YM322) "Envelope Controller", 4x PG (YM344) "Phase Generator"

Yamaha CE20 / CE25 (1982)

  • Uses two 2-op layers per voice (Same as GS2?)
  • 2x OP1/OP2 (YM2011) "Operator", 1x PA (YM2010) "Phase Accumulator"

DX7: YM2128(0) (OPS, FM Operator Type-S) and YM2129(0) (EGS)

  • mid 1983, the original FM synthesizer, direct predecessor to YM2151/YM2612 etc.
  • 16 voices (6-op) (32 in DX1/DX5)
  • Used in DX7, DX9 (firmware reduces it to 4-op, 8 algo), TX7, DX1/DX5 (Dual)
  • DX9 defines algorithms 1-8 as 1,14,8,7,5,22,31,32 (with removed OP 1 and 2). These algorithms are shared in OPN/OPM/OPZ series.
  • Requires two chips, one for operators and one for envelopes

YM2604 (OPS2) and YM3609 (EGM)

  • 1986, Used in DX7 mark II, TX802
  • 16 voices (6-op)
  • Requires two chips, one for operators and one for envelopes

YM2164 (OPP, FM Operator Type P)

  • 1985, Used in DX21, DX27, DX100, FB-01, SFG-05, Korg DS-8, Korg 707, IBM Music Feature Card
  • 8 voices (4-op)
  • The supposedly improved successor to OPM. It is VERY similar. Same pinout and is backwards compatible. In fact, any differences may not affect sound.
  • Most differences are probably firmware-bound. For example DX21 has a "Pitch EG" which DX27/100/FB-01 do not. FB-01 has weird stuff like "AR Velocity Sensitivity". This is all probably specific to the firmware and not the chip. Velocity Sensitivity for example is fully controlled in firmware when processing MIDI.

YM2414 (OPZ, FM Operator Type-Z)

  • 1987, used in synths TX81Z, DX11, YS100, YS200, PortaTone PSR-6300, PSR-80 and DSR-2000
  • 8 channels (4-op), 8 waveforms, two LFOs
  • combines the 8 algorithms of YM2151/OPM with 8 waveforms, allowing for sophisticated sounds. Interestingly, borrows the waveform concept from OPL series but uses custom list of waveforms.

YM2424 (OPZII, FM Operator Type-Z-II)

  • 1989, only known to be used in V50 (uses 2xYM2424 for 16 note polyphony)
  • 8 channels (4-op), 8 waveforms, two LFOs
  • Identical to OPZ but has fixed frequencies down to 0 Hz.

YMF292 (SCSP)

  • 1994, used in Sega Saturn, Sega Model 2/3
  • hybrid FM/PCM, uses 32 channels (4-op, but configurable). Mostly PCM was used.

YMF271 (OPX)

  • 1993, used in Seibu SPI and Mega System 32 arcade boards
  • hybrid FM/PCM, flexible 2/3/4 operators + PCM. Mostly only PCM was used.
  • operators can use a unique set of 7 waveforms plus a custom exernal waveform.
  • FM: quite unique and flexible. 48 operators (slots), split into 12 "groups". Each group can be configured with 4 "sync" modes (4op mode, 2op x2 mode, 3op + 1?, PCM) 2. 28 algorithms - 4 (2op), 8 (3op), 16 (4op). example: 12 channels with all 4-op, 24 channels with all 2-op. "up to 30 sounds".
  • PCM: depending on configuration, PCM can be used extensively; "up to 12 voices".

OPM

YM2151 (OPM, FM Operator Type-M)

  • Year of release: 1983
  • FM: 8 channels (4-op)
  • Used in: Yamaha CX5M SFG-01 (Yamaha PC, 1983), Arcade, Sharp X1 Turbo (1984), Sharp X68000 (1987)
  • Related to: Yamaha YM2164 (aka OPP/FM Operator Type P, derivative used in DX21/27)

Notes

Datasheet. 4 operators per channel, using same algorithms in DX21. The chip is possibly stereo. Channel 3 mode is absent.

Example music

  1. BGM - Enduro Racer (1985) (Arcade, YM2151, SegaPCM)
  2. Passing Breeze - Out Run (1986) (Arcade, YM2151, SegaPCM)
  3. The Heat Waves - Super Monaco GP (1989) (Arcade, YM2151, SegaPCM)
  4. Ending - "Last Drive" - Knight Arms: The Hyblid Framer (X68000, YM2151, OKIM6258)
  5. Time Attack - GP Rider (1990) (Arcade, YM2151, SegaPCM)
  6. Red-Hot Desert - R-Type Leo (1992) (Arcade, YM2151, GA20)
  7. Photonic - Room Service (VOPM VST)
  8. pedalsteeldrummer - Strawberries and Cream (VOPM VST)
  9. Keishi Yonao - Eusion (iYM2151 Demo song)

OPN

YM2203 (OPN, FM Operator Type-N)

  • Year of release: 1984
  • FM: 3 channels (4-op)
  • SSG: 3 channels (YM2149 PSG(?), register-compatible with AY-3-8910)
  • Used in: Arcade, Certain models of NEC PC-6001 (1984)/PC-6601 (1984)/PC-8001 (1985)/PC-8801 (1985)/PC-9801 (1986)
  • Related to: YM2608/OPNA (enhanced version of OPN), YM2612/OPN2 (also based on OPN, but no SSG)

Notes

Datasheet. 4 operators per channel, using same algorithms in DX21 and OPM. The chip is possibly mono. Channel 3 has two special modes:

  1. Sound effect mode: Allows for individual freq control of each operator, and can mute operators for additional polyphony.
  2. CSM (Composite Sine Mode): for speech synthesis (?)

Example music

  1. Main Theme - Space Harrier (1985) (Arcade, YM2203 + SegaPCM)
  2. Opening - Silpheed (1986) (PC-8801, YM2203)
  3. First Step Towards Wars - Ys I: Ancient Ys Vanished (1987) (PC-8801, YM2203)
  4. Opening - Dragon Slayer: The Legend of Heroes (1990) (PC-8801, YM2203)
  5. Title Theme - Rusty (1993) (PC-9801, YM2203 using special Ch3 mode)

YM2608 (OPNA, FM Operator Type N-A)

  • Year of release: 1985
  • FM: 6 channels (4-op)
  • SSG: 3 channels (YM2149 PSG(?), register-compatible with AY-3-8910)
  • ADPCM: 1 channel (8-bit ADPCM format at a sampling rate between 2–16 kHz)
  • RHY: 6 channel (enabling playback of six percussion ADPCM samples/"rhythm tones" from a built-in ROM)
  • Used in: Certain models of PC-8801 (1985)/PC-9801 (1986)
  • Related to: YMF288/OPN3 (stripped down version of OPNA), YM2203/OPN (predecessor), YM2612/OPN2 (very similar, no SSG etc.)

Notes

Datasheet. 4 operators per channel, using same algorithms in DX21 and OPM. The chip is possibly stereo.

Channel 3 has two special modes:

  1. Sound effect mode: Allows for individual freq control of each operator, and can mute operators for additional polyphony.
  2. CSM (Composite Sine Mode): for speech synthesis (?)

Example music

  1. Kono yo no hate de koi o utau Shōjo YU-NO (1996) (PC-9801, YM2608)
  2. Only You - Seikimatsu no Juliet to tachi (1995) (PC-9801, YM2608)
  3. Level 7 - Revival Xanadu II: Remix (1995) (PC-9801, YM2608)
  4. Shout Down - The Scheme (1988) (PC-8801, YM2608)

YM2612 (OPN2, FM Operator type N-2)

  • Year of release: 1988
  • FM: 6 channels (4-op)
  • Used in: Arcade, Sega Mega Drive/Genesis (1988), Fujitsu FM Towns (1989)
  • Related to: YM2608 (enhanced version), YM2203/OPN (predecessor)

Notes

SMSPower documentation. Stripped down/low-cost version of YM2608. 4 operators per channel, using same algorithms in DX21 and OPM. Paired with a 4-channel SN76489 on the Mega Drive/Genesis. One FM channel can be converted to 8-bit ADPCM channel. The chip is possibly stereo.

Channel 3 has two special modes:

  1. Sound effect mode: Allows for individual freq control of each operator, and can mute operators for additional polyphony.
  2. CSM (Composite Sine Mode): for speech synthesis (?)

Example music

  1. BGM - Vapor Trail (1991) (Mega Drive, YM2612, No PSG usage)
  2. Because You're the Number One - Thunder Force IV (1992) (Mega Drive, YM2612 + PSG)
  3. Dreamer - Streets of Rage 2 (1992) (Mega Drive, YM2612 + PSG)
  4. Sortie - Gauntlet IV (1993) (Mega Drive, YM2612 + PSG)
  5. Reincarnated Soul, Part 2 - Castlevania Bloodlines (1994) (Mega Drive, YM2612, No PSG usage)

OPL

YM3526 (OPL, FM Operator Type-L)

  • Year of release: 1984
  • FM: 9 channels (2-op, 1 waveform)
  • Used in: C64 Sound Expander and Arcade games (Bubble Bobble)
  • Related to: Y8950 (additional ADPCM channels, used in MSX expansion cart)

Notes

Datasheet.

Example music

  1. Theme of Terracresta - Terra Cresta (1985) (Arcade, YM3526)
  2. Wonder Flight - Wonder Planet (1987) (Arcade, YM3526)
  3. Vibrants FM - Edlib OPL2 converted tunes (C64/SFX Sound Expander, YM3526)

YM3812 (OPL2, FM Operator Type-L-2)

  • Year of release: 1985
  • FM: 9 channels (2-op, 4 waveforms)
  • Used in: Arcade, DOS sound cards (Adlib, Sound Blaster etc.), Yamaha keyboards
  • Related to: N/A

Notes

Datasheet. OPL-series of chips are 2-op and use different algorithms.

Example music

  1. Staff Roll - Street Smart (1989) (Arcade, YM3812)
  2. Title - Harald Hårdtand i 'Kampen om de rene tænder' (1992) (DOS, YM3812)
  3. Title - Fury of the Furries (1993) (DOS, YM3812)
  4. Title Tune - Lollypop (1994) (DOS, YM3812, Edlib)
  5. Field 1 - Knights of Xentar (1994) (DOS, YM3812)
  6. Battle - Princess Maker 2 (1996) (DOS, YM3812)
  7. Vibrants - Fis3 (Edlib)
  8. DRAX - Street Wise (Edlib)
  9. DRAX - Flash (Edlib)
  10. DRAX - Human Nature 1 (Edlib)
  11. DRAX - Beyond Minds (Edlib)
  12. METAL - Soul Shock (Edlib)
  13. METAL - Plastic Session (Edlib)
  14. METAL - Introism (Edlib)
  15. METAL - Inside the Organ (Edlib)
  16. METAL&DRAX - Breaking Wind (Edlib)
  17. JO - Drums Are Hard To Do (Edlib)

YM2413 (OPLL, FM Operator Type-L-L)

  • Year of release: 1986
  • FM: 9 channels or 6 channels/5 drums (2-op, 2 waveforms)
  • Used in: Arcade, Yamaha PSS-140/PSS-270
  • Related to: JP Master System, MSX/MSX2, VRC7 (6 channel variant used in one NES game: Lagrange Point) (1986-1988)

Notes

Datasheet. Only one channel can be fully programmed. Other must be chose from 15 hard-coded instruments. There are chip variants with different instrument sets, such as YMF281 and YM2423. In general, these are inferior, stripped-down versions of OPL2. TODO: Is there anything programmable? Vibrato and volume? stuff like that.

Example music

  1. Out of Rap - F-1 Spirit 3D Special (1990) (MSX2+, MSX-Music/YM2413)
  2. Opening Theme - GD: Greatest Driver (1988) (MSX2, YM2413)
  3. Theme of Isis - Lagrange Point (1991) (Famicom, VRC7/NES APU)
  4. Ending - Fire Hawk (1989) (MSX2, YM2413 + AY-3-8910)

YMF262 (OPL3, FM Operator Type-L-3)

  • Year of release: 1988
  • FM: 18 channels or 15 channels/5 drums (2-op, 8 waveforms)
  • Used in: Arcade, NEC PC-9801, DOS sound cards (Sound Blaster 16 etc.)
  • Related to: Yamaha YMF7xx series

Notes

Documentation. Has additional capabilities over OPL2, such as 4 more waveforms, double the channels, and ability to use 4-op instruments. Up to six 4-op instruments can be created, and each take up 2 channels. So that gives you 6 4-op + 6 2-op = 12 at its most extreme. Also, there's a separate mode where you can add drums (similar to OPL2). 6 4-op + 3 2-op + 5 1-op = 14 channels. Many musicians program their own drums in trackers using the full FM mode.

Example music

  1. Madbrain - Oskari the Heimfanker (AdlibTracker2)
  2. Madbrain - Oskari goes to Soundblasterland (AdlibTracker2)
  3. Encore - The Abscence of Julia (AdlibTracker2)
  4. Benjamin Gerardin - High Tech Environment III (AdlibTracker2)
  5. naruto - MoonDriver for OPL3 DEMO
  6. Painful Sigh - Miwaku no Chousho (1995) (PC-9801, YMF262)
  7. Sky of the City - Doukyusei 2 (1995) (DOS, YMF262)

YMF278 (OPL4)

  • Year of release: 1994
  • FM: Exactly the same as OPL3
  • PCM: 24 channels of "wavetable synthesis", up to 512 samples, 4 MiB, 16-bit/44.1 kHz
  • Used in: Sunrise MoonSound soundcard for MSX (1995), Yamaha Sound Edge soundcard for IBM PC (1995)

Datasheet. In short, this adds high quality sample playback to OPL3. It has hardware envelope support for the samples, an onboard CPU, a 2 MiB ROM full of stock samples, hardware LFO for vibrato/tremolo, stereo panning, among other hardware features. The sample capabilities may be somewhat comparable to YMF292 as used in Sega Saturn. It could also be imagined as the .XM format mixed with OPL3 in one sound chip.

Example music

Others

YMU757 / YMU757B (MA-1 / MA-1C)

  • Year of release: 1999
  • FM: 4 channels (2-op, 2 waveforms)
  • Used in: Tons of mobile devices (cell phone, PDA)

Datasheet #1. Datasheet #2. Seems quite limited. 2-op only, but has OPLL's half-sine waveform. Contains a built-in sequencer.

MUL=7, TL=63, AR=15, DR=15, SL=15, RR=15, VIB=1, SUS=1, EGT=1, WAV=1, FB=7

YMU759 (MA-2)

  • Year of release: 2000
  • FM: 16 channels (2-op, 8 waveforms) or 8 channels (4-op, 8 waveforms)
  • ADPCM: 1 channel (4-bit, 4 kHz/8 kHz)
  • Used in: Tons of mobile devices (cell phone, PDA)

Datasheet. Boasts much improved FM over MA-1. Appears to have full OPL3 feature set. Contains one very low quality ADPCM channel. Also contains a sequencer. For drum sounds, a single key note can be specified.

MUL=15, TL=63, AR=15, DR=15, SL=15, RR=15, VIB=1, SUS=1, EGT=1, WAV=7, FB=7
+ LFO=3, KSR=1, AM=1, ALG=6, KSL=3, DVB=3, DAM=3

Note: DVB and DAM now have 4 depths instead of the 2 from OPL3.

YMU762 (MA-3)

  • Year of release: 2001
  • FM: 32 channels (2-op, 29 waveforms) or 16 channels (4-op, 29 waveforms + 3 external waveform)
  • PCM/ADPCM: 8 channels (8-bit PCM, 4-bit ADPCM, 48kHz)
  • Used in: Tons of mobile devices (cell phone, PDA)

Datasheet. Improved over MA-2. Much improved sample playback. More channels. More operator waveforms. Two extra 4-op algorithms. plus some tweaks to old ones.

MUL=15, TL=63, AR=15, DR=15, SL=15, RR=15, VIB=1, SUS=1, EGT=1, WAV=7, FB=7
+ LFO=3, KSR=1, AM=1, ALG=6, KSL=3, DVB=3, DAM=3
+ XOF=1, EAM=1, EVB=1, PANPOT=31, PE=1

New parameters do the following: EAM (Enable Amplitude Modulation/Tremolo), EVB (Enable Vibrato), XOF (Ignore key-off for Sustain)

YMU765 (MA-5)

  • Year of release: 2003
  • FM: 32 channels (2-op, 29 waveforms) or 16 channels (4-op, 29 waveforms + 3 external waveform)
  • PCM/ADPCM: 32 channels (8-bit PCM, 4-bit ADPCM, 48kHz)
  • Used in: Tons of mobile devices (cell phone, PDA)

Datasheet. This uses the same FM synthesis engine of MA-3, but adds a filter called Analog Lite (AL) and a speech synthesis (HV/Humanoid Voice) in Japanese or Korean. Also it bumps up the PCM channel count to 32.

YMU786 / YMU790 / YMU791 (MA-7/ MA-7D / MA-7I)

  • Year of release: 2005
  • FM: ?
  • PCM/ADPCM: ?
  • Used in: Tons of mobile devices (cell phone, PDA)

Based on the MA-5's FM synthesis engine. Supposedly has 128 polyphony combined FM and PCM. Has 3D positional sound (AudioEngine), as well as DSP effects (reverb, delay, overdrive etc). 16KB ram instead of 8KB. Can't find much info on it.

YMF825 (SD-1)

  • Year of release: 2011
  • FM: 16 channels (4-op, 29 waveforms + 3 external waveform)
  • Used in: Home appliances (Chinese market)

Datasheet. This appears to be a version of MA-3. It has no PCM or Analog Lite capabilities. Using 2-op instruments does not give extra channels, thus it's probably best to use 4-op instruments.

@siddacious
Copy link

siddacious commented Mar 30, 2020

Thanks for assembling this, it's just the thing I was looking for

@jrmoserbaltimore
Copy link

jrmoserbaltimore commented May 13, 2020

Found OPZ pinout, waveforms, and operator algorithms.

https://www.polynominal.com/Yamaha-YM2414/

@okaxaki
Copy link

okaxaki commented Jul 13, 2020

Great document!!

YM2413 Notes says,

Only one channel can be fully programmed.

Only one instrument can be fully programmed. The programmed instrument can be used simultaneously on multiple channels.

@akulisch
Copy link

akulisch commented Sep 25, 2020

Here's a document for the YM2151 specifying the synthesis and parameters.
http://map.grauw.nl/resources/sound/yamaha_ym2151_synthesis.pdf

@noway2pay
Copy link

noway2pay commented Apr 13, 2021

YMU762 (MA-3): VIB is not gone. It is EVB+DVB now. I put some more info in my fork of this gist.
Actually I managed (sort of) to map OPL-2 to MA-3 (result here: https://www.youtube.com/watch?v=o_FO5D-5-w4).

Excerpt from my converter showing relations between OPL-2 and MA-3 registers:

  //---------------------- MA3 channel definition as defined by Yamaha (== register layout) ------------------------------------

  // 0
  buffer[len++] = 1; // PANPOT ignored (= 0), BO (BO=1 const.)
  // 1
  buffer[len++] = oplEvent->oplVoice.CON1;	// LFO, PE ignored (=0), ALG - only lowest bit present in OPL2

  for (SINT32 i = 0; i < 2; i++) {

    // 2
    buffer[len++] = (oplEvent->oplVoice.OP[i].EGT1 << 1) | oplEvent->oplVoice.OP[i].KSR1;	// SR = 0 as OPL2 has no Sustain Rate; SUS = EGT, KSR = KSR
    // 3
    buffer[len++] = (oplEvent->oplVoice.OP[i].R4 << 4) | oplEvent->oplVoice.OP[i].D4;			// R, D
    // 4
    buffer[len++] = (oplEvent->oplVoice.OP[i].A4 << 4) | oplEvent->oplVoice.OP[i].S4;			// A, S
    // 5
    buffer[len++] = (oplEvent->oplVoice.OP[i].LVL6 << 2) | oplEvent->oplVoice.OP[i].KSL2;	// TL, KSL (KSL OPL2=MA3)

    // 6
    /*
      OPL2: reg BD, AM1, VIB1
      bit 7: Tremolo (Amplitude Vibrato) Depth. 0 = 1.0dB, 1 = 4.8dB.
      bit 6: Frequency Vibrato Depth. 0 = 7 cents, 1 = 14 cents. A "cent" is 1/100 of a semi-tone.
      ----------
      MA3: DAM+EAM, DVB+EVB, Exx = Enable (bit)
        DAM (Depth of amplitude modulation)
          It sets the depth of amplitude modulation (AM)
          DAM = 0 : 1.3 dB
          DAM = 1 : 2.8 dB
          DAM = 2 : 5.8 dB
          DAM = 3 : 11.8 dB
        DVB (Depth of vibrato modulation)
          DVB = 0 : 3.4 cents
          DVB = 1 : 6.7 cents
          DVB = 2 : 13.5 cents
          DVB = 3 : 26.8 cents
    ------------
    Not an exact match, but close enough.
    */
    buffer[len++] = ((oplEvent->oplVoice.OP[i].AM1 ? 2 : 0) << 5) | 0x10 | ((oplEvent->oplVoice.OP[i].VIB1 ? 2 : 1) << 1) | 0x01; // DAM, EAM, DVB, EVB (EAM and EVB = 1)

    // 7
    buffer[len++] = (oplEvent->oplVoice.OP[i].MULT4 << 4);	// MULTI (OPL2=MA3), DT = 0 (no DT in OPL2)
    // 8
    buffer[len++] = (oplEvent->oplVoice.OP[i].WAV2 << 3) | (i ? 0 : oplEvent->oplVoice.FDB3);	// WS (OPL2 = 2 bits, MA more, but OPL2 matches), FDB when 1st OP (OPL2=MA3)
  }

@fusoxide
Copy link

fusoxide commented May 19, 2021

Great document! I think you should add some examples for the MA chips though. I don't have any MA-1 examples, but I have uploaded some ringtones that use the other four chips on YouTube. (Yamaha's own: https://www.youtube.com/playlist?list=PLNNMdt7iKSQhVgPufMkqb8NScLAPt7G-A)

@ajxs
Copy link

ajxs commented May 20, 2021

I did a bit of research on the DX7's technical implementation and compiled it in this article: https://ajxs.me/blog/Yamaha_DX7_Technical_Analysis.html
A lot of this information is already out there in the wild, I just put in the hours to research and compile what I could. It features some information on DX7's DAC implementation, and some trivia on the DX7's sound chips which might be useful to this project.

@KiON-GiON
Copy link

KiON-GiON commented Jun 16, 2021

YMF271 was also used in Jaleco Mega System 32.

@Lenkapo123
Copy link

Lenkapo123 commented Jul 21, 2021

The not much known Yamaha DSR-2000 also uses the OPZ synthesizer chip.

@Beatfox
Copy link

Beatfox commented Nov 18, 2021

Found some info on a YMU788 buried in the service manual for the Samsung SGH-X495 (my first phone - "Dissonance" was my favorite ringtone by far):
https://usermanual.wiki/Document/samsungsghx495servicemanual.288258262

@denjhang
Copy link

denjhang commented Dec 5, 2021

I checked the service manuals of many mobile phones and found that:
YMU787 may only be a BGA package version of MA-5 (64 polyphony)
YMU788 may only be a BGA package version of MA-3 (32 voices)
However, there is no information related to MA-7

@noway2pay
Copy link

noway2pay commented Dec 6, 2021

Some more Yamaha chips for mobile phones that have FM engine:
YMU810 (AE-2L), used in Kyocera K009
YMU824 (AE-3), possibly used in Neo N003
YMU826 (MA-5C2) ?

@ElizabethHudnott
Copy link

ElizabethHudnott commented Apr 10, 2022

The DX21, DX27 and DX100 all have fractional ratio options beyond just the standard 0.5 setting. But the closest thing to that which the OPM document mentions is its coarse detuning parameter, but that parameter only has 4 possible options. So I don't get how they could add fine ratios with a simple firmware update and without changing the FM synthesis engine itself, especially since you note that OPM doesn't have Channel 3 special mode.

Great resource. Good to have all this information in one place.

@ajxs
Copy link

ajxs commented Apr 10, 2022

@ElizabethHudnott I know much more about the DX7's internals than the OPx chips. So take what I'm saying with a pinch of salt. I'm looking through the OPM manual now, and you're right. They don't use the standard terminology anywhere. The coarse frequency ratio seems to be the MUL field. This resource here seems to confirm that:
https://www.msx.org/wiki/Yamaha_YM2164
It shows a 2-bit per-operator field called 'Inharmonic frequency', which isn't mentioned anywhere in the OPM manual.
Is the full frequency ratio value made up by shifting the MUL field left by 2, and then adding the 'inharmonic frequency' value? If you look at the 64 preset frequency ratios in the DX100 manual, every 4th entry is harmonic. It looks like using these two fields to control the harmonic/inharmonic ratio has some logic to it.

@ElizabethHudnott
Copy link

ElizabethHudnott commented Apr 11, 2022

Ah, yes, I've got it now. The 4 bit multiplier combined with the 2 bit coarse detuning do make the 64 ratios in the DX manuals. For instance 3.14 is made with a multiplier of 2 and coarse detuning register value of 2 (=781 cents) and 2 x 1.57 indeed makes 3.14. Not exactly an intuitive way of creating 3.14, so no wonder they don't expose the coarse detuning parameter directly on the UI of the keyboards. I was stuck thinking of it as 3+0.14. It can be tricky to get my head around some of the subtleties even with the manuals in front of me. I should have thought about it a bit harder before posting. Sorry for doubting! Though I'm still unsure what the significance of choosing SQRT(2), PI/2 and SQRT(3) is. It seems to hint at having something to do with phases of 45, 90 and 60 degrees respectively though.

@ajxs
Copy link

ajxs commented Apr 11, 2022

It's not just you. I just looked at the manual again and realised that I got mixed up. The 'Inharmonic frequency' field I mentioned is actually labeled as 'Detune 2'. The difference in terminology between the DX synth UIs and the OPx technical literature is definitely confusing.
That's a very interesting idea about those arbitrary values corresponding to phase angles.
If you compare the design of the OPx chips to the YM21280/90 chips in the DX7, the engineering approach seems totally different. The DX7 chips supported pretty much arbitrary frequency ratios via a 14-bit register per-operator. In contrast, everything about the OPx chips seems designed for a tight budget. For instance, they clearly knew the implications that the 64 sample quarter log-sine table they used in these chips would have on the sound, versus the 256 sample table in the DX7. They could very well have just engineered some clever way to support the most musically useful values while saving on die-space for the chip.

@ElizabethHudnott
Copy link

ElizabethHudnott commented Apr 11, 2022

Ah. I'm working at it from the opposite direction. Started researching the OPN series and am now branching out into the OPL, OPM/P and hopefully the OPZ series and whatever's in the SY77, SY99 and TG77 models, though I haven't yet found any technical programming documentation for OPZ or those later models, only the product manuals. Who knows, maybe one day I'll end up circulating all the way back to the DX7 but so far I've skipped it because it's so different, as you said. First I've heard about 64 length sample tables though.

@ElizabethHudnott
Copy link

ElizabethHudnott commented Apr 12, 2022

Nope. Something funky's going on. I tried to replicate the tables of ratios present in manuals for models such as the DX100 by multiplying the multipliers by the Detune 2 values and it doesn't work. The OPM document says that Detune 2 has multiplicative effects of 1.41, 1.57 and 1.73, which they say are equivalent to 600, 781 and 950 cents respectively. A value of 1.73 exactly produces 1/4 of the list of values in the DX manual correctly, but that amounts 948.9 cents, not 950. Using 950 cents (equivalent to 1.731073...) throws some of the ratios off. Similarly, a value 1.5696 < x < 1.57 produces another correct sequence of ratios, and that's about 780.6 cents. So far mostly so good (but why did they list 950 cents instead of 949?). But for the 1.41ish value the best I can come up with is 1.413 but that's both too low (15.54 instead of 15.55) and too high (2.83 instead of 2.82) and it would also mean that there would be no way to produce a ratio of 14.10 (you just end up with two different ways of producing 14.13).

@ajxs
Copy link

ajxs commented Apr 12, 2022

Good work calculating those values! I wouldn't get too hung up on the exact values as printed in the documentation. The service manuals, and patent documents have all kinds of minor errata. It's best to take them with a pinch of salt I guess. Trust, but verify. Those discrepancies in pitch are well inside the tolerances of what human ears can perceive too.
Speaking very generally, there's lots of lookup tables involved in the internal implementation on the synth chips, so there's all kinds of quantisation error in the calculations. The real character of these chips lie in all of the clever optimisations made by Yamaha's engineers.
Unfortunately, the only way to know for sure how this works would be to decapsulate the chips and see the internal implementation.

@bryc
Copy link
Author

bryc commented Apr 12, 2022

Nope. Something funky's going on. I tried to replicate the tables of ratios present in manuals for models such as the DX100 by multiplying the multipliers by the Detune 2 values and it doesn't work. The OPM document says that Detune 2 has multiplicative effects of 1.41, 1.57 and 1.73, which they say are equivalent to 600, 781 and 950 cents respectively. A value of 1.73 exactly produces 1/4 of the list of values in the DX manual correctly, but that amounts 948.9 cents, not 950. Using 950 cents (equivalent to 1.731073...) throws some of the ratios off. Similarly, a value 1.5696 < x < 1.57 produces another correct sequence of ratios, and that's about 780.6 cents. So far mostly so good (but why did they list 950 cents instead of 949?). But for the 1.41ish value the best I can come up with is 1.413 but that's both too low (15.54 instead of 15.55) and too high (2.83 instead of 2.82) and it would also mean that there would be no way to produce a ratio of 14.10 (you just end up with two different ways of producing 14.13).

It could be that the cent values in the Application Manual were wrong, I heard that somewhere.

I wrote a JS script that tried to do this as well, I gave up though, because a bunch of the sqrt(2) calculations just don't match up for reasons I don't understand, and the first pi/2 is somehow rounded down from 0.785 in their table (I tried Math.floor to address this which seems to work). Might be worth looking at what new MAME is doing as they've recently changed how DT2 is calculated, and Nuked-OPM calculates it in an entirely different way which I don't understand, but might be worth looking at because it uses integers).

for(var i = 0, list = []; i <= 15; i++) // iterate all multipliers
{
    var m = (i === 0) ? 0.5 : i; // treat zero as multiplier 0.5
    list.push((Math.round((1    * m) * 100) / 100).toFixed(2));
    list.push((Math.ceil ((1.41 * m) * 100) / 100).toFixed(2)); // sqrt(2)
    list.push((Math.floor((1.57 * m) * 100) / 100).toFixed(2)); // pi/2
    list.push((Math.round((1.73 * m) * 100) / 100).toFixed(2)); // sqrt(3)
}
list = list.sort((a,b) => a-b); // sort numerically to match official list order

I tried using Math.ceil, which seemed to address a few of the sqrt(2) mismatches without making thing worse, but some are just still too off. In total, my attempt has 12 of 64 mismatching, by seemingly different amounts:

Original - Mine
4.24  x 4.23
5.65  x 5.64
7.07  x 7.05
8.48  x 8.46
9.89  x 9.87
11.30 x 11.28
12.72 x 12.69
15.55 x 15.51
16.96 x 16.92
18.37 x 18.33
19.78 x 19.74
21.20 x 21.15

Another project I found that did some work on this, but doesn't quite get it right either: https://gitlab.com/noyzelab/dx100-freq-ratios-decoded/-/blob/main/fm-ratio-tstr.py

@ajxs
Copy link

ajxs commented Apr 12, 2022

This is really awesome that people have put so much work into understanding the other Yamaha FM synths!
Is it possible that they just printed the values in the manual exactly as they were read out from the synth's UI?
I made an annotated disassembly of the DX7 firmware, which you can find here. If you look here you can see the algorithm used to convert the DX7's internal representation of the frequency ratio values to the string value displayed on the LCD screen. Could it be possible that the exact ratio values are just not represented properly in the DX100's user interface?

Would there be any value in diving into the DX100's firmware? I'm not sure there's as much mystery surrounding the OPP as the YM21280/90. If there's anything in particular you guys would like to know, I could see if there's anything to find out in the firmware.

@bryc
Copy link
Author

bryc commented Apr 12, 2022

Would there be any value in diving into the DX100's firmware? I'm not sure there's as much mystery surrounding the OPP as the YM21280/90

The OPP firmware still holds a lot of mysteries I think (any firmware does: even the DX9 firmware explains how it cripples the OPS into a 4-op), especially the OPZ, which hardly anyone has done hardware tests on, I only really found a memory map for it on a Japanese site, and a largely undocumented disassembly. It's just that the OPP chip itself is a slightly revised OPM, which has a fair bit of documentation and code since it was used in arcades, so there's less incentive to look at the OPP itself (especially since they're harder to come by).

Years ago I used DXConvert to convert some DX100 patches to the OPM format (for the VOPM VST plugin), and I was disappointed in how incorrect they sounded considering it should've been able to convert the chip parameters 1:1. I figured the firmware had a significant hand in how the patches played. Of course the DX21 firmware is the one to look at, since it has the most features (Pitch EG and such), despite using the same underlying chip. I'd like to see one day Yamaha's 4-op synths have proper emulations too. Dexed for example doesn't have the original's portamento at all, which is a shame.

@ajxs
Copy link

ajxs commented Apr 24, 2022

Is there anything in particular you'd like to know about the OPP, or the OPZ? I can try and find the answer for you. I disassembled the DX100 firmware (it's the only OPP synth I own), and I can see some of the overall structure of what's going on at a glance, same with the TX81Z firmware. I doubt I'd do another 'annotated disassembly' again though.

I figured the firmware had a significant hand in how the patches played.

I'm a bit skeptical of that. With the exception of the LFO, Pitch EG, and portamento, everything happens on the LSI chips. There's a lot of character given to the sound by the quirks in the DAC too, which probably accounts for a lot of the DX7's characteristic saturation. As I said above, the real magic of these chips lies in all the interesting optimisations Yamaha did.

@ajxs
Copy link

ajxs commented Jul 23, 2022

If you have time you could add the YM2003 chip, which is featured in the PF series of digital pianos.
Someone uploaded the service manual for the PF10 here: https://drive.google.com/drive/folders/1Rilx5THAfTNWIU38WqJOM4OQ53hhSRyn
I first became aware of the PF series from the Yamaha Synth Chronology page: https://usa.yamaha.com/products/contents/music_production/synth_chronology/index.html

## YM2003 (1983)
- Used in the Yamaha PF series of digital pianos (PF10, PF12, and PF15).
- Two operators in a fixed algorithm: One carrier, one modulator.
- Used in conjunction with the YM2005 key assigner chip.

@minunahein
Copy link

minunahein commented Aug 10, 2022

Thanks a bunch for this info! I've been looking into the speech synthesis features of the sound chips and just fell down this rabbit hole so this collection helped a bunch. I did notice one thing though, the YM2608 datasheet doesn't mention the CSM part so could you help out on that a bit? I read it does ADPCM but I don't know if that's what enables the chip to do the speech synthesizing/analysis.
And also, is there some more information on Humanoid Voice (HV)? Says it responds in Korean or Japanese but what does that mean exactly? Does it mean it can synthesize speech in those languages? I'm having some trouble finding info on that. Again though, thanks!

Edit: Is it a case of just them not outright saying it but it having the capability in doing so? I noticed the same thing with the YM2612 where it didn't say outright the capability of speech synthesis but I did find this video where the sega gensis was used for speech synth: https://www.youtube.com/watch?v=MMRvCyCRjXE

@bryc
Copy link
Author

bryc commented Aug 10, 2022

@minunahein Unfortunately what's there is all I know. This document is really just for comparing and contrasting the most essential aspects of these FM chips. I've not seen any examples of CSM being used for speech, perhaps some yet-to-discover programmer's manual may describe how it should be used? Though for HV, I might be able to help. Those chips were mostly used in old cell phones, usually for ringtones. Yamaha had their own software for creating ringtones, and apparently you could incorporate speech synthesis.

Searching SMAF HV found these examples showing it used for singing:

https://www.nicovideo.jp/watch/sm1653648
https://www.nicovideo.jp/watch/sm1312498
https://www.nicovideo.jp/watch/sm17689147
https://www.nicovideo.jp/watch/sm10428991

Manual for MA-5 Authoring Tool might explain more: https://ia902302.us.archive.org/24/items/at-manual-e/AT_Manual_e.pdf
A guide in Japanese on how to use it (shows how to get the software via WayBack Archive I think)

@ElizabethHudnott
Copy link

ElizabethHudnott commented Aug 10, 2022

I think all the speech mode (CSM/CSW) does is repeatedly reset the phase of many/all of the oscillators (and retrigger the envelopes?) at a very rapid rate using the built in timer. To recreate any actual speech you have to do your own fourier analysis and bring your own codec. People like Aly James (author of the FMDrive YM2612 emulation) have managed to get some interesting vowel sounds out of the chip using this mode.

@minunahein
Copy link

minunahein commented Aug 10, 2022

@ElizabethHudnott @bryc
Thank you! Your responses helped a lot. Reading more about the SMAF HV, it's definitely something very interesting and these nnd users have got lots to offer regarding that. I know there's the MA-7 tag on nnd that does have some videos showcasing the HV too. Also also, someone else helped me found a usage of the YM2612 chip to produce singing! It's so cool! This person's whole YouTube channel is a goldmine.
Cover song with chip: https://www.youtube.com/watch?v=jfgSOMY-SHY
Original song for comparison: https://youtu.be/oURQnsw9yLE

@ElizabethHudnott
Copy link

ElizabethHudnott commented Aug 10, 2022

I don't know what chip it used but Yamaha's FS1R synthesizer was specifically designed for speech. In addition to its FM operators it had a bunch of filtered noise voices, which I suspect is necessary in order to reproduce convincing sibilants and fricatives (or you could use PCM samples, which is what the Amiga did for it's pretty convincing Stephen Hawking emulation). I don't know if they share any chips but Montage and MODX have inherited design features from the FS1R, for example the waveforms and the "skirt" parameter.

@minunahein
Copy link

minunahein commented Aug 11, 2022

@ElizabethHudnott Thanks again! The FS1R uses the YMP706 chip (found that on here and here, not very reliable but a start) and I can't find if Montage and MODOX share that but anyway I can't believe big names like the Aphex Twin and Enigma used the FS1R! This has opened a brand new horizon for me lol~

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