Showing posts with label Drumstick. Show all posts
Showing posts with label Drumstick. Show all posts

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.

Sunday, December 26, 2021

Winter Releases

In addition to the usual bug fixing, a common pattern across all projects are the changes related to the transition to Qt6, still experimental but mature enough, while keeping compatibility with Qt5. One stopper in this transition is the removal of the QTextCodec class in Qt6 core libraries, moved to the Core5Compat module, risking to be definitely removed at some point in the future. Some methods in Drumstick::File that depend on this class are deprecated now. This functionality is key for data preservation when parsing/importing MIDI files containing text metadata (titles, comments, names, copyrights, lyrics, markers, ...) encoded in any random scheme available in the last 30 years. But the alternative in Qt6 is the QStringConverter and related classes that only supports a very limited set of encodings, mostly Unicode.

This problem deserves deeper thoughts...

If we were talking about pure text files, this could be solved using for instance the iconv command line Unix utility, that converts text files from one encoding to another, for instance from ISO-8859-5 (Cyrillic alphabet) to UTF-8. Then, the new text file encoded in Unicode could be processed by a Qt6 program without limitations. But MIDI files are compact binary structures that can't be processed directly with that utility.

The second root of the problem comes from the SMF nature itself. The Standard MIDI File format was created as an interchange file format, so the music created in sequencers using proprietary storage formats could be exported and retrieved by another sequencer. Sequencer machines and software at one point become deprecated, stopping to work, and can't be used anymore. Composition files created in those systems are now digital garbage for the trash bin, except if the author took the precaution of keeping exported MIDI files. Those are now the equivalent of modern digital manuscripts, which we try to preserve and keep them readable for the foreseeable future within our musical applications.

Changes in Virtual MIDI Piano Keyboard v0.8.6:

  • Fixed advanced setting on connections dialog.
  • Enabled empty input connection after fix on drumstick-ALSA: requires external connections utility.
  • Better inverted piano colors after fix on drumstick-widgets: changed the white keys background picture depending on the key background color.
  • Removed dependency on Qt6::Core5Compat when building with Qt6
  • Requires: drumstick-2.5

Downloads: http://sourceforge.net/projects/vmpk/files/0.8.6/

Changes in Drumstick MIDI Player v1.5.3:

  • After drumstick ticket #37: WRK format markers are supported
  • Replaced deprecated signals from drumstick-file when building with Qt6
  • Requires: drumstick-2.5

Downloads: https://sourceforge.net/projects/dmidiplayer/files/v1.5.3/

Changes in Drumstick Metronome 1.3.0

  • Czech translation updated, by Pavel Fric
  • Qt6 compatibility fixes
  • New build options: USE_QT and BUILD_DOCS
  • Revised and updated documentation system: using Pandoc to create man page and help documents
  • New settings: qt style, forced dark mode, and internal icon theme
  • Added action icons: internal theme based on breeze
  • Desktop icon replaced

Downloads: https://sourceforge.net/projects/kmetronome/files/kmetronome/1.3.0/

Changes in Drumstick MIDI Monitor v1.2.0

  • Czech translation updated, by Pavel Fric
  • Revised and updated documentation system: using Pandoc to create man page and help documents
  • New build options: USE_QT and BUILD_DOCS
  • Qt6 compatibility fixes
  • Save recording fixes
  • Fixed mute track functionality
  • Fixed event playback highlighting
  • Support WRK file format markers, provided by Drumstick 2.5
  • Desktop icon replaced

Downloads: https://sourceforge.net/projects/kmidimon/files/1.2.0/

Changes in WRK2MID v1.1.0

  • New build option: BUILD_DOCS.
  • New Build option: USE_QT to choose between Qt5 and Qt6. Closes ticket #3.
  • Convert WRK track Port parameter. Closes ticket #2.
  • Convert WRK markers into SMF text markers. Closes ticket #1.
  • Displayed compiled and runtime library version information.

Downloads: https://sourceforge.net/projects/wrk2mid/files/v1.1.0/

