Sunday, August 14, 2022

Drumstick Libraries 2.7.1 Released

Drumstick is a set of MIDI libraries using C++/Qt idioms and style. Includes a C++ wrapper around the ALSA library sequencer interface: ALSA sequencer provides software support for MIDI technology on Linux. A complementary library provides classes for processing SMF (Standard MIDI files: .MID/.KAR), RIFF MIDI (.RMI), and Cakewalk (.WRK) file formats. A multiplatform realtime MIDI I/O library and a GUI Widgets libraries are also provided for Linux, Windows, and Mac OSX.

This is another sonivox related release. Please see: https://github.com/pedrolcl/sonivox

I didn't want to make the sonivox dependency mandatory, because there may be good reasons for an user to avoid building drumstick with all its features. A final user may be interested in FluidSynth output only (which is also an optional feature) or even using ALSA sequencer only, without any soft-synth at all.

But what is a legitimate choice for a final user may be a questionable restriction for a distribution, because you may not know all use cases of your users. In this case, SonivoxEAS is the default Linux output for drumstick-vpiano and VMPK, because I think that any user installing those programs the first time should be able to hear sound by default, without needing to configure/investigate about MIDI or SoundFonts. Otherwise, there will be many users complaining that their Linux virtual pianos do not produce any sound!

On the other hand, until now the sonivox library sources were embedded inside the drumstick source tarballs, and statically linked to the SonivoxEAS backend. This was against most Linux distros packaging policy. Providing an standalone shared library instead, the issue has been fixed.

Changes in v2.7.1:

  • Fixed ticket #45: the sonivox library dependency (for the SonivoxEAS synth backend) is optional, and easily forgotten by 3rd party packagers. The build system configuration now fails with an error message if the sonivox library is missing unless the cmake variables USE_SONIVOX and USE_PULSEAUDIO are set to OFF. Same failure with the FluidSynth backend and the variable USE_FLUIDSYNTH, and the ipMIDI Network backend and USE_NETWORK.
  • Fixed underlinking in some RT backends.

Compilation minimum requirements for all platforms:

  • C++11 compiler
  • CMake 3.14
  • Qt5 >= 5.9 or Qt6 >= 6.2 (with Qt6Core5Compat library dependency for Drumstick::File)

Feature dependencies (for some platforms):

  • ALSA (Linux only)
  • PulseAudio (Unix)
  • D-Bus (Unix)
  • Sonivox (Unix)
  • FluidSynth (All platforms)

Copyright (C) 2009-2022, Pedro Lopez-Cabanillas License: GPL v3 or later

Project web site https://sourceforge.net/p/drumstick

Online documentation https://drumstick.sourceforge.io/docs/

Downloads https://sourceforge.net/projects/drumstick/files/2.7.1/

Thursday, August 11, 2022

Summer Releases

This week I have published several new versions of my music applications:

The first two applications, kmetronome and kmidimon, are now over fifteen years old and are only available for Linux. These two new versions are simply bug fixes, with no new features. But it is interesting to note that in FlatHub they are already based on Qt6 and supporting both Wayland and X11, although the packages in AppImage format still use Qt5. The chances of finding these applications in the official repositories of Linux distributions are slim. In fact, kmidimon was removed from the official Debian repositories with some lame excuse, and it is unlikely to be included again. I can't do anything about it, so please: direct complaints where they belong. Or use the new available distribution formats or the unofficial repositories, like Debian Multimedia, which includes the three mentioned applications and many others.

The other app, dmidiplayer, is much newer and cross-platform. It is the successor to Kmid2, the KDE karaoke application that I rewrote many years ago. In this new version the most remarkable new feature is the persistent configuration of the songs. This is a feature that was already present in the old Kmid2 and that allows you to store the tempo, general volume, pitch transposition, and MIDI channel settings for each song, which will be applied when it is played again in the future. The other novelty is the individual volume adjustment for each MIDI channel, something that was not possible in Kmid2.

