Saturday, April 21, 2018

VMPK 0.7.0 released


It has been a while! First of all: thank you very much for the million downloads of VMPK! It happened in 2016, but I wasn't paying attention at the time. I didn't post any article around that event, neither released a new VMPK version since that year, so let's cover both things.

Download statistics

Born in 2008, this project is multiplatform from the beginning, with the goal of emulating a MIDI controller device on software; which means: producing (and consuming) MIDI events. The producing part requires another source of human triggered events: computer keyboard, mouse and touch screen events are supported and available on the three main target operating systems. But producing MIDI events without delivering them to a MIDI Synthesizer makes the program useless, with no sound output at all. This has been the experience of most new VMPK Linux users for years. Windows users have a software synth included in the operating system, installed and ready to use, so they may produce sound as soon as they install VMPK from scratch. But Mac and Linux users need to find and install first a suitable synthesizer. Mac OSX also includes a soft synth library, but it is not a ready-to-use service and needs to be activated by a third party software. It's not very hard to find and install, because Apple has always made MIDI users a niche for their products. Good for them.

I've been approached last year by Microsoft people to package and publish VMPK into their Windows Store for Windows 10. Probably the million downloads has something to do with it. I've tried the packaging part without technical problems thanks to the support of the MS Desktop Bridge team, but the store conditions were awful, arbitrary and unfair, so I am not willing to comply with them. This means that VMPK will be available only outside the Windows Store and there won't be an UWP or Windows Phone version either in the future. I don't want to speak about the Apple's App Store. To the hell with them as well.

Linux users have been often made hostages of their distributions and packagers. In theory, the package repositories of each distribution (equivalent to an app store) are made for easy discovery and install of all the software available for Linux, but this is not true in practice. Software integration from different unrelated sources is also the job of the Linux distributions, which they miserably fail as well. I mean that when saying hostages, because the packagers sometimes act as if they want to force their users to follow their own personal preferences, like the gurus of a sect: Jack is the chosen one!!! PulseAudio is evil!!!

More about that later. Let's listen an enlightening Linus Torvalds first:


OK Linus. I've released this time an AppImage package for 64-bit Linux. OTOH, I'm still using Subversion and not planning to migrate the source repository to Git anytime soon.

What I think it would be a good VMPK distribution? Well, first of all, the latest version should be available for install, optionally with some former versions available to choose if the users needs to compare something (like a bug resolved or introduced in the latest version). Second: main functions should be immediately available: the user must be able to simply get sound at once. For Linux, ALSA sequencer inputs and outputs must also be available without any other extra configuration. About network I/O: the Mac OSX and Windows operating systems automatically activate firewalls blocking this function but, as soon as VMPK starts the first time, the OS asks the user for permission to open the firewall for this software. Linux distributions that include an active firewall should listen and learn something here.

The latest VMPK release includes lightweight soft synths for Linux and Mac OSX, which were available as a Drumstick-RT library back-ends for some time. The Linux soft synth is Sonivox EAS, borrowed from Android OSP and ported to Linux + PulseAudio, which was already mentioned in another post.

It is the default output chosen by VMPK upon install, so you need to use PulseAudio if you want to try VMPK. Why the PulseAudio choice? Because it is the default Linux sound server in most distributions: Ubuntu, Fedora (Red Hat), OpenSUSE, etc. I know that there has been a lot of criticism among the Linux audio community about PA, but honestly: I can't care less about arguments that sound like fanaticism. Someone told me that: “many people in linux-audio avoid PA like the plague.” Well, I'm sure you know that many computer users avoid Linux like a plague, but I don't let a handful of haters to influence my decision of keeping VMPK available for Linux users. And at the end of the day, this is my personal project and I am who decide the road-map. This is also free software. If you don't like something or have good ideas to get it better, you may contribute with code or make your own fork.

Sunday, April 3, 2016

Taking Back From Android



Android is an operating system developed by Google around the Linux kernel. It is not like any other Linux distribution, because not only many common subsystems have been replaced by other components, but also the user interface is radically different based on Java language running into a virtual machine called Dalvik.

An example of subsystem removed from the Linux kernel is the ALSA Sequencer, which is a key piece for MIDI input/output with routing and scheduling that makes Linux comparable in capabilities to Mac OSX for musical applications (for musicians, not whistlers) and years ahead of Microsoft Windows in terms of infrastructure. Android did not offer anything comparable until Android 6 (Marshmallow).

