A Minuet for KDE

Planet KDE Nov 6, 2015

Update: Minuet has been moved to KDE Edu playground. You can clone it from git://anongit.kde.org/minuet.

A Minuet is a musical form (occasionally with an accompanying social dance for two people) originated in the 17th-century France, initially introduced to opera but later also to suites such some of those from Johann Sebastian Bach. Although composing a minuet for KDE wouldn't be bad at all :), my musical skills don't make me feel like doing so by no means and, therefore, this post is gonna be about - you know - software and KDE! But software for music :)

Three years ago, I tried to push one of my students into developing a KDE software for music education. It was named Spinet, had even some nice features for MIDI manipulation and we managed to build it in both Linux and Windows. We couldn't move it forward though, the student lost energy and I was in the darkest times of my PhD research. But ... now I'm an idle professor :) looking for some fun and trying to put two awesome things together: computers and music. Exactly fifteen days ago I started the development of Minuet - a software for music education built upon the amazing technology provided by Qt and KDE.

What's Minuet about?

First of all, Minuet isn't a music/media player or a music organizer. It's intended to help music teachers and students in their journey towards the grasp of many theoretical and practical aspects of music teaching/learning by integrating technology, content, and teaching methods. It's something along the lines of GNU Solfege (nice content but nasty UX), Online Ear Training (nice method but limited extensibility), Transcribe! (nice features for transcribing music), and EarMaster (the widely adopted proprietary :( solution for music education).

So, it works :) That's what it looks like so far:

How does it work?

Minuet capabilities highly depend on the use of MIDI. With that, we are able of fully control played notes, their pitch, volume, and tempo, setting the underlying infrastructure required to define exercises, classes, and other educational instruments. Supporting cross-platform MIDI functionalities isn't that easy and Minuet relies on the Drumstick library for such a challenge work. Drumstick is a Qt5-based wrapper facade with backends for both libasound (ALSA library for writing MIDI clients) and Windows' mmsystem.

One of major drivers in Minuet architecture design is the definition of a highly extensible core in order to support the seamlessly integration of new content from music teachers. Currently, music exercises are completely defined in JSON files, which are loaded during Minuet start up and passed to a bunch of dynamic QML magic code for rendering the exercises menu and the main exercise screen. It's simply amazing to see how QML really makes things much easier and integrates well with using JSONObjects as models.

This is an example of defining a Minuet ear training exercise for intervals and scales in JSON:

{"exercises":[{
    "name":"Intervals",
    "children":[{
        "name":"Ascending Melodic Intervals",
        "root":"21..104",
        "children":[{
            "name":"Seconds", "options":[{
                "name":"Minor Second", "sequenceFromRoot":"1"
            },{
                "name":"Major Second", "sequenceFromRoot":"2"
            }]
        },{
            "name":"Thirds", "options":[{
                "name":"Minor Third", "sequenceFromRoot":"3"
            },{
                "name":"Major Third", "sequenceFromRoot":"4"
            }]
        },{
            "name":"Tritone and Sevenths", "options":[{
                "name":"Tritone", "sequenceFromRoot":"6"
            },{
                "name":"Minor Seventh", "sequenceFromRoot":"10"
            },{
                "name":"Major Seventh", "sequenceFromRoot":"11"
            }]
        }
        ]
    }]}
    ]
}

This JSON file define three exercises: "Seconds", "Thirds" and "Tritone and Sevenths", which evaluate the student perception regarding four types of music intervals. These exercises will be presented in the menu along the path "Intervals" -> "Ascending Melodic Intervals". Each exercise consists in playing a randomly chosen interval (for the types selected) and asking the student to identify that interval among a number of options presented. The root parameter identifies the pitch range from which the interval's root note will be selected. The options array defines the possible answers for the exercise, along with the delta (from the root) which characterizes the interval. For instance, a 2nd minor interval is located 1 half tone above the root note, while a tritone interval is located 6 half tones above the root note. Minuet's core takes care of randomly picking up a possible answer, playing that to the user, and checking if he/she chose the right answer.

Such a JSON file allows for extending the tool with new exercises without changing a single line of code in the Minuet's core. Furthermore, we can define new exercises at a crazy very fast speed. This is how an exercise with 24 possible answers is rendered in Minuet. Pretty cool, an? :)

I'm currently using TiMidity++ and Freepats as a MIDI client for playing notes, but you can use virtually any ALSA-compatible MIDI device including your synthesizer or MIDI controller. Here, I was pretty lucky and could answer a major 3rd interval - I'm good with thirds :)

I can't say the same for identifying tritones :)

So, what's next?

Well, Minuet works and you can actually get a lot of fun already :) Just clone it from git://anongit.kde.org/scratch/sandroandrade/minuet.git, install Drumstick, TiMidity++/freepats and build Minuet. Start the TiMidity client with timidity -iA and then enjoy enhancing your music skills :)

A lot of nifty features crop up in my mind regarding the future of Minuet:

  • A class/exercise editor for generating JSON files and easing the teacher's work.
  • Signal processing algorithms for singing (for intervals and solfa) and clap (for rhythm) analysis.
  • Enhanced integration with MIDI hardware.
  • Upload and download of classes/exercises via GHNS.
  • Integration with play-along features for rehearsal support.
  • Addition of new types of content (music analysis, composition, etc).
  • Implementation of new instrument-specific views (for guitar, bass, etc).

Yes, a lot of work ahead. For now, and following the motto of "release early, release often", I'll do the required polishing for having a first release as soon as possible.

Currently, I have the valuable support of three members of Genos - a multidisciplinary research group from the Music School of Federal University of Bahia. They will help me to define the major educational contents to be provided and suitable pedagogical techniques.

So, contributions are quite welcome of course. If you like music and (of course) if you like KDE, please don't hesitate to join me in such an adventure :)

See you,

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.