After all these years, it is curious that it is still possible to find Kmid2 in one distribution: Fedora, despite being a Qt4/KDE4 application. So a functional comparison of both applications is not only possible, but easy to do. In my opinion, with this version dmidiplayer has reached parity in terms of functionality with Kmid2. On the other hand, the new architecture has allowed the application to be available on other Unixes (such as FreeBSD) in addition to Linux, macOS, and Windows.

I guess the next app to get updates will be VMPK. There is no forecast yet of the changes it will bring, but there is a recurring request that I will not do: MIDI Jack support. This is not to say that it is not possible to use Jack MIDI with VMPK, because in fact there is an utility called 'a2jmidid' that serves as a translation layer between applications using the ALSA Sequencer and Jack MIDI. On the other hand, for VMPK to use new native backends it is only necessary to implement Drumstick::RT plugins. And this can be done by any interested developer, and then independently distribute the out-of-tree plugins. I've opened a discussion on GitHub about this. Anyone interested, please read and ask your questions there.

Sunday, July 31, 2022

Dog days releases

It's hot weather these days here at Barcelona! It is also time for releases...

A new synthesizer library has been released on July 28, 2022: Sonivox. This project is a fork of the Android Open Source Project 'platform_external_sonivox', including a CMake based build system to be used not on Android, but on any other computer Operating System. Google licensed this work originally named Sonivox EAS (Embedded Audio Synthesis) from the company Sonic Network Inc. under the terms of the Apache License 2.0.

This is a Wave Table synthesizer, not using external soundfont files but embedded samples instead. It is also a real time GM synthesizer. It consumes very little resources, so it may be indicated in projects for small embedded devices. There is neither MIDI input nor Audio output facilities included in the library. You need to provide your own input/output.

Until now, the "eassynth" Drumstick::RT backend included the sonivox library sources, compiled and statically linked. Now, the build system search for an external sonivox library like any other dependency, and dynamically links the shared library when found.

Please find here the source tarballs.

There are two other projects/prototypes that use this library in my portfolio. They embed it as a git submodule, or find it as an external dependency:

I prefer to have all the code in a single place, avoiding duplication. But it is not only my personal convenience, Linux users would have a single copy of the library installed in their systems, which will be easier to patch or replace by the distribution vendors when needed. Of course this would be not possible if their only choice is to install the applications as an AppImage, or a Flatpak.

The other release today July 31, 2022 is Drumstick 2.7.0

A brief summary of changes for this release:

  • ticket #44: removed sonivox library sources from the source tree. The Sonivox library is an external dependency.
  • ticket #43: Drumstick::RT dummy plugins now include its own configuration dialogs.
  • ticket #42: Drumstick::Widgets - fixed piano designer plugin to show more properties.
  • ticket #41 Drumstick::Widgets: Option to use subscript octave designation.
  • Drumstick::ALSA registering SequencerEvent with qMetaType.
  • Drumstick::RT FluidSynth plugin updated with changes in fluidsynth 2.2.8
  • Utils: vpiano uses the subscript octave designation option.

Compilation minimum requirements for all platforms:

  • C++11 compiler
  • CMake 3.14
  • Qt5 >= 5.9 or Qt6 >= 6.2 (with Qt6Core5Compat library dependency for Drumstick::File)

Feature dependencies (for some platforms):

  • ALSA (Linux only)
  • PulseAudio (Unix)
  • D-Bus (Unix)
  • Sonivox (Unix)
  • FluidSynth (All platforms)

Downloads

Tuesday, April 5, 2022

Procrustes' Piano

In Greek mythology, Procrustes was a rogue smith and bandit. He had an iron bed, in which he invited every passer-by to spend the night. If the guest was shorter than the bed, he used his smith hammer to stretch them to fit. If the guest proved too tall, Procrustes amputated the excess length; nobody ever fitted the bed exactly. Procrustes continued his reign of terror until he was killed by Theseus.

