EP-MK1 possible new plugin

I came across this in Linux Format https://patchstorage.com/ep-mk1/ A “real-time physical model of an Electric Piano”. It sounds computationally expensive, but it might be worth a punt on Zynthian.

Hi @Baggypants

many thanks for sharing! It sound absolute wonderful!!!

Unfortunately it is only a VST plugin. For Zynthian we need a LV2 plugin or a version with jack support besides the source code or a binary for ARM.

I take a closer look at the project, maybe there is a way to port it to ARM/RPi…

Regards, Holger

Ahhh, it’s a PD application… I think I can get it running as LV2 plugin on a Raspi… give me a day :wink:

2 Likes

Ok, it might even be possible to build an LV2 plugin for the RPi from the EP-MK1. Here’s what I found out:

1 The base of the EP-MK1 is a Pure-Data “script”.
2. This is good, because there is a way to convert PD to LV2.
3. It’s a bit tricky to get a reasonable result, but I tried it once and the following ZIP could be installed to $ZYNTHIAN_PLUGINS_DIR/lv2 and (hopefully) started on MOD-UI or via jalv.

ep-mk1.lv2.zip (510.7 KB)

All of this is currently totally unclean and not properly tested… maybe I can do it even better.

1 Like

But Zynthian can execute PD patches, so we could use the PD file and define the controller map. It doesn’t seem too complex …

Regards,

1 Like

Right, I totally missed this… But I am also searching for a way to get native C++/C code from PD to get it also run on a Teensy :wink:

1 Like

Hello @Baggypants, @C0d3man and @jofemodo,

I like the creative outcome very much when a little idea like the ep-mk1 is feeded into two masterminds’ brains for the benefit of all.
Thanks @Baggypants for pointing @jofemodo and @C0d3man to this.

Greetings and God bless, Marius

1 Like

Hmmm, it’s really not as easy as I thought.

Normally yes, but you would have to give the EP-MK1.pd the “appropriate” connections first. I’ve never used PD before and have no plan how to do it. If you just import the file, nothing happens.

You have a similar problem with LV2: I get it translated, there are inputs and outputs, but the other suitable connections (especially MIDI-IN) are only available if you install them manually in PD.

Does anyone here know more about PD than I do (probably almost everyone :slight_smile: )? What pdlv2 needs can be found here: https://github.com/x37v/pdlv2

Regards, Holger

P.S.: The build process is scripted in zynthian-recipe at recipe/pdlv2.sh (must be started before) and recipe/ep-mk1.sh

I’ve been tested and can’t make to work the EO-MK1.pd file in zynthian. In my laptop it works pretty fine but it doesn’t work in zynthian, although everything looks fine:

  • Jack Audio working and PD output connected to system output port
  • MIDI configured and connected.

And the patch runs without error messages in PD. I can see the blinking MIDI “virtual LED” in the EP-MK1 GUI and i can modify the parameter values from zynthian.

Anyway, i’ve created an incomplete “zynconfig.yml” file for the instrument and modify the PD file for adding more “ctlin” objects with some scale calculaion (logarithmic, range, etc.).

Both files are attached here:

EP-MK1.pd (412.2 KB)
zynconfig.yml (568 Bytes)

It should work by simply creating a new folder:

zynthian/zynthian-my-data/presets/puredata/synths/EP-MK1

and copying both files there … but it doesn’t work, i don’t know why! Perhaps it’s the PD version…

BTW: Before experimenting with all this, update your zynthian software! There is an important fix related with PureData <=> MIDI connection …

Kind Regards!

Hi @jofemodo

I have deinstalled the pd-packages of Raspian and installed pd-0.49 from source:

./configure --prefix /usr --enable-jack 
make install

After that I can start EP-MK1 but the new cpu usage indicator shows that very much cpu time is consumed. Playing some keys generates (buffer-underrun-)noise :disappointed_relieved:

Other (preinstalled) PD-patches are working…

Regards, Holger

2 Likes

Ohhhh! Perhaps we could use hvcc for generating optimized C/C++ code?

Regards,

I have tried this also some days ago but was not succesfull. But I havn’t checked deeply, if I made something wrong.

My last idea: pdlv2, but for this you have to prepare the pd-patch as mentioned in the README.md

Regards, Holger

1 Like

This will not improve the performance, as it uses pdlib, an embedded version of pd.
If we really want to use EP-MK1, we have these options:

  • Compile to C/C++ code with hvcc
  • Ask Miguel (the author) if can improve the performance of the pd patch, or make it compatible with hvcc
  • Wait until we have more processing power :wink:

BTW, @C0d3man, do you think it’s possible to compile a “faster” binary of pd? Perhaps some optimization option? We could consider this way too …

Regards,

1 Like

Maybe… but I think we need a speedup up to 50% and perhaps we can get 5% from PD-optimization… So the only way may be to try hvcc.

Miguel has send a monophonic version with some other tweaks. I will try to test at evening. Perhaps this may help…

Regards, Holger

Ok, I made some tests:

Fresh installed Zynthian, trying a special monophonic version from Miguel: No, only strange sounds. So I installed a newer version of pd from github:

git clone https://github.com/pure-data/pure-data.git
cd pure-data
./autogen.sh
./configure --prefix /usr --enable-jack --without-local-portaudio
make
make install

And after a reboot the monophonic version works: https://discourse.zynthian.org/uploads/default/original/2X/e/eb1f10684db9ca51c1179419e03c85f94e392701.wav

But: It’s really only monophonic. The polyphonic version produces only buffer-underrun-noise :cry:

Regards, Holger

2 Likes

Hello!
Sorry for the hiatus I’ve been busy with other projects.

@jofemodo I think compiling EP-MK1 to C/C++ with hvcc is totally possible since it was made for pd vanilla.
Although I’m unaware on how to make that code work with a midi device, I’ve only compiled .vst2 plugins with hvcc. Gonna test it that way for now.

Meanwhile, I’m going to update the documentation on the current version of EP-MK1. :slight_smile:

Regards.

Ever since I first heard the Pd ‘generative_relaxing’ patch on zynthian a few weeks back, I’ve fbeen wondering how to get it to run on a dedicated Teensy or STM32… no display, just 5 knobs and audio output jack.

Of course,it would be much cheaper and simpler to use a Pi Zero running Zynthian.

But I just stumbled across the Heavy compiler, which has potential.

Hey, I’m back again.
I made a heavy version here’s some of the changes:

  • Replaced resonators for sinewave oscillators, since there is no filter reset on heavy.
  • Replaced filters on the distortion code for audio rate filters. This way I can reset the filters by opening the cutoff all the way to 20 kHz in a milisecond while the audio is on mute and then bring it back the next millisecond. This adds about 3 to 4 ms of delay on the trigger, but it prevents clicks and keeps consistency.

This version has no parameters or pedal control. I limited the polyphony to 8 voices.
Here’s the pd patch, it consumes plenty of CPU compared to the heavy VST version which consumes about 3% CPU on my 2011 iMac.

Download Pd Patch:
_main.pd (206.9 KB)

Download Heavy VST (macOS only)
epmk.vst.zip (167.0 KB)

Here’s the github source code:

Now, is there way to use this code to create a lv2 plugin?

Best Regards.

1 Like

Hi @MikeMorenoAudio

Wow - very cool - many thanks! I will try the PD the next days.

I took a look at the generated C(++) code. Wow - pretty much files. I hope I can find the basic sound generator function, so I hope there can be wrapped around a lvtk implementation for LV2. This will be take some time…

Regards, Holger

1 Like