Showing posts with label KMidimon. Show all posts
Showing posts with label KMidimon. Show all posts

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, 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/

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.

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 :-)
 

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, December 4, 2009

Tempus Fugit

Time is the dimension of music, likewise width and height are the dimensions of pictures. When transmitting MIDI data on a wire, events don't need to be marked with time labels, because the time simply flows. MIDI is a real-time protocol. When the events are stored on data structures, like SMF (MIDI files), the events must be timestamped. In SMF, each event has a delta-time, the elapsed time since the previous event, measured in ticks. The time formats on SMF closely resembles the conventions used by the written music tradition, the musical score.


Let's start with the metronome. A metronome is a device that signals musical tempo. It is used by musicians to keep the rhythm and speed while practicing. Metronome units are beats per time unit, for instance crotchets per minute. MM=60 means 60 crotchets in one minute, or one crotchet equal to one second. The crotchet, also known as quarter note, is the double in length of a half, and the half is the double of a whole. Conversely, the half of a crotchet is an eighth, and this is the double of a sixteenth. These figures are the time lengths of the musical notes, and they are relative measures. Music is written in terms of relative times.

In SMF, the time is measured in ticks. The division value, which is declared into the file header, is the number of ticks in a quarter note. Common division values are 96, 120, 240, 384, 960. The numbers are usually divisible by 3 and 4, and big enough to avoid decimal numbers when measuring the length of very short notes.

Tempo changes are SMF meta-events. They may happen at any point in the time line and are represented in microseconds per quarter note. This magnitude is inverted with regarding to the usual metronome units (quarters per minute), because it can be represented by integer instead of decimal numbers. for instance, mm=60 would be represented as SMF tempo=10000000, and mm=120 as tempo=500000.

As note start and length properties are represented by relative magnitudes instead of absolute times, and tempo changes are flexible enough to be placed at arbitrary points, it is easy to modify them without collateral effects. If you insert a tempo change in a SMF using a MIDI editor software, you don't need to change the length or the starting time of the following or previous notes. Of course, when the SMF is finally rendered to be listened, the sequencer engine needs to do all the time calculations. But not so fast, wait a minute!

When you play MIDI files, it is a common requirement to perform slower or faster than the nominal tempo changes encoded into the file. It is like zooming in picture viewers. For instance, a student may need to render a piece half or slightly slower than it normally plays, or a dancer may need it a bit faster. The ALSA sequencer engine provides a very handy mechanism for programs to do this: the time skew property. You can enjoy this vary-speed functionality in KMid2 and KMidimon, when it is used to play MIDI files.