Dx7 emulator

Apostolos Kolonis's icon

Hi there, newbie here. So, i am trying to create for a project a dx7 in max msp. Well, not the whole thing but maybe some of the algorithms. My biggest problem is the polyphony i cant make it work with the adsr~ and poly~ and i dont know how to use line~ and function in order to create correct amount of attack, decay, sustain, release. If there someone who can help or maybe share a patch i would be grateful. Thank you.

_R_'s icon

interested too, did you find any inputs?

Apostolos Kolonis's icon

nope, nothing yet...

Roman Thilenius's icon

so what: line OR adsr? both doesnt make sense.

Apostolos Kolonis's icon

well, anything that will work without clicks. It doesnt matter if its line or adsr

_R_'s icon

@Apostolos do you mean the bang? I think you can connect the bang to a Kslider, so everytime you press a note the Adsr will be activated too

Peter McCulloch's icon

Check out auto-sustain mode in function. It will automatically add a sustain segment. Send a bang to function to trigger the first portion of the envelope, then a “next” message to trigger the release. To do that from the velocity you could do something like send the velocity into a select 0 with the left outlet going into a ”t next” object and the right going into a / 127. and then into a message box with “setrange 0. $1, bang” . This will scale the output range of the envelope and then trigger the attack.

Send the amplitude envelope signal directly into thispoly~. This will tell poly~ when the voice is busy (i.e., when the signal is nonzero).

Apostolos Kolonis's icon

thanks peter it will take me some time to understand and do what you say. but i think this will help!

Apostolos Kolonis's icon

@PETER so i did what you said but no sound...

Roman Thilenius's icon


"without clicks" is the programmers job! there is no ready object for that. this is not eurorack. :)

when using line~, keep in mind what its input represents: a starting value, followed by a list of value/time pairs.

in an ADSR type of envelope generator you will have to assign the user parameters to these numbers one by one.

value0: is always 0.

value1: is always 1.
time1: this is tha attack parameter A

value2: this is the sustain parameter S
time2: this is the decay parameter D

value3: this is also the sustain parameter S
time3: this is the (hidden) parameter for the sustain time St, for situations where there is no note off coming (one shot mode)

value4: this is always 0.
time4: this is the release parameter R

if you want to add one shot mode, retrigger mode, and an automode for the release which either has a fixed or relative release time, your patch might end up like in the picture. (this is an old exercise patch where i made up one of my envelope abstractions from - optimised for monophonic generators)

if you think it is easier to use adsr~ i dont think so.

Apostolos Kolonis's icon

I am really not a good programmer, i thought it would be an easy task. Thank you for your time.

Peter McCulloch's icon

I misread your initial post. You can just use adsr~ with thispoly~ if you want to keep things simple. There should be an example in the helpfile for adsr~ IIRC. The key thing to know is that thispoly~ tells poly~ whether the voice is busy. How does it know? At first glance, it’s reasonable to think you could use MIDI note information and just see if the note is on or off, but this doesn’t work in practice because notes don’t usually release instantaneously; there’s a release time on the envelope and we don’t want to cut that off prematurely. Instead, we have to use the amplitude envelope. That can be provided by adsr~, line~, curve~, etc. The amplitude envelope is connected to a *~ so it can control the volume of your oscillator(s). Thispoly~ needs a signal that indicates whether the voice is busy or not; non-zero indicates busy and zero indicates not busy—this matches up with the way our amplitude envelope works, so we can simply send the amplitude envelope (before the *~) into thispoly~ to tell it whether the voice is busy (making sound).

The DX7 is a complicated synth, so I’d recommend that you start small and build up in complexity before trying to clone the whole thing. The simpleFM~ object is a good way to get some FM sounds going fast. To build something closer to the DX7, you’ll need to learn how to implement Phase Modulation. Though the DX7 is called an FM synthesizer, it’s actually using phase modulation rather than frequency modulation because digital frequency modulation is mathematically unstable once you start cascading multiple oscillators.

Compviga's icon

I designed the SC version, and it was a hell of an experience. There are 160 parameters, and most of them generate arbitrary values. It is 20kg synth, and all parameters are chip generated. So it is tough to emulate parameters with objects like line~or ADSR~ because of the erratic behavior of the chips (they are in voltage domain anyway). What I did was, I just checked the values like a convolution matrix system and created a table of values for specific decibel ranges (Emulating envelopes was a little bit more complicated than this, but it is very close to this.)

The good news is, architecture is relatively simple. At the core, it is just a 6 Sine oscillator connection pre-defined with a table of algorithms, and that's it. But the sine oscillator matrix needs to have a 1-sample delay, which is only possible with gen or with 1-sample signal vector size. Everything else can run with larger buffer sizes, but this 6-sine needs to configured in 1-sample block size. If you don't have 3-4 months to burn, then trying to emulate the hardware is not a good idea. There is an X.FM~ synth in Max, which is a DX-7 system without the emulation, I guess.

Roman Thilenius's icon


arbitrary parameter ranges and FM feedback would be the first two things i would skip.