In common language, a "Procrustean bed" is an arbitrary standard to which exact conformity is forced. Pianos are one example of "One size fits all" disregarding Ergonomics absolutely.

The number of keys is almost always 88, no matter that the lowest notes and the uppermost octave is rarely used. In fact, Mozart's forte piano had only 66 keys, and the keys colors were often reversed. Today, we can find instruments manufactured by Bösendorfer with 92 Keys and even 97 Keys, but other examples are rare.

But the worst arbitrariness is the keys size. As Lionel Yu explains, this is the Piano's Darkest Secret. It is not just the size of the hand that greatly influences performance, given the standardized size of the piano keys, but also may be the cause of musicians' serious injuries or physical disorders. Linda Gould tells his experience with narrower keys in My Piano Has a Secret. There are smaller size violins: 1/2, 3/4 adapted for young people; Why there are not smaller size piano keys as well? This is exactly what the Pianists for Alternatively Sized Keyboards organization is advocating: "If everyone plays the same size, most are playing the wrong size!".

I would like to be able to contribute more to making things better for pianists, but what I can do is making VMPK as flexible as possible. You can configure the number of keys as you wish: 25, 49, 88, up to 121 keys for ten octaves maximum (MIDI has a limit of 128 notes). You may also choose the initial note, and of course the octave shift (base octave) and transposition in semitones. The colors of the keys are also fully configurable, and the key size is the easiest thing: you only need to stretch or shrink the program window to adapt the key size to your taste and needs.

I've just published a new release of Drumstick Libraries 2.6.0 and VMPK 0.8.7, focused on fixing bugs like the handling of low level computer keyboard events (which wasn't working on Wayland before) and touch-screen events on Linux (Wayland and X11). The program can handle as many fingers as the touch-screen supports, but I've noticed that Gnome 41 on Wayland has built-in gestures with three fingers that can't be disabled (or there is not yet an extension/tweak to do so), and those gestures are the cause that you can only use two fingers on VMPK. Sorry!

Friday, March 18, 2022

Spring is coming

I've just released Barcelona Trees, Beta2 v0.0.4, which is just another extremely niche application, totally unrelated to MIDI, but also based on the Qt frameworks like my other free software projects.

The motivation of this program is to help Barcelona visitors or dwellers, answering questions such as:

  • What trees are nearby? (from manual or GPS location)
  • What trees are on a given street or garden?
  • Where can I find specimens of a certain genus/species?
  • For each specimen, obtain more information about its species from existing data on Wikipedia and public images.

screenshot

This may be useful in many ways, from Botany students to simply curious people. Barcelona has plenty of trees: almost 230k at this moment. And the Open Data BCN service periodically publishes several datasets cataloging the Geo-located specimens in public spaces that are used by this application.

Palau GC- tarongers0682-01

As an example, there are more than 3k Bitter Orange trees like the above (the Courtyard of the orange trees is not in a public place, it is inside an official building) used as ornamental. They are not edible in raw, but can be used for cooking. On the other hand, there are a few (dozens) other Citrus gender specimens that are truly edible, and you may find using the program. Enjoy!

Farewell

This release using Qt 5.15 may be the last one for this application. It won't be a Qt6 migration, because the Qt Location Maps have been removed in Qt6, but this may change in the future...

Another functionality lost in Qt6 is the QTextCodec class, removed from QtCore and moved to the Core5Compat module that has been already mentioned here, and provides conversion from many text encodings to Unicode. This issue has impacted applications reading MIDI files, and the Drumstick::File library. Well, I've tested two possible replacements...

iconv() is a POSIX API, and it is included in the C library of many Unix systems, like the GNU libc. This may be detected by cmake, and in this case no additional library needs to be linked to the application program, but the external libiconv is also supported when needed.

Character set detection was never provided by Qt. The iconv() POC uses the latest uchardet library (0.0.7 at the time of writing this), which only supports pkg-config. A newer version will include also support for find_package() and imported targets. On the other hand, libICU provides charset detection in addition to Unicode conversion.