Hacker News new | comments | show | ask | jobs | submit login
Yamaha DX-7 synthesizer clone written in SuperCollider (github.com)
144 points by jarmitage 7 months ago | hide | past | web | favorite | 44 comments

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

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...

Would be great to have in F-Droid repo.

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).

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

Thanks for coding such an important tool!

>There's a high performance C++ (with neon simd acceleration) implementation at [0]

DX7 fans (like me) already know your implementation, it is famously used by the Dexed software. Thanks raphlinus, for making the world a better place.

Well, when I read the title of the article, my first thought was "...but we already have Dexed".

Kudos to the Supercollider clone writer, but thank you so much for making the basis of a practical tool that musicians can use!

I couldn't get this built out of the box from your repo, some sort of problem with the toolchain producing non-compiling .S assemblies, but I thoroughly enjoyed reading the sources and observing the MacOS Synth, and so on .. pretty nice project.

I guess if I get it working for my dev env (Nexus 5X) I'll send you a PR .. you planning on working on this some more?

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.


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

One thing that's particularly cool about a lot of these earlier recordings is the amount of automation that's used. Obviously you can use MIDI in realtime for automation, but a lot of the studio use of these early synths didn't take advantage of it very often. Probably why you're way more used to hearing filter sweeps and the like in analog synthesis.

Chowning's "Sabelithe" (on Spotify and Youtube) makes really cool use of synthesis to transform percussion elements into melodic elements over the progression of the piece.

She wrote a program for the old mac called "Music Mouse"

"This is a program I first wrote for my own use way back in 1986 on my spiffy new Mac 512k, that somehow ended up enough in demand that it became a so-called "product", and actually got rated as a "5 Mouse" program by MacUser Magazine. It lets you use the computer itself as a musical instrument, played by moving the mouse with one hand while you control dozens of available musical parameters from the Mac's "qwerty". It's a great musical idea generator, ear trainer, compositional tools, and improvising instrument. The software does a lot of harmony handling for you (you control the variables it uses for this), so it's useful - as are all "real instruments"at any level of musical training, experience, or skill, from beginning through professional."


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:


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


“The Yamaha DX7 is an FM synthesis-based digital synthesizer and electronic keyboard manufactured by the Yamaha Corporation from 1983 to 1989. It was the first commercially successful digital synthesizer.”


“The very earliest digital synthesis experiments were made with computers, as part of academic research into sound generation. In 1973,[1] the Japanese company Yamaha licensed the algorithms for frequency modulation synthesis (FM synthesis) from John Chowning […]”

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:


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.

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.

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 :)

"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.

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...

>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,

You mean IC54 and IC56? I noticed them on the circuit but didn't know it was tuned SO LOW! Wasn't the sample rate over 50KHz for each voice? 16Khz looks overkill for such sample rate. I know this is a time-division-multiplexed DAC so pehaps the time division multiplexing generates even more artifacts of their own?

I would love to see a circuit that replaces the whole DAC section with 16 separate DACs that then mix their sound on the analog domain...

I recall seeing a comparison of DX7 vs dexed patches on Youtube that mostly found audible differences in envelope lengths, not timbre. That seems like something more straightforward to fix, though there's always the potential for a caveat like it being tied to the original hardware sample rate.

>Also DX7 had sampling rate of 49096 Hz, 12-bit "floating-point" DACs etc etc.

Note that the output wasn't 12-bit. There was a 12-bit DAC chip, but additionally to those 12 bits there are additional bits that are fed to another DAC (implemented using resistors) in charge of doing "gain-ranging" (that is, adjusting the output level of that channel). Thus the dynamic range available was much higher than just 12-bit.

>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 :)

On the other hand, i play the hardware DX7 (the real thing) plus a DX7IIFD, and i'd rather have the developers produce a cleaner version of the DX7, with a much larger/longer sine table, and more nuances to the sound. On the 'net, many claim the DX1 and DX5 sounded much more cleaner (not just "less background noise" but "sweeter sound"); i wish we could aim for that.

Yes. Or we can aim for a software FM synth with analog feel in sound of Synclavier and versatility of FS1r :)

By the way, Yamaha FS1r is the only hardware FM synth that I currently have. Several years ago I've implemented singing synthesis after reading Yamaha's patent on FS1r. The synthesis was implemented on a specialized multicore chip and we even showed the result to Yamaha representatives. They liked the sound, but they were not interested in the chip. Anyway, it's a different story :)

We'll see an FPGA implementation soon enough :-)

Really? Good to know! Maybe one day a few stubborn sound designers will replace Yamaha modules from their rack with these FPGA replicas :)

I would love to have a FPGA that i could drop inside my DX7 and replaced the OPS operator IC for a more advanced (more nuanced sound, purer sine waves) version !

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.

Supercollider home: https://supercollider.github.io/

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

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

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.

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


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

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

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.

I think it was something about having 8bit waveforms.

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.

linear through zero FM is a huge mystery to me.

It sounds amazing though!

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!

As with all eras, there's always a backlash against sounds and genres as they become overplayed and predictable, and people start cashing in on it rather than making it for the love of it. I don't think it's entirely fair to pin it on one instrument as being the cause of it, especially given how well some of the songs made with it have weathered the test of time.

Digital sounds in popular music went through that backlash in the 90s and early 2000s. Nothing could have prevented the backlash, and no one thing caused it. It happened to disco in the 80s and 90s when it was the butt of jokes, which then saw a solid resurgence in the 2010s with the pinnacle being Daft Punk making what was effectively a disco album.

DX7 was responsible for more hit synth sounds in the mid to late 80s than any other synth (probably, though there were some other contenders, and a few analog signal path, digitally controlled, synths that definitely had a big impact during the same era...the Prophet and the Roland JX-8P come to mind as instruments that would have often appeared alongside the DX7 on record). And, many of those songs are still loved and played today...and often continued to be played throughout the anti-digital era of the late 90s until the early 2000s when we started seeing EDM producers and others begin to reintegrate FM synthesis and other digital techniques into their sound (dubstep is all about FM synthesis, for example...those big angry swooshy wubby noises are often FM synths).

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?

Jaques lu Cont of Zoot Woman


EDIT: tldr start watching at 7:37

>And rightly so: the DX7 presets were abominably tacky.

Agree, but once you learn to program it, you can really get very good sounds. I'm a satisfied programmer!

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

Does this imply all SuperCollider projects have to be GPL3?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact