2019 Mar 09

Cambiare - A Lightweight Music Conversion Framework

I was messing around with QMK (popular firmware used with mechanical keyboards) a few days ago and was adding custom songs to my Preonic keyboard, and it was taking forever. So I wrote a small utility to convert MusicXML files to a string output format that could easily be added to a QMK song list.

Here's an example input:

Here's an example output:

I later decided to use this utility as the basis of a small framework to convert single staff music inputs into custom outputs, so I could use it for other output types later.

Inputs are modules that implement the MusicImporter abstract class, and outputs must implement the MusicWriter abstract class. The process of adding a new input module mainly consists of converting notes in the input type to a CNote, and adding a new output module mainly consists of converting a CNote into the output format.

The next type of output format I'm planning to implement is for Ocarina tabs, specifically for 12 hole ocarina's with a range of A4-F6.

Github: Link