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.

Saturday, May 15, 2021

Drumstick Multiplatform MIDI File Player, Released and Reloaded

Drumstick Multiplatform MIDI File Player 1.3.0 has been released this week, right after the Drumstick Libraries 2.2.0 and VMPK 0.8.3; business as usual: we write programs, we release stuff. This post is about the first program, a MIDI file player (reloaded). Let's start by the beginning...

10 years ago, there was not a fully featured MIDI file player for Linux. Of course, there was Linux software that could (barely) play MIDI files, but nothing comparable to the vanBasco MIDI Karaoke player (which is a Windows 32 bit application, updated the last time in 2006). This program can be run in Wine, by the way. The key features of the vanBasco player are described in its site, and anyone with a musical background can identify its value, beyond the entertainment use case:

  • lyrics can be displayed in a resizable window or full-screen
  • control window: ability to change tempo, volume, key of song
  • real-time MIDI output window: shows notes, volumes, and instruments, can mute or play solo individual instruments
  • piano view: displays notes on a big piano keyboard

The KDE 4 desktop was starting to become mature and stable at the time, so I've decided to scratch my itch rewriting the old and abandoned KMid  application, adding my favorite features from vanBasco. This was already told on this blog a few times. KMid2 was a total rewrite almost from scratch, with the additional goal to make it multiplatform. Indeed, it was possible to build and run it on Linux, macOS and Windows, but there wasn't an easy way to deploy KDE programs on macOS and Windows at the time, so the only viable target was Linux. On the other hand, because the chosen architecture, it  was difficult to maintain and port the program to other platforms. Then, several Linux distributions boycotted this application, with the total indifference of the KDE community. Good riddance.

Fast forward to the roaring twenties. Nothing changed for Linux. The vanBasco player is still the king in the Windows world. In spite of most Windows 10 users running a 64 bit Operating System, vanBasco is rotting its 32 bits. The only alternative fulfilling the four mentioned features is Falcosoft MIDI player. I don't know about native macOS alternatives, either. Of course there are players for macOS, and WinAmp for Windows, and even VLC plays MIDI files, but that is not what I'm talking about...

I prefer to avoid hard use cases. Someone asked me once about my VMPK program: how it would be classified? Is it a Game? No, it is not a game, it is a toy! A game has a set of rules that the player must follow to reach the final goal: to win the game. On the other hand, a toy has no written rules. The player can explore, learn, and have fun on its own. No winners, no losers. Sometimes a good game may be repurposed by the users, like Wolfenstein 3D, but it is uncommon. It is in the definition of free software: the freedom to run the program as you wish, for any purpose.

Anyway, here is an usage example for this program: there is a choir, with a conductor or composer that arranges or edits pieces using some MIDI software like Rosegarden, MuseScore, Frescobaldi, or similar. He prints the scores (or exports PDF files for electronic distribution) for the singers. He also exports the pieces as MIDI files, that can be loaded by dmidiplayer, and used by the singers to learn and practice the lyrics and music of each voice. The examples in dmidiplayer include some choral music, edited in Rosegarden and directly exported as MIDI files.

You can download this program for free, either as sources that you may study, modify and build, or an AppImage for any Linux distro, or as ready to install packages for Windows, and macOS, from Sourceforge and GitHub.

There is also a Flatpak available at Flathub. And thanks to deb-multimedia, there are also deb packages for Debian and Ubuntu users.

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.