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.
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…
Ahhh, it’s a PD application… I think I can get it running as LV2 plugin on a Raspi… give me a day
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.
But Zynthian can execute PD patches, so we could use the PD file and define the controller map. It doesn’t seem too complex …
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
Greetings and God bless, Marius
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 )? What pdlv2 needs can be found here: https://github.com/x37v/pdlv2
P.S.: The build process is scripted in zynthian-recipe at
recipe/pdlv2.sh (must be started before) and
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:
It should work by simply creating a new folder:
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 …
I have deinstalled the pd-packages of Raspian and installed pd-0.49 from source:
./configure --prefix /usr --enable-jack
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
Other (preinstalled) PD-patches are working…
Ohhhh! Perhaps we could use hvcc for generating optimized C/C++ code?
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
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
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 …
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…
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
./configure --prefix /usr --enable-jack --without-local-portaudio
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
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.
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?
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…
On the pi4, it does.
The config like the HP filter and the Tine ratios don’t seem to change anything. Neither did cc mapping sustain.