Changes in Drumstick Libraries v2.5.0:

  • New build options: BUILD_ALSA, BUILD_FILE, BUILD_RT, BUILD_WIDGETS to control building only some of the libraries.
  • RT, VPiano: Fixed ALSA and CoreMIDI backends, enabling empty connections (for using external connection tools).
  • Deprecation of the Drumstick::File functions affected by the QTextCodec class removal on Qt6.
  • Raised macOS deployment target to 10.13 (High Sierra).
  • Widgets: changed the white keys background picture depending on the key background color.
  • VPiano: new option to display inverted key colors.
  • File: WRK format markers processing. Closes ticket #37.

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

Monday, October 25, 2021

Autumn Releases

There is a new batch of releases: Drumstick Libraries, VMPK, and Drumstick Multiplatform MIDI File Player. Below is the change log for each one.

There is a common feature: USE_QT can be given in the cmake command to choose which Qt major version (5 or 6) to prefer. By default (if not set) it uses whatever is found. I've never needed something like that, because all my libraries are installed at $HOME/Qt/x.y.z which is the common practice when using the Qt online installer. In cmake you use CMAKE_PREFIX_PATH to provide the list of non standard prefixes where you have dependencies, and this solution is both simple and comfortable. But some Linux distros decided that it is a good idea to install system wide Qt5 and Qt6 versions together. In this case, the build system needs some help to decide which one to prefer. The projects build and run using Qt6, but I've not tested it too much and produce many warnings at build. The binary packages are using Qt 5.15 for now.

Another common point is the fix a crash on Linux when using the connections dialog, but the system does not have any MIDI available port. This was reported by the same 'Arch' user who needed the USE_QT option. It was also quite difficult to reproduce, partly because poor stack trace information was provided, and mainly because by default ALSA sequencer installations have at least one MIDI port, as they load by default the kernel module 'snd_seq_dummy', which provides the 'Midi Through' ports. The only way to reproduce the crash is to remove/blacklist the module 'snd_seq_dummy' and disconnect whatever MIDI device attached to the system. I can imagine the users who blacklisted 'snd_seq_dummy' and forgot about it, one day will be searching Internet for a MIDI Thru utility. Good luck!

Changes in Drumstick Libraries v2.4.1

  • New build option: USE_QT to choose among Qt major versions (5 or 6). Fixes ticket #36.
  • Fixed ticket #35: build with Qt 5.11 is possible again.
  • Vpiano: fix for a similar bug to vmpk ticket #74: crash in Linux.
  • Widgets: using buffer time in FluidSynth configuration dialog.
  • Fixed wrong licenses in several files.
  • Fixed defaults and ranges for the FluidSynth RT backend parameters, using the same values as the upstream library.
  • Fixed validation of parameters in the FluidSynth configuration dialog.
  • Widgets: Swedish translation updated. Thanks to Magnus Johansson.
  • Widgets: Czech translation updated. Thanks to Pavel Fric.

Changes in Virtual MIDI Piano Keyboard (VMPK) v0.8.5

  • New build option USE_QT with valid values 5 or 6, to choose which Qt major version to prefer. By default (if not set) it uses whatever is found.
  • Fixed ticket #74: crash under Linux using the MIDI Connections dialog if there are no suitable MIDI inputs/outputs available.
  • Fixed error checking of DwmGetWindowAttribute() call. This caused a problem in Windows 7 running the "Windows Classic" theme.
  • Swedish translation updated. Thanks to Magnus Johansson.
  • Czech translation updated. Thanks to Pavel Fric.

Changes in Drumstick Multiplatform MIDI File Player v1.5.2

  • New build option USE_QT to choose among Qt major versions (5 or 6). By default (if not set) it uses whatever is found.
  • Fix for crash in Linux when using the MIDI connections dialog, and there are not suitable MIDI ports available.
  • Czech translation updated. Thanks to Pavel Fric.

Downloads

https://sourceforge.net/projects/drumstick/files/2.4.1/

https://sourceforge.net/projects/vmpk/files/0.8.5/

https://sourceforge.net/projects/dmidiplayer/files/v1.5.2/

Wednesday, September 22, 2021

New Releases and the New Picture

A new batch of releases from the last weekend: Drumstick libraries 2.4.0, Drumstick Multiplatform MIDI File Player 1.5.1 and Drumstick MIDI Monitor 1.1.0 are out, and here are the main changes for each one:

