MiMi-d - creating a new software synth for Zynthian

Had problems when running this on Zynthian; turns out that the -D flag for jalv was not implemented for jalv.gtk3, so jalv would exit immediately when attempting to load MiMi-d with its newfangled GUI. (PR here: jalv_gtk: Implement -D flag also for GTK version (with correct target branch) by polluxsynth · Pull Request #8 · zynthian/jalv · GitHub).

With this in place, it runs nicely on Zynthian, although the GUI looks a bit fuzzy over VNC, so need to look over the rendering so it doesn’t suffer too badly when VNC rerenders it.

If anyone wants to give this a try (with the jalv fix above in place), the code is on the dev-gui branch in my MiMI-d repository (GitHub - polluxsynth/audio-plugins at dev-gui · GitHub). (Beware that I’ll be rebasing frequently, so use git fetch && git reset --hard origin/dev-gui when upgrading after the initial checkout).

Also, I think engine_config.json will need updating, to correctly specify that the plugin has a UI or does this happen automatically when scanning for new plugins? - EDIT: Yep, seems that scanning for new plugins is enough to get Zynthian to recognize that the plugin now has a UI (which I probably knew already but had forgotten).

6 Likes

Almost done. Some more reviewing and tweaks remain but I should be able to release this quite soon now (also pending a change in jalv.gtk3 which is needed to run this on Zynthian).

12 Likes

A lovely graphical layout @ricard :star:, with a foreground+background combination in the range of my fav arctic hues, and an overall arrangement of controls that conveys the signal flow in a clear and synoptical manner. Visually very pleasing: look forward to playing with this once released! :rainbow:

2 Likes

I’m in a bit of a bind here. The problem is that with the GUI, when VNC is enabled and hence the GUI, it is required to update Jalv to the latest version, or else Zynthian hangs on the snapshot loading screen. This has been fixed in Vangelis, but Oram is not due for any more releases. So if someone is running Oram, and casually updates MiMi-d it will cause snapshot loading to hang next time.

But perhaps I’m overreacting. IIUC, updating MiMi-d requires the user to consciously run the update script (install_mimid.sh or install_mimid_prebuilt.sh), which most users would have no reason to do unless they’ve read this thread and explicitly update the plugin.

4 Likes

Version 2.3.0 has been tagged on the master branch. As usual, a companion version 2.3.0z has been tagged on the Zynthian branch, which supports the graphic envelope and filter features in the Zynthian UI.

Note: If you are running Oram or are running Vangelis and have not updated for a while, it is imperative to update Jalv to the latest version on the asyncli branch, otherwise shapshot loading will hang when the GUI is enabled (i.e. when VNC is enabled in Zynthian).
Simply run:
/zynthian/zynthian-sys/scripts/recipes/install_lv2_just_jalv.sh
in Zynthian before or after updating MiMi-d.

The major news this time is of course the GUI which is enabled when VNC is enabled in Zynthian. The interface is rescalable and allows for a certain amount of customization (right click, or click the UI button in the upper right hand corner, to bring up the UI menu).

A minor fix is that two of the presets (E Piano S and E Piano S Chorus) have now been correctly assigned to the Factory bank, which avoids a weird file:///... line in the bank list in the Zynthian UI.

Some parameter names have been changed to better suit the new GUI, which also affects the native Zynthian UI. It’s a fairly clean change, and the manual has been updated accordingly.

But back to the new GUI!

Parameters may be edited by dragging with the mouse, using the scroll wheel, or using the +/- (or PgUp/PgDown) keys after clicking on a parameter. Navigation can also be done using the arrow keys rather than the mouse if desired.

Parameters are divided into two pages, with parameters in the Main parameter group being visible on both pages. Page 1 contains the audio path and modulation, whereas Page 2 contains control parameters such as key assign, controllers and spread. Click the Page Toggle button in the UI or press the Tab key to toggle the page.

More details in the manual: Either in the Doc directory in the source, or at https://butoba.net/downloads/mimid-manual.pdf .

Note that the GUI itself does not handle preset loading or saving, that must be done either in the Zynthian UI as before, or using the (Jalv) Preset menu in the GUI window.

I’ve also briefly tested the GUI in Ardour and it works fine there too, although the lack of preset management becomes a bit of a hurdle.

Regarding code development, it’s been an interesting 4+ weeks since I started this. I’ve used Claude Code (Sonnet 4.6) extensively in its free version, and I must say it’s been a very inspiring way to do prototyping and getting things to work, this being the first time I’ve done any major AI assisted programming project. At the same time, Claude makes lots of implementation twists and turns that can take a while to untangle.

Basically, it took a weekend to get the basic UI up and running, then a week to get it working well. I figured I’d put another week’s worth of cleaning up, but at the end of the now in total two week period I decided to switch graphic toolkits from Cairo to nanoVG to reap the benefits of GPU assisted rendering, particular when editing parameters, not so much because it looked slow, but because it used a fair amount of CPU and I wanted to investigate how much better nanoVG would be. Well, it took a weekend to get nanoVG up and running properly, and another week of cleaning up, for a total of three weeks. Finally another week of cleanups, moving things around and improving the structure, so a total of four weeks (haven’t done much this week).

So all in all, a different development curve: quickly arrive at something that looks good, but one needs to steer the AI in the right direction pretty often which is a skill one no doubt will get better at over time.

An interesting observation is that when giving the AI general instructions, it fares pretty well, but the more specific the instructions are, the harder it is to get it to do precisely what one wants.

Anyway, enjoy the GUI, and feedback is always appreciated!

6 Likes

@ricard

Thanks so much for your tremendous effort to develop and support the fantastic Mimi-d synth on Zynthian. I haven’t used Zynthian for a while now in my music. But in July I will have a little gig with a friend where Zynthian and Mimi-d will safe my life: All our home jam sessions I played on Korg SV-2 which weighs about 20 kg. It sounds great but I don’t want to drag that thing anywhere. With my Zynthian V5 kit and also Mimi-d I have lots of similar and maybe better sound options.

Again: Thanks for your great work. Please keep it up :+1:.

6 Likes

It came to my attention a while ago that running MiMi-d on Zynthian with the GUI enabled in a snapshot that also had Osirus would result in clicks and pops while adjusting parameters (whether from the Zynthian UI or the GUI). More careful examination revealed that GUI redrawing that occurs when a parameter is updated results in quite a large CPU load. Indeed, when I originally selected Cairo for the graphics backend, I was noticing quite a large CPU load increase when adjusting parameters, when testing on my Linux laptop, which prompted me to change to nanoVG. nanoVG uses Open GL for rendering, which can be very efficient on a GPU, but in the case of Zynthian, the plugin GUI screen is not rendered on a GPU but purely in software, using Open GL emulation, which for whatever reason tends to be rather CPU intense.

The real kicker is that it doesn’t help if one is editing parameters on the Zynthian UI (with the Engines VNC enabled): It’s the redrawing in the GUI that is causing the clicks and pops, and the GUI parameters are always updated when there are parameter changes, no matter where they come from.

Removing Osirus from the snapshot caused things to work smoothly, even though there were still a handful of other plugins in the snapshot, so I think that there is an issue with Osirus that for some reason it is sensitive to when its GUI thread doesn’t get enough CPU.

Indeed, other plugins using Open GL, like Helm, seem to have the same issue as MiMi-d, so it’s not just my lack of experience with GUI programming.

Capping the redraw rate in the plugin helps to a certain extent, but there are still CPU load spikes which cause audio glitches, even if they occur more seldom.

So, in the end, me and my friend Claude replaced the nanoVG backend in the MiMi-d UI with Cairo, and now things are much calmer. Even on an RPi4 Zynthian, continual parameter updates don’t cause the CPU load for the MiMI-d GUI to go above 15%; with nanoVG, I was around ten times that on that platform.

New version to follow soon.

4 Likes

Version 2.3.1 has been tagged on the master branch. As usual, a companion version 2.3.1z has been tagged on the Zynthian branch, which supports the graphic envelope and filter features in the Zynthian UI.

This changes in this version only affect the GUI. If you don’t have VNC enabled in Zynthian and are thus not going to use the GUI via VNC, you don’t need this update.

This version sees a switch of the graphics backend from nanoVG to Cairo, in order to render more efficiently in the Zynthian, where the underlying screen is completely in software, rather than being backed up a GPU. In essence, if you are using MiMi-d together with Osirus (or likely any other TUS plugin), with MiMi-d version 2.3.0 you would experience random clicks and pops while adjusting MiM-d parameters, regardles of whether the parameter changes where done in the GUI or in the Zynthian UI. With Cairo used for the graphics rendering, this no longer happens.

A minor change is the addition of waveform symbols along the the rim of the Modulation 3 Shape parameter; the parameter is continuous, and it is not obvious where to position the knob to get the various waveforms.

A similar minor change it the positioning of an infinity symbol at the end of the track for the ADSSR Sustain Time parameters, indicating that when the Sustain Time is set to max, the sustain is infinite (envelope behaves like a standard ADSR).

As a workaround in cases where the CPU consumed while the GUI is handling parameter updates is excessive, open the UI menu (right-click or click the UI button); while the UI menu is open, no parameter changes are displayed.

Code-wise some minor cleanups have been done none of which affect the behavior of the plugin.

If you haven’t updated in a while, see my note about updating jalv further up . (MiMi-d - creating a new software synth for Zynthian - #190 by ricard).

5 Likes

2 posts were split to a new topic: Native GUI CPU usage and associated UI resource chat

I haven’t been able to get the GUI to show.

I take everything else is working (thinking that if jalv is not updated to the latest version on the asyncli branch, the Zynthian UI will hang while trying to load the preset)?

Have you checked if Zynthian is starting MiMi-d with jalv or jalv.gtk3 ? I seem to remember having to try some combination of Search for engines and regenerate_engines_db.sh and possibly reboot before it rescanned the plugin and found the UI. The “UI” field for MiMi-d in engines_config.json should read “X11UI” and not null.

Thinking about it, I’m wondering if I should have submitted a patch to zynthian-sys, in order to enable the UI in /zynthian/zynthian-sys/config/engines_config.json . On my Zynthian, it is enabled in /zynthian/config/engines_config.json, but I can’t remember if I edited the file manually or ran one of the rescanning/reconfiguration scripts.

I woke up this morning and the GUI was there on my desktop! I am not sure what changed but maybe some reboot may have fixed things. (There are still some odd behaviours after first installing a plugin.) So I started to compare the nanoVG and Cairo versions with v3d enabled and I can’t see much difference. You may want to revisit this to see which combination provides most benefit… or you may be bored with this whole thing and want to move on!!!

1 Like

If I understand it though, enabling v3d causes the UI rendering not to work properly on RPi4, which sortof precludes the whole thing until that is sorted out? It would be interesting to test how Osirus + MiMi-d (with nanoVG) with fares on RPi5 with v3d enabled though, but at the same time, I’m sortof subscribing to your final sentiment - Cairo works well (and from what I understand has superior rendering quality in terms of appearance), and doesn’t consume an inordinate amount of CPU, so I’d really rather leave it at that until there’s some change in the Zynthian infrastructure which warrants a revisit.

1 Like

My small amount of testing suggests that v3d makes insignificant change in resource usage on a RPi5 when running Osirus and MiMi-d with naative GUIs.

1 Like

Interesting! But I assume it’s a bit of a theoretical experiment if v3d doesn’t work properly across the range of Zynthian platforms, especially the RPi4 ?

I discovered a slightly embarrassing error yesterday: at certain GUI scale factors, most notable 1.00 which is the default, the knob redraw process upon parameter updates shaves off the very top of the parameter name text below. So with an absolutely minimal change I’ve tagged version 2.3.2 on the master branch, and its companion version 2.3.2z on the Zynthian branch, fixing this issue.

3 Likes

Hi @ricard!

I just updated Vangelis with the latest version of MiMi-d.

Thanks for your great work!

5 Likes

Thanks @jofemodo ! Doesn’t the engine DB need updating as well?

Engines DB is regenerated on every update.

Regards,

1 Like