Dexed (DX7 emulator) integration


Hi @ll,

I am currently at a point where I have a running DX7 emulation (based on the msfa engine) but have some problems with loading external patches. They sometimes sound strange. I have to check all the parameter dispatching.

The current state is here:


I hope I will find the problems the next days. Until then the current default sound sounds very nice like a DX7-E-Piano.

Regards, Holger


Yippieh! I got DeeAxe7 running! :massage:

But there are some caveats:

  • mod wheel does currently not work
  • converting sysex banks to LV2 presets has sometimes some problems.
  • storing the converted banks is currently done in user section and not as a factory preset of the plugin. I have currently not really an idea how to organize that.

Testing is currently only working with a LV2 host (like jalv or mod-host). But DeeAxe7 will be integrated in the next version of Zynthian.

If someone can’t wait, here is a recipe, how to install:

  1. Clone the repo (see message above with the repo address).
  2. cd DeeAxe7/src and edit the Makefile (installation path)
  3. make
  4. (sudo) make install
  5. When you use lv2ls you should see a plugin named
  6. If you want to convert banks: There is a script named dx7sysex2lv2. This script also needs dxsyx. Usage: bin/dx7sysx2lv2 patches/sysex.syx (it converts the sysex files to $HOME/.lv2)

If you have questions, just ask :wink:

Regards, Holger


Hi there,

after DeeAxe7 I am now nearly finished with a port fom Dexed to native LV2 for using inside MOD-UI. Dexed has some advantages against DeeAxe7:

  • Modulation wheel works
  • integrated filter with resonance for better adjustment of the sound
  • Unisono mode
  • additionlal two sound engines

But I have a very strange problem - perhaps someone has an idea how to fix this?

The current code is located at When using this code on a x86 hardware inside MOD-UI everything works fine. Using the same code (with different compiler options) on the Raspi I cannot get it to work inside (Raspi-)MOD-UI. But the same Raspi binary works if I load it directly into mod-host (the LV2 plugin host which is used inside MOD-UI).

This is very strange :dizzy_face:

First it was looking like a type mismatch problem but it seems to work on the Raspi - but not with MOD-UI…

I know, that this is a very complex problem inside LV2 and MOD-UI/mod-host - but perhaps someone has an idea?

Regards, Holger


Hi @C0d3man!

It seems to be a really strange problem. Can you get some error info from MOD-UI? It’s a problem with meta-data or with the binary itself?

If you give me some guidelines, i will try to compile and run your code this evening …

Regards …


Hi @jofemodo,

I have tried to show debugging output (shown when compiling with make DEBUG=1) and starting MOD-HOST and MOD-UI by hand, like this (as root):

skill mod-host && LV2_PATH=/home/pi/zynthian/zynthian-plugins/mod-lv2 mod-host &

LV2_PATH=/home/pi/.lv2:/home/pi/zynthian/zynthian-plugins/mod-lv2 MOD_DEV_ENVIRONMENT=0 MOD_SCREENSHOT_JS=/home/pi/zynthian/zynthian-sw/mod-ui/screenshot.js MOD_PHANTOM_BINARY=/usr/bin/phantomjs MOD_DEVICE_WEBSERVER_PORT=8888 /home/pi/zynthian/zynthian-sw/mod-ui/

But I cannot find any real problem. MIDI is recognized - only the rendering seems to make trouble…

Testing would help me very much! The main “Voodoo” is done inside dexed.cpp in the functions/methods run() and GetSample().

Here is a simple recipe for installation:

git clone
cd dexed/src
sudo make install # installation at /home/pi/zynthian/zynthian-plugins/mod-lv2

After restarting MOD-UI you should see a new generator (currently with default look). If you try to connect it and play via MIDI (or StepSequnecer) it only clicks.

Now stop MOD-UI and MOD-HOST. Do the following:

sudo LV2_PATH=/home/pi/zynthian/zynthian-plugins/mod-lv2 mod-host -i

Now you can copy&paste the following (as block or line-by-line) and this should make a sound like an e-piano:

add 0
add 1
connect effect_1:midiout effect_0:midi_in
connect effect_0:audio_out system:playback_1
connect effect_0:audio_out system:playback_2
param_set 1 grid_1_1 1
param_set 1 grid_2_3 1

So: MOD-HOST directly works and MOD-UI not (for me).

Regards, Holger


Perhaps MOD-UI overwirte the default preset values? Have you tried to put some presets ttl?



YOU ARE MY HERO!!! :trophy:

The problem was:

The plugin was not initialized with parameters at startup


The plugin uses LVTK (for handling the LV2 stuff). The default installation (on my Raspi) seems to enable some debug output when loading a plugin. This seems not to be enabled on my x86 system.

So MOD-UI gets on the Raspi data via stdin which may confuse its parser and the plugin won’t work (I will tell this falkTX). I disabled the debug output and now it works!

I will release the complete fixed version the next days - hopefully it can be integrated in the new SD-image :slight_smile:

Regards, Holger


Hi @jofemodo,

have you had time to try?

I tried yesterday and the problem still exists :cry: It seems to exist only sometimes. I made two screencasts where you can see what I mean:

I found out that:

  • it has no matter where the initializing for the engine is done: Constructor or activate() - sometimes it works, sometimes not
  • the parameters for the engines are ok - also when setting them explicitly at initialization.
  • this happens only on the Raspi - not on x86.
  • compiler options (ptomizations) have no effect - it happens with or without optimization options.
  • it never happens on Rapsi when loading the plugin directly into MOD-HOST (via CLI).
  • when no sound is produced this happens only to the first intance (see videos).The second and third instance are working. Deleting the first instace and creating a new one does not help…

