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.