
Yamaha DX-7 synthesizer clone written in SuperCollider - jarmitage
https://github.com/everythingwillbetakenaway/DX7-Supercollider
======
raphlinus
Shameless self-promotion. There's a high performance C++ (with neon simd
acceleration) implementation at [0]. Note, this also compiles cleanly to wasm
and runs in the browser (see the "webaudio" branch). This code is also the
basis of the reasonably popular free "dexed" vst. Some of my analysis of the
DX7 is on the associated wiki as well.

Not to take anything away from the original posting, but if performance is a
goal, this may be interesting.

[0]: [https://github.com/google/music-synthesizer-for-
android](https://github.com/google/music-synthesizer-for-android)

~~~
em3rgent0rdr
Did you make this while at Google?

This seems to be for an Android app. But is there a variant that works as a
LV2 plug-in or even a stand alone Linux app?

I take it this is the Android app:
[https://play.google.com/store/apps/details?id=com.levien.syn...](https://play.google.com/store/apps/details?id=com.levien.synthesizer)

Would be great to have in F-Droid repo.

~~~
raphlinus
I did make it while at Google, and the main focus is an Android app, but the
sound engine is pretty platform-independent. For the LV2 plug-in, you probably
want dexed, which is based on this code (but continues to be developed).

~~~
em3rgent0rdr
Thank for pointing me to Dexed...their github or website didn't have an LV2
download, however, I found Linux x86-64 binary from Distrho and it works great
in Ardour!
[http://distrho.sourceforge.net/ports](http://distrho.sourceforge.net/ports)

Thanks for coding such an important tool!

------
jstewartmobile
Chowning (the father of FM synthesis) is a fascinating guy. Stanford was about
to boot him from the music department right before his FM synth patent was
licensed by Yamaha, and made the university over $25M.

[https://priceonomics.com/the-father-of-the-digital-
synthesiz...](https://priceonomics.com/the-father-of-the-digital-synthesizer/)

~~~
richard_shelton
And if you want to see and hear how musicians used FM synthesis in pre-Yamaha
era then I would suggest to check this video with famous Laurie Spiegel
playing in real-time on Alles synth:
[https://www.youtube.com/watch?v=NChqEEz31eE](https://www.youtube.com/watch?v=NChqEEz31eE)

~~~
jstewartmobile
Oh yeah, almost forgot to mention that the Alles synth wasn't FM. It was
additive, like a fourier transform.

There's a neat little program called SPEAR for creating sounds using additive
synthesis:

[http://www.klingbeil.com/spear/](http://www.klingbeil.com/spear/)

~~~
richard_shelton
Yes, Alles synth is mostly known by its additive synthesis. But don't you hear
some classic FM timbres in the video? Please check this pdf too:
[http://retiary.org/ls/obsolete_systems/Alles_synth_1977.pdf](http://retiary.org/ls/obsolete_systems/Alles_synth_1977.pdf)

------
cmrdporcupine
Frequency modulation (or phase modulation as traditionally implemented) (as in
the Yamaha DX/TX) series tends to produce sidebands with a non-linear response
to the modulator (index) parameter. This leads to both the 'shimmering' and
'nasal' sound of many patches, and in many ways is the "sound of the 80s" (DX
pianos) that many find cheesy. There's a modified form of FM that has a more
'natural' sound, and the same algorithm can be also be used to generate nice
bandwidth limited square, sawtooth, and triangle waveforms for 'analog'
synthesis emulation.

Paper here:

[http://www.aes.org/e-lib/browse.cfm?elib=15506](http://www.aes.org/e-lib/browse.cfm?elib=15506)

I once wrote an implementation of this in C++. It does sound different than
the old Yamaha-style FM. But I was never able to make it into a finished
'synth' product as a VST or whatever.

------
klodolph
Good work! For those unaware how the DX-7 works, it’s simple to emulate a
_similar_ synth but getting the presets to work is a pain. The core of the
DX-7 is little more than some counters and a lookup table for sine waves, but
(unlike subtractive synthesizers) there are a lot of control inputs each with
their own envelopes.

So you could make something similar and get sound out of it in a couple hours,
but you'd have to come up with your own presets, or you could spend a few
months figuring out how the preset parameters map to actual values like
envelope amplitude, timing, modulation levels, et cetera. This project is the
hard version, which (apparently, since I don’t have Supercollider fired up at
the moment, and my DX synth is in storage) correctly gets all the envelopes
and modulation right.

Curious to know how close it is, e.g., does it respond to aftertouch? Not sure
about that. Most of the DX presets I'm familiar with have some fairly
aggressive aftertouch responses.

------
richard_shelton
In DX7 the actual sound was made with custom LSIs. I.e. there is no CPU
involved. And no multiplication inside, Japanese engineers used log/exp sine
tables instead. Also DX7 had sampling rate of 49096 Hz, 12-bit "floating-
point" DACs etc etc. Most of software versions of DX7 don't take these nuances
in account which makes some DX7 purists upset :)

If you, as a DX7 clone developer, want to make happy these 2 or 3 people too,
please, use fixed point calculations, resampling, real ROM data and so on :)

~~~
raphlinus
"No CPU involved" is not strictly true, as the CPU is doing the LFO. You can
observe this by, for example, rapidly moving the data slider and noticing that
the LFO slows down.

I considered doing a super-accurate "dirty" mode but ultimately decided
against, as most of these changes would make it sound worse. One important
subtlety is that after the DAC (which is just sample-and-hold) there's a
Sallen-Key low-pass filter tuned at about 16kHZ, to round off the worst of the
DAC artifacts. Many digital replicas (my own included) miss this, which gives
a harsh brittleness to the sound.

I know dexed added multiple bit depths (this work was done after mine, and I
haven't followed their fork carefully). I don't know about the other aspects
of the signal chain though.

I get where you are coming from, though, and think it would be a good project
for a super-dedicated contributor.

~~~
richard_shelton
Thank you! Didn't knew that about LFO. And I just found your wiki page [1],
it's very informative. So I would like direct any curious reader there :)

[1] [https://github.com/google/music-synthesizer-for-
android/blob...](https://github.com/google/music-synthesizer-for-
android/blob/master/wiki/Dx7Hardware.wiki)

------
flavio81
Just in case somebody wants to know what is a DX7...

The DX7 was the first affordable fully digital synthesizer on the market. It
appeared in 1983 in a world of mostly-analog synthesizers that had polyphony
limited to 8 voices (at _hugely_ expensive prices for an 8 voice model!) and a
limited amount of presets. A typical popular polysynth of the era would be the
Prophet-5, with 5 voices.

Also, only the most expensive analog polysynths were velocity sensitive, and
only one had aftertouch (the sublime Yamaha CS-80 and the Yamaha GX1).

Finally, the analog synthesizers that had no DCO (digitally controlled
oscillators) could have some tuning problems due to temperature changes, etc.

So in 1983 this DX7 synthesizer appears on the market, offering 16 (sixteen!)
voices and 32 presets (expandable to 64 by use of a ROM cartridge) plus this
new stuff called MIDI (that only two or three synths supported by that time).
The typical analog substractive polysynth had two oscillators per voice
(remember, 5 voices was "good", 8 voices was "deluxe" in the early 80s), one
envelope generator per voice, and one filter. This DX7 thing had 6 oscillators
per voice (total = 96 oscillators) and 6 envelope generators per voice (total
= 96 EGs); but no filters.

Also, by that time almost no true synthesizer could give you a decent
(credible) electric piano or flute sound. The DX7 could do very decent
electric pianos, and a very credible flute sound was included as well.

Thus this was a monster synth that sold like hot cakes, so much, that Yamaha
couldn't keep up with demand and many musicians had to wait for one...

The DX7 wasn't the ultimate Yamaha, however; The DX1 was the deluxe model,
with _polyphonic_ aftertouch, 32 voices, balanced outputs, weighted keys and a
much more comprehensive interface. Later the DX5 was released -- a stripped-
down DX1, without the nice interface and no poly aftertouch.

The DX7 was used in massive amounts of songs until the people got tired of the
presets ("why they didn't program it?" is another story worthy of an article).
Later the Roland D50 appeared, with easier-to-create sounds, and the
mainstream abandoned the DX7 and FM synthesis.

------
brudgers
Supercollider home:
[https://supercollider.github.io/](https://supercollider.github.io/)

------
deusofnull
Awesome job! Love seeing Supercollider on the front-page of Hacker News.

~~~
mathgenius
Someone should write about what it takes to do real-time GC. (not me!)

~~~
tonyg
If I remember rightly, SC's design mostly keeps GC effects out of the
synthesis path.

SC is split into a GC'd frontend and a non-GC'd backend, and it's the backend
that does the sound synthesis. The frontend runs the SC-language programs,
whose output is a graph of sound processing components that is serialized and
sent to the backend, where it updates the running synthesis graph. I think
also the frontend can send new parameter values for nodes in the graph to the
backend, so the frontend GC _can_ have an effect on synthesis in cases of
allocation-heavy, rapid control; but my limited experience with SC didn't
involve that level of control.

------
cJ0th
btw: If you fancy a free VST clone of the DX7, check out dexed

[https://asb2m10.github.io/dexed/](https://asb2m10.github.io/dexed/)

~~~
em3rgent0rdr
Is there an LV2 version of the plug-in so can easily work in Linux programs
like Ardour?

~~~
SyneRyder
I haven't tried it, but the page does mention it's available as LV2.

------
puzzle
This is interesting, but perhaps the author should also post the serial number
of the DX-7 unit used. :-)

I can't remember the details, but early serial numbers have a slightly
different sound. They also had slightly different MIDI protocols, including
something like a heartbeat. I know because I own a more recent unit.

~~~
SN76477
I think it was something about having 8bit waveforms.

~~~
nutate
the dexed plugin allows different bit depths. There were a lot of FM synths
from yamaha from the DX5, DX7, DX7s, DX7II and they all had differences in one
way or another. The user Power DX7 on youtube has some really in depth looks
at the sonic differences between dexed and his dx7s. He also has some great
intros into how FM synth works, which had eluded me for a long while. I gave
my dx7s away, but sometimes I think about getting a korg volca FM to replace
it.

~~~
SN76477
linear through zero FM is a huge mystery to me.

It sounds amazing though!

------
intellectronica
DX7 was the synth that gave the 80s a bad rep. But I had one and I loved it
and this is super cool-ider!

~~~
vzcx
And rightly so: the DX7 presets were abominably tacky.

Only in the hands of a capable programmer can it go to places unreachable by
contemporaneous machines. Eno is the most obvious name that comes to mind...
do you know any others that plumbed the depths of FM?

~~~
scns
Jaques lu Cont of Zoot Woman

[https://www.youtube.com/watch?v=4Vuf5taoy4Q](https://www.youtube.com/watch?v=4Vuf5taoy4Q)

EDIT: tldr start watching at 7:37

------
brian-armstrong
I'm a little confused by " // Under GNU GPL 3 as per SuperCollider license "

Does this imply all SuperCollider projects have to be GPL3?