Another subsystem from userspace Linux not included in Android is PulseAudio. Instead, OpenSL ES that can be found on Android for digital audio output and input.

But Android also has some shining components. One of them is Sonivox EAS (originally created by Sonic Network, Inc.) released under the Apache 2 license, and the MIDI Synthesizer used by my VMPK for Android application to produce noise. Funnily enough, it provided some legal fuel to Oracle in its battle against Google, because of some Java binding sources that were included in the AOSP repositories. It is not particularly outstanding in terms of audio quality, but has the ability of providing real time wavetable GM synthesis without using external soundfont files, and consumes very little resources so it may be indicated for Linux projects on small embedded devices. Let's take it to Linux, then!

So the plan is: for the next Drumstick release, there will be a Drumstick-RT backend using Sonivox EAS. The audio output part is yet undecided, but for Linux will probably be PulseAudio. In the same spirit, for Mac OSX there will be a backend leveraging the internal Apple DLS synth. These backends will be available in addition to the current FluidSynth one, which provides very good quality, but uses expensive floating point DSP calculations and requires external soundfont files.

Meanwhile, I've published on GitHub this repository including a port of Sonivox EAS for Linux with ALSA Sequencer MIDI input and PulseAudio output. It also  depends on Qt5 and Drumstick. Enjoy!

Sonivox EAS for Linux and Qt:
https://github.com/pedrolcl/Linux-SonivoxEas

Related Android project:
https://github.com/pedrolcl/android/tree/master/NativeGMSynth

Sunday, November 2, 2014

Drumstick Metronome (kmetronome 1.0.0) and Drumstick 1.0.0 Libraries in the Whole Picture

I've released in the past weeks some things labeled "Drumstick" and also labeled "1.0.0". What is all this about?

Drumstick is the name of a set of Qt based libraries for MIDI processing. Current major version of the Qt Frameworks is 5, which are binary incompatible with the older Qt4 libraries. Latest Qt4 based drumstick release was 0.5.0 published in 2010. Newest Qt5 based release is 1.0.0, published on August 30 2014.

Drumstick 1.0.0 is not binary compatible with the older one, nor even fully source compatible. In addition, it contains a new "drumstick-rt" library which is a cross-platform MIDI input-output abstraction. Based on Drumstick 1.0.0 I've released two more applications: vmpk 0.6.0 and kmetronome 1.0.0 (now renamed as "Drumstick Metronome").

There are other applications based on the old drumstick 0.5.0 libraries out there: kmid2 and kmidimon. I'm no longer the kmid2 maintainer, but I will release (time permitting) a "Drumstick Karaoke" application replacing kmid2, and of course also a new kmidimon (naming it as Drumstick-Whatever). Meanwhile, Linux distributions may have a problem here shipping the old and new programs together. Not a big problem, though, because the runtime libraries are intended to co-exist together on the same system. The runtime dependencies are:
  • vmpk-0.6.0 and kmetronome-1.0.0 depend on drumstick-1.0.0
  • kmidimon-0.7.5 and kmid2-2.4.0 depend on drumstick-0.5.0
If you want to distribute all kmidimon, kmid2, vmpk and kmetronome latest releases for the same system, you need to distribute also two sets of drumstick runtime libraries. This is possible because the old and new  drumstick libraries have a different SONAME. What is needed is to also rename the packages accordingly.

$ objdump -p /usr/lib64/libdrumstick-alsa.so.0.5.0 | grep SONAME
  SONAME               libdrumstick-alsa.so.0

$ objdump -p /usr/local/lib64/libdrumstick-alsa.so.1.0.0 | grep SONAME
  SONAME               libdrumstick-alsa.so.1


For instance, you may name your old drumstick package as "drumstick0" and the new one "drumstick1", or append the Qt name like in "drumstick-qt4" and "drumstick-qt5", or keep the old one as plain "drumstick" and rename only  the new one. Whatever makes you happier. These suggestions are for people packaging drumstick for Linux distributions. If you are compiling drumstick yourself and installing from sources, then you don't need to worry. You can use the same prefix (usually /usr/local/) without conflicts, except only one set of headers (usually the latest) can be available at the same time in your system. This also applies to the "-devel" packages from distributions.

There is only one thing left now. The whole picture :-)
 

