Once I get sound coming out of mod UI, this may be turn out to be a silly question, but I’m curious if it’s possible to load a sound font into mod UI as a pedal and then pass it through other bits of he chain…
I know there are pedals who basically act as sources of sounds from MIDI instruments that then get fun effects thrown on them–wasn’t sure if those pedals are based on SFZ/SF2/GIG or some other format?
I think you mean the FluidPlugs? They are LV2 wrapper around a soundfont (I think based on fluigsynth). Currently they use hard-coded soundfonts. The current lack of MOD-UI seems to be that you have no file browser for selecting soundfonts/samples/sysex/IRs/…
I own a MOD-Duo - for this device the MOD-UI is primarily written. MOD may want to create a file browser, but this may be far away on their to-do-list-of-death. So the only solution is to create a wrapper or to extend MOD-UI (it is freely available on github).
Maybe the following idea s a way?
write a generic LV2 plugin (based on the FluidPlug?) which loads its soundfont from a file that is named like itself.
use a seperate web-server on Zynthian for uploading soundfonts
after uploading the soundfont an automatic creation of the generic FluidPlug-LV2 in combination with the installation of the soundfont is done in the plugin folder.
So you have not to build a new hard-coded plugin for every soundfont… when I have time I will ask the MODs what they think about this and start to code…
… and with the magic of perl a new plugin with the mentioned soundfont and presets should appear (after reloading mod-host/mod-ui). Perhaps I will add some options for the color of the modgui…
Hmmmmm… it is not working as I thought. It seems that you cannot create such a generic plugin because the URI of the plugin must be hardcoded inside the binary. But it is not impossible to create own SF2 LV2 plugins - just my suggested way won’t work.
I am going on to create such a generic plugin out of FluidPlug - but this will take some time…
Perhaps we should consider the possibility of passing file names as LV2 plugin parameters. Converting everything to turtle is a little bit twisted (althought it has some advantages). It can be really useful to have the option of loading plugin-specific preset formats. For instance, SYSEX presets in Dexed, or soundfonts in fluidsynth, etc. In that case, a “file browser” widget would be desirable for MOD-UI.
[EDIT 20170309 due to extended program]
[EDIT 20170313 using aditional perl library for system()]
If you want to be a beta-tester, you can try the generic LV2-FluidPlug-SF2-builder. Here we go:
apt-get install -y templatetoolkit-perl libipc-system-simple-perl
git clone -b generic https://github.com/dcoredump/GenericFluidPlug
cd GenericFluidPlug
perl ./genericfluidplug <path_to_my_sf2_file> <path_and_name_for_LV2_source_code> <path_and_name_for_LV2_plugin>
cd <path_and_name_for_LV2_source_code>
make DEST=/zynthian/zynthian-plugins/lv2 install
systemctl restart mod-host && systemctl restart mod-ui
Works for me… there is still something to do (e.g. eye-candy for modgui)… should work with every soundfont fluidsynth can load… have tested only with “simple” SF2-soundfonts.
Regards, Holger
P.S.: Complete example with real data:
# install system package (only needed the first time)
apt-get install -y templatetoolkit-perl libipc-system-simple-perl
# get your favorite soundfont and put it to /tmp and unzip it
cd /tmp
wget http://rkhive.com/new/new_banks/masterpiece.zip
unzip masterpiece.zip
# get the magic builder software (only needed the first time)
cd /zynthian/zynthian-sw/plugins
git clone -b generic https://github.com/dcoredump/GenericFluidPlug
# generate your Fluidplug source code
cd GenericFluidPlug
perl ./genericfluidplug /tmp/Masterpiece.sf2 /zynthian/zynthian-sw/plugins/Masterpiece /zynthian/zynthian-plugins/lv2
cd /zynthian/zynthian-sw/plugins/Masterpiece
make install
systemctl restart mod-host && systemctl restart mod-ui
Use/Restart the MOD-UI-engine on your Zynthian, and with a web-browser look at your Zynthian-IP:8888. You should have a (black) plugin inside Generator which is named Masterpiece
P.P.S.: I just added two options for nicely creating MOD-UI boxes (stomp-box-looking). If you have not installed MOD-SDK you can’t use them. If you have installed MOD-SDK (https://github.com/moddevices/mod-sdk) you can use them with the two options -boxy-style=style and -knob-style=style . Set the environment-varibale MODSDK to the installation path and take a look at $MODSDK/html/resources/pedals/boxy and $MODSDK/html/resources/knobs/boxy for available styles.
I have to ask a stupid question:I follow your example procedure I dont get the “./genericfluidplug” script.
While trying to find the cause I visited the https://github.com/dcoredump/GenericFluidPlug git. All files in there are older then 5 month so I guess its not the right place to look.
What am I doing wrong?
Oh - yes - sorry. I forgot to make this clear… I added this to the README.MD and will fix my installation manual above.
Wow - very big file! You may get problems using this soundfont. AFAIK Fluidsynth loads the whole soundfont into memory. 1GB RAM - 560MB soundfont… there ist not much memory free for other stuff…
Something strange happens when you start the script… I see: I have to add a check for failing when calling external programs.
Can you confirm that you have installed templatetoolkit-perl?
I fixed a little problem yesterday night (only a compiler option). Do you have cloned/pulled after 22:00?
I just tried and got Nice-Keys running (on RPi3, my RPi2 based Zynthian is currently at rehearsal room).
When running GenericFluidPlug-generated synths there is a problem with the Zynthian-UI. The sounds are not arranged in presets anymore but in values for a LV2 control port:
This seems not to be recognized by Zynthian-UI so you cannot change the sound by encoder anymore. It seems also that Zynthian-UI hangs until you erase the pedalboard.
sflist is a small program made by myself (I noticed that falkTX made such a program after I wrote this small helper ). sflist should be compiled automaticly when it not exists. As I wrote: I haven’t checked if the call to system("gcc -o src/sflist src/sflist.c -lfluidsynth"); comes back with an error… I am a bad programmer
Ok. Let’s compile this small program by ourself:
cd /zynthian/zynthian-sw/plugins/GenericFluidPlug
gcc -std=c11 -o src/sflist src/sflist.c -lfluidsynth
If this works without errors, I hope the generation/installation with genericfluidplug will work, too!
Thanks for testing!
Regards, Holger
P.S.: I am online on gitter (Commuity Zynthian/Makers) if you need “realtime” support
P.P.S.: Nice-Keys work for me out of the box. Loading time is a little bit longer than for other plugins…