Also tried:

  • fresh choeckout and installation of libraries: lv2, serd, sord, sratom, lilv
  • fresh checkout of mod-host and mod-ui

I really have NO idea how to go on…

Regards, Holger


Hi Holger!

Currently i’m a little busy finishing a little development, but i hope to be free for monday and i will test your Dexed LV2. I want to include it in the new SD image and i’ve some ideas for testing it :wink: By the way, if you have time, try to sniff the websocket and ajax communication from the browser, perhaps you can see what is different between the first instance and the rest.

Have you tried to load a preset after creating the instance? I suspect that the problem is related to the initial parameters. MOD-GUI always send a set of parameter values after loading the plugin and you can see this parameters in the websocket …



Yep - but this also does not help. Only the second instance works and sometimes the first…

I will try to run wireshark and will hopefully see something more - thanks for this idea!

Regards, Holger


No need for wireshark! You can do it from the browser developper tools :wink:


Hi @jofemodo,

did you had time to test Dexed-LV2?

I tried to use the developer tools and have done a trace of the calls - but I don’t recognize anything useful for me. I am more a system programmer than a web-specialist :sweat:

I really tried nearly everything but I cannot get Dexed-LV2 to work as the first instance. In fact it works sometimes as the first instance… but only 20% of every test.

It would help very much if someone (you= :wink:) can try if this also happens on other installations.

Thanks, Holger


Hi Holger!

I just have compiled and tested your dexed-lv2:

  1. I can confirm the same strange bahaviour. Tee first instance doesn’t work ;-(
  2. I’ve fixed the installation process:

git clone
cd dexed
git checkout native-lv2
cd src
sudo make install
cd …/…

I’ve added this to the recipes directory. BTW, as you probably have seen, in the last weeks i’ve integrated your recipes in the zynthian-sys repository.

Now i will try to trace the problem with the plugin. We keep in touch.



Hi @C0d3man!

I’ve noticed that when you have a “not working instance” connected to MIDI input and you play “hard”, it consumes CPU like a “working instance”. No difference. If you disconnect from MIDI input or “bypass” the effect, then no CPU consumption. Perhaps this can help you?



Hi @C0d3man!

For me, the problem is the same when using mod-host. I’ve repeated this procedure 10 times:

  1. Start “mod-host -i”
  2. Load first instance:

add 0
connect ttymidi:MIDI_in effect_0:midi_in
connect effect_0:audio_out mod-host:monitor-in_1
The first instance NEVER works for me. The number used with “add” doesn’t matter.

  1. Load second instance:

add 1
connect ttymidi:MIDI_in effect_1:midi_in
connect effect_1:audio_out mod-host:monitor-in_1
The second instance ALWAYS works for me. The number used with “add” doesn’t matter.

  1. Stop mod-host

When removing and adding without restarting mod-host, then the behaviour is not deterministic. Sometimes work the first instance, sometimes you have to load 2.

Perhaps we can try with other LV2 host?



Hi @jofemodo,

hm, I have no problems using dexed with mod-host directly:

systemctl stop jack2
/usr/local/bin/jackd -P70 -t2000 -s -d alsa -dhw:0 -r44100 -p256 -X raw -n2 &
mod-host -i

… and then copying the following into mod-host:

add 0
add 1
connect effect_1:midiout effect_0:midi_in
connect effect_0:audio_out system:playback_1
connect effect_0:audio_out system:playback_2
param_set 1 grid_1_1 1
param_set 1 grid_2_3 1

… works.

Perhaps it is the lvtk library. I am using it in the non-standard way - but for DeeAxe7 it worked. And it works for Dexed - after creating a 2nd instance… and it works on x86. I also tried to change the compiler optimizations - nothing helped.

I just tried to generate Dexed.lv2 for the Mod-Duo but it seems tat Mod-Duo has no lvtk library.

Perhaps I should try to exchange the lvtk library and use the normal lv2 library. But this is not done in an hour…

Perhaps trying with jalv maybe a solution… I will try this at weekend - now is band-evening… making noise :guitar: :wink:

Thanks for trying!!!

Regards, Holger


I have seen that. It debugged library and function calls and yes: It runs - but produces not hearable output. If you try with modmeter plugin (see recipes) you cann see that there is something produced when generating MIDI events - but at -58 dB! Normal sound is >-8 dB. If you switch the engines you can see that the MSFA engine produces NO output, both others are producing “something”.

OPL and Modern engines are inheriting from the MSFA class (=FmCore). Perhaps FmCore is not initialized. But why? And why the hell is the 2nd instance working - or seldom the first one???

It is very strange… ghosts :ghost: in the machine…
Regards, Holger


Hi @jofemodo,

I changed some parts - nothing helped. Than I changed the range for the output (=gain) in Dexed.ttl from 0.1-2.0 to 0.1-10.0 and now it works for me… at least the last boots.

Can you pull and confirm this? (I really hope you can :grin:)

Regards, Holger

EDIT: No - now it does not work anymore… it must be an external problem. :cry:


Hi @Codeman!
When i “make clean” in the plugin “src” directory, the file dexed_ttl.h is deleted and after that i can’t “make” again because the file is needed. Looking in the Makefile:

clean: Makefile
rm -f *.o *~ *.bak *.gch dexed_ttl.h *.so .gch msfa/.gch
rm -rf $(BUNDLE)

I’ve recovered the file with a “git checkout .” :wink:



Hi @C0d3man!

Bad news! For me the problem is still there. Almost the same ;-(