Sunday, September 14, 2014

Notes about VMPK 0.6.0 for Desktops

Dear Blog,

It has been a long time, but a week later after the release it is time to discuss some aspects of the latest version of our Virtual MIDI Piano Keyboard for desktop computers.

Where to start? an interesting point is the change of architecture with the replacement of RtMIDI by Drumstick-RT. This library is new and homegrown, part of the Drumstick family which includes Drumstick-File and Drumstick-ALSA as well. The motivation to create it was the difficulty of extending RtMIDI with other drivers different to the ones chosen by his author. This was not a problem in the past, because the RtMIDI sources were always included in the application, and any customization was possible and easy. Now, thanks to the Taliban of Linux distributions forcing the dynamic linking of RtMIDI this is simply not feasible - to the hell with the freedom of Free Software!. Throwing away the ipMIDI backend was not an option. On the other hand, with Drumstick RT is not only possible, but new backends can be compiled separately and installed in the system without recompiling neither VMPK nor Drumstick, because they are in fact plugins. By chance it also has fixed the bug reported (in 2009!) in ticket #15: LinuxSampler did not appear among ALSA connections, because LinuxSampler MIDI port has no flag providing proper characterization and RtMIDI (unlike Drumstick RT) filters out that port.

The replacement of the RtMIDI library with Drumstick-RT was a long time plan, not only for VMPK, but for Drumstick as well, that finally took place now. I hope that this shall be a foundation for features like recording/playback in the future. The only thing that maybe would be missing for some users is the jack-midi interface, but on the other hand Unix users will enjoy native OSS support, and also FluidSynth direct output on all operating systems, meaning  also configurable SoundFonts: a very demanded feature for Windows users.

Another long time request finally implemented is the ability of displaying any number of keys, for instance 88 keys, instead of full octaves, starting with any arbitrary white note (ticket #39), like configuring 25 or 49 keys (depending on which device, laptop or tablet, and screen size you have). Congratulations to all the requesters and sorry for keeping you waiting for this feature so long.

Finally, the migration to Qt5 has happened. This means also replacing a dependency from Xlib to XCB, that hopefully will bring future support for wayland/whatever. The victim has been the keyboard grabbing feature, that was only working on Linux thanks to a now lost X11/Qt4 feature. I hope to bring it back in the future with a multiplatform implementation.

There are now binary packages for 32/64 bit Linux users that shall work on any modern distribution, in the form of installers packaged using the excellent BitRock InstallBuilder. That means including all the required dependencies inside the package, in the same way the libraries are included in the Windows and Mac OS X setup packages. In order to reduce the package weight, superfluous things like Jack support were excluded, because the new FluidSynth backend is intended to provide instant audio out of the box without requiring the users to search, find, ask, learn, install, try and tweak. Something that traditional Linux distributions have failed to do, in despite of their duty of integration and making the life easier to their users. I am pretty sure that many Linux distros will fail to provide VMPK native packages for this release like they did for the 0.5.x  series (see Debian, Ubuntu and Fedora repositories for instance). Prove me wrong, and this kind of binary Linux packages would be deprecated.

Friday, December 27, 2013

VMPK for Android

Hi, Blog!

A lot of time since the last post. Let me announce a new port of VMPK, for Android  (4.x) devices. It is available in Google Play.


There are two apps, a paid version (0.5€) and a free one (gratis) with a small advertisement. It is not based on Qt, and it is not open source. It is a Java port rewritten from scratch using the native Android MIDI synthesizer and native Android themes. But on the other hand, is quite similar to the old N9 port, as you can see in the following screenshots, but with several additional features.



Being mostly a Java app, it includes some C code. The internal MIDI synthesizer is Android's "Sonivox EAS", which is part of AOS. The library is included in all recent Android versions, but it is not a public API, so I've compiled the library with a customized configuration and different features resulting a smaller binary and included it in the APK along with some other native code, mainly opensl_stream by Peter Brinkmann for interfacing the synth with Android's OpenSL ES audio output. An interesting aspect of the synth is the embedded GM soundfont using very small amount of memory, and not needing external data files.

Some features are: ipMIDI compatibility (MIDI OUT only) using UDP multicast and Wireless network. Accelerometer driven sliders for velocity, controllers and bender (like the N9 port), configurable number of keys and initial key, among other goodies.


Happy holidays!