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.

Thursday, July 30, 2020

VMPK: MIDI by Network

This is only a quick and dirty article to link to the MIDI by Network page in the VMPK Wiki. It explains the basic concepts about ipMIDI and how to use it with VMPK.

The Wiki has also pages about the VMPK developing environment using Qt Creator and CMake.

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