Drumstick Libraries v2.4.0:

  • implemented ticket #29: RIFF RMID file support. New utility dumprmi, and guiplayer updated.
  • implemented ticket #32: missing library version functions in File and RT libs
  • implemented ticket #33: versioninfo object for windows libraries
  • Enabled by default the internal reverb on macOS DLS Synth
  • Avoided hardcoded font family name in vpiano

Drumstick Multiplatform MIDI File Player v1.5.1:

  • Fixed GH ticket #6: The dependency target "update_helpfiles" of target "dmidiplayer" does not exist. The pandoc utility is optional again.
  • Fixed error checking of DwmGetWindowAttribute() call. This caused a problem in Windows 7 running the "Windows Classic" theme.
  • Support for RIFF MIDI files, provided by Drumstick 2.4.0
  • Czech manual updated, thanks to Pavel Fric

Drumstick MIDI Monitor v1.1.0

  • Removed warnings building with Qt >= 5.15
  • MIDI texts/lyrics encoding defaults to Latin1
  • New options: Qt Style, Dark mode, and internal icon theme based on breeze
  • CMake version >= 3.14
  • Added SCM Revision to the about box
  • Fixed file info dialog (initial tempo, ...)
  • Support for RIFF RMID (.rmi) file format

A common point for all the above is the RIFF MIDI file format support. Citing the LOC:

It is a wrapper format for MIDI data, as first specified by Microsoft, and later extended by MIDI.org (an arm of the MIDI Manufacturers Association) to permit the bundling of both MIDI files and Downloadable Sounds (DLS) files. According to Multimedia Programming Interface and Data Specifications 1.0, August 1991.: "The 'RMID' format consists of a standard MIDI file enclosed in a RIFF chunk. Enclosing the MIDI file in a 'RIFF' chunk allows the file to be consistently identified; for example, an 'INFO' list can be included in the file."

The RIFF format specifications were published in 1991 in Microsoft Windows Multimedia Programmer's Reference, with a brief section devoted to RMID (8-31). The extended specification that documented how both MIDI and downloadable sounds could be bundled in an RMID file (technical note RP-029, "Bundling SMF and DLS data in an 'RMID' File"), was published by the MIDI Manusfacturers Association (MMA) in 2000. The co-authors represent IBM Research, Kurzweil, Microsoft, and Sonic Foundry. In 2001, MMA published the XMF_1_0 specification, which they now prefer to RMID.

The implementation in Drumstick::File offers read-only functionality, and requires the existing SMF class to process the MIDI data portion. The DLS processing is missing, because I've been unable to find a single example of usage, and I suspect that nobody has used it in the real world. Anyway, there is a new utility 'drumstick-dumprmi', which is similar to the other commandline utilities printing the file contents as text in the terminal, with the extra functionality of extract/convert the MIDI data into a standalone SMF file.

Last month was published another utility: wrk2mid v1.0.0 which converts WRK Cakewalk files into SMF. This is something that can be done in Windows using the program Cakewalk by BandLab, which is gratis as a beer, but 'wrk2mid' can be compiled and run on Linux and macOS, so maybe it could be useful for someone. I don't expect to see it on Linux distributions any time soon, though. See: https://wrk2mid.sourceforge.io/

There was a post from 2014 with a diagram of the relationship between the Drumstick libraries v1.0 and applications at the time. Now, all my applications depend on Drumstick v2.x and there are new ones too, so may be this is a good time to paint the new picture...

The new picture

The new picture

It is a pending subject to renew the repertoire included in dmidiplayer as sample songs. Here is a future one, rendered on macOS (Mojave) using dmidiplayer v1.5.1 with FluidSynth v2.2.3 and GeneralUser Soundfont.

The song is "Negra Sombra" with lyrics by Rosalia de Castro (1837-1885), published in 1880 in her book "Follas Novas", and music by Xoan Montes (1840-1899), a composer from my own birthplace (Lugo). The song was premiered in La Habana, Cuba, in 1892. You may recognize the melody if you like choral music, or because an arrangement by Carlos Nuñez and Luz Casal was included in the soundtrack of the Spanish drama film "The Sea Inside" (2004, Spanish: Mar adentro). This rendition is derived from a score and MIDI sequence by Lalus fecit edition 2013 licensed as CC-by-nc-sa.

