TL;DR: Melodics runs out-of-the-box with the current version of Bottles and its default settings. However Melodics uses your browser to handle logins, and expects your browser to be able to call the Melodics app once logged-in. Read "Melodics Desktop Integration" below to set that up.
Versions tested:
- KDE neon (based on Ubuntu 22.04)
- Bottles 51.10
- Soda 8.0.2 (fork of Wine by Bottles developers, used by default)
- Melodics 4.0.266.0
Credits:
- Thanks to @klingtnet for the initial gist and ensuing discussion
- Thanks to @wwwehr for the scheme handler
Use the Flatpak version of Bottles, this is heavy, but so much better than fiddling with multiple forks of Wine using a distro package manager or whatever. In a terminal, simply run:
flatpak install flathub com.usebottles.bottles
Bottles can then be run from your distro app launcher, or from the command-line:
flatpak run com.usebottles.bottles
Inside Bottles, click the “Create new Bottle…” or “+” button to create a new bottle. Type a name for the bottle, for example “Melodics”. All the settings below that are fine (application environment, soda-8.0.2 runner, 64-bit architecture), so just click the “Create” button.
On melodics.com, after creating an account, click “Download for Windows” and save the installer wherever you are comfortable.
Inside Bottles, click on the Melodics bottle if it is not already open. Click on “Run Executable…” and select the Melodics installer you have downloaded. Depending on your OS, you may need to clear the filter at the bottom of the file selector so that the installer becomes visible.
On its final screen, the Melodics installer will offer to run Melodics. You may do so to verify Melodics starts on your computer, but will be stuck once you log into your browser. See below for the missing pieces of the puzzle.
Inside your Melodics bottle, you should now see a “Melodics” program which you can simply start using the “▶” button.
Save the following in a file named “melodics.sh”. The script assumes you
have named your bottle “Melodics”, correct the name after --bottle
if
you have used another name.
#! /bin/sh
flatpak run --command=bottles-cli com.usebottles.bottles \
run --bottle Melodics --program Melodics --args $1
You can then install the script in a well-known location. Run this command from the directory where you have saved “melodics.sh”:
sudo install -m 755 melodics.sh /usr/local/bin/melodics
You can verify everything is OK by simply running melodics
in a
terminal. It should launch Melodics.
We’re getting close to completing the puzzle. Save the following in a file named “melodics.desktop”:
[Desktop Entry]
Name=Melodics
Comment=Helps you learn to play your instrument
Exec=/usr/local/bin/melodics %u
Icon=melodics
Terminal=false
Type=Application
Categories=AudioVideo;Audio
MimeType=x-scheme-handler/melodics;
You can now integrate Melodics in your desktop with the following commands, run from the directory where you saved “melodics.desktop”:
sudo xdg-icon-resource install --novendor --size 256 ~/.var/app/com.usebottles.bottles/data/bottles/bottles/Melodics/icons/Melodics.png melodics
sudo xdg-desktop-menu install --novendor melodics.desktop
sudo xdg-mime default melodics.desktop x-scheme-handler/melodics
If you have not named your bottle ”Melodics”, edit bottles/Melodics
in the first command with the name of your bottle, for example
bottles/MyBottle
.
At this point, you should have a Melodics entry in your distro app launcher, which should quite simply start Melodics.
Your browser has also been told how to handle melodics://
URLs, which
the website uses once you are logged-in. For those URLs, your browser
will run the melodics
script we have installed.
Now, on most distros, everything should work. Start Melodics any way you want, log-in, if required confirm to your browser that you indeed want to launch Melodics. This should redirect you back to the app, where you can finally start practicing your instrument.
If you can start Melodics fine but your browser cannot, some distros have additional security restrictions, read on…
As an additional layer of protection against malicious web site, Firefox
on Ubuntu has an AppArmor profile that prevents execution of scripts in
/usr/local/bin
.
To add an exception for our melodics
script, run
sudo editor /etc/apparmor.d/local/usr.bin.firefox
and add the following line at the end of the file:
/usr/local/bin/melodics uxr,
You can then tell AppArmor to reload its profiles by running
sudo systemctl reload apparmor.service
.
Everything should finally work fine.
Thanks very much for this tutorial. But unfortunately, the final step is not working properly. I am using Ubuntu 23.10 and I followed every step of your tutorial, also the additional security settings. When I start Melodics and try to log in, my melodics backlink with xdg works after the login on the website. But then my laptop opens a new instance of melodics. Then it seems like it trying to validate my login. But finally I get following error:
I have installed the latest version of melodics from the website. I don't know exactly which version this is.
Other times I get typical 'Bottles not responding'-Error Message. Unfortunately, the 'Waiting'-button does not help. In this case I have to force the shutdown of bottles/melodics.
I hope you can help me. If you need additional information, please let me know :)