Publishing this song at YouTube triggered the algorithm claiming it as a copyrighted work by Sony. I am not monetizing my videos at YouTube so it doesn't matter in practice, but it bothers me a lot so I'm disputing the claim. Google and Sony are taking a work that is in the public domain, and they are appropriating it. That may be seen as criminal conversion, or at least cultural appropriation.

Friday, January 15, 2021

Drumstick 2.0 and related releases

Drumstick 2.0.0 has been released. There are four libraries now:

  • drumstick::ALSA (Linux only)
  • drumstick::RT
  • drumstick::File
  • drumstick::Widgets

Unit tests
New features include:

  • Namespaces reorganization
  • Code and build systems modernization
  • New library: Drumstick::Widgets providing a PianoKeybd widget plugin for Qt Creator and Qt Designer
  • New unit tests for Drumstick::Widgets and Drumstick::File
  • Removed OVE support from Drumstick::File
  • Translations for Drumstick::Widgets and utils
  • Documentation of the new API for Drumstick::Widgets
  • Drumstick::RT plugins versioning, allowing runtime coexistence between plugins of drumstick-1 and drumstick-2
  • License GPLv3 for all components

The new library Drumstick::Widgets includes the virtual piano widget used by VMPK and drumstick-vpiano, and also several configuration dialogs related to some Drumstick::RT plugins. The new features are showcased by the drumstick-vpiano application (and also VMPK, of course).

Drumstick Virtual Piano


The piano widget has been improved with some new features, like providing a new signal carrying the played MIDI note name and number, new customizable palettes for the keys background and foreground (font) colors, configurable fonts, and many options for showing note names:

  • Show note names: Never / Minimal / When activated / Always
  • Black keys names: Sharps / Flats / Nothing
  • Names orientation: Horizontal / Vertical / Automatic
  • Note names: Standard / Custom
  • Octave names (MIDI note 60): C / C3 / C4 / C5

There is also a new plugin for QtCreator and QtDesigner with the name 'libdrumstick-vpiano-plugin.so' which is equivalent to the old Qt4 'vpiano' plugin. It provides design-time support for creating Qt applications leveraging the virtual piano component. Needs to be compiled with the exact same version of the associated Qt5 development tools.


QtCreator plugin

Following the new Drumstick release, several programs have been released too:

VMPK 0.8.0

    Depends on drumstick::RT and drumstick::Widgets (also drumstick::ALSA in Linux)
Drumstick Metronome 1.2.0 (a.k.a. kmetronome, Linux only)
    Depends on drumstick::ALSA
Drumstick MIDI Monitor 1.0.0 (a.k.a. kmidimon, Linux only)
    Depends on drumstick::ALSA and drumstick::File
All of the above are hosted in SourceForge. AppImages for Linux x64 are available.

SonivoxEas 1.3.0

    Depends on drumstick::ALSA (Linux only)
This one is hosted in GitHub, and was presented in this blog before.

Finally a note about VMPK For Android. This app has been removed by Google from the Play Store, with some bureaucratic excuses. It never depended on Drumstick. I need to think about releasing it again, but never returning to the Play Store. I hate app stores.

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.

Saturday, October 30, 2010

Good times are gone

My sabbatical is over, and all this month I have been busy on a full time job, programming Windows applications in C# for a living. For this reason I have not had much time to devote to open source projects, and the forecast is that this situation will not change in the near future.

In the past few months I have contributed as much as I could to the free software community with MIDI applications, an area I know well and where  there is not too much material, particularly on Linux. Result of this has been KMid2 and Drumstick. I have also maintained my previous projects: KMetronome and KMidimon. About VMPK, this month has beaten their previous records on SourceForge with more than 10000 downloads in October. Thank you very much to all Mac and Windows users who trusted this software, and of course to all participants, contributors and translators who made it  possible. In Debian, the situation is also "fantastic", with 137 installations to date, and only one release late. I have no data on other Linux.

Friday, September 3, 2010

Drumstick Time

A new Drumstick version is in the oven, with two tasty novelties:

1. OVE file parsing support (files created by the Overture program).
The code for this feature has been contributed by Rui Fan. This file format can be played by the included program drumstick-guiplayer, in addition to the SMF and WRK formats. There is also a new drumstick-dumpove CLI utility to inspect the file contents as text.

2. Acquisition of real-time priority, using RealtimeKit.
Until now, the thread processing MIDI input from ALSA tried to acquire real-time priority using the RLIMIT_RTPRIO mechanism, which requires some configuration and administration work. If the above mechanism is not available, now Drumstick tries to acquire real-time priority from RealtimeKit.

This release is scheduled for sometime during next week.

What's next?

At this moment there are two libraries: drumstick-alsa (Linux) and drumstick-file. There will be two more: drumstick-win and drumstick-mac. The foundations of these two new libraries are already implemented in KMid2. On the other hand, it is desirable to unify all the backends for all platforms and file formats under a single set of multiplatform interfaces: drumstick-simple. VMPK will benefit from this, because replacing RtMIDI by Drumstick will be easier to implement features like MIDI file recording, playback and arpeggiator.

Friday, May 21, 2010

Weird KMetronome

After a long development cycle focused almost exclusively on KMid, it's time to give some love to other projects. I've been working lately on KMetronome, a MIDI metronome for KDE and ALSA. It is the oldest project of my little family.

The only issue in KMetronome's tracker is this one year old request, which has suggested the title of this post. The "Weird Metronome" is a popular simple MIDI metronome for Windows, which is the origin of "Open Metronome".

The major advantage of Weird / Open Metronome is the definition of rhythm patterns. The drawback is that it only works on Windows. It may be a good idea to make a Linux port. His definition of patterns is very simple and elegant, if somewhat limited. It has two branches: one producing MIDI events, and the other producing digital audio.

Although I can't rule out porting Open Metronome to Linux in the future, I've decided to implement the pattern editor differently. Here are some screenshots of the upcoming version 0.10 of KMetronome, dressed in Skulpture style.

Settings

Like KMidimon and VMPK, now KMetronome also uses an instrument definition file in .INS format, the same format as Qtractor, TSE3, Cakewalk and Sonar. I've added an "Output instrument" drop-down list in order to choose one among the standard General MIDI, Roland GS and Yamaha XG drum maps. You can add more definitions creating a file named "drums.ins" at $HOME/.kde4/share/apps/kmetronome. The options "Bank", "Program", "Weak note" and "Strong note" are now drop-down lists as well.

Main Window

There is a new button "Patterns" opening the rhythm pattern editor, and a drop-down list to choose the pattern. The default "Automatic" value means that the program generates the pattern as usual, using the notes set in the configuration dialog (Strong / Weak) and the rhythm definition provided by "Beats / Bar" and "Rhythm figure". The same drop-down list contains also the names of the user-defined patterns.

Pattern Editor

This is a new dialog box. You may edit, test and select patterns with it. To create new patterns, you simply save the current definition under a new name. Patterns are represented by a table. The rows in the table correspond to the percussion sounds. You can remove and add rows from a list of sounds defined by the instrument settings in the configuration dialog. The number of columns in the table determine the length of the pattern, between 1 and 99 elements of any rhythm figure.

Each table cell accepts values between N = 1 and 9, corresponding to the MIDI velocity (N * 127 / 9) of the notes, or 0 to cancel the sound. Valid values are also "f" (forte) and "p" (piano) corresponding to variable velocities defined by the rotary knobs (Strong / Weak) in the main window. The cell values can be selected and modified using either the keyboard or the mouse. No need to press the stop button before modifying the cells ...

This version is not ready yet, but will be probably published by the middle of next month. For now, you can get the sources from the Subversion repository. You need to install Drumstick before compiling it.

By the way, I'm planning to stop distributing binaries for all programs. If you like them and your favorite Linux distribution does not include Drumstick or KMetronome, it would be a good idea to start opening bug reports in its  enhancement request system, or sending messages to the distribution's mailing lists or web forum.