SamuKata
frooxius
frooxius

patreon


MusicString - minimalist music "programming" language (FrooxArchive #8)

Hello again and welcome to another FrooxArchive entry!

The last two entries probably showed you that I enjoy toying around with programming languages and compilers a bit and today’s project of mine is no different from that. It’s a simple music “programming” language called “MusicString”, made around 2011-2012.

Source code: https://github.com/Frooxius/MusicString 

The basic idea behind this one was to make a simple language, which lets you create music and other sounds, in as few symbols as possible. The goal was to make them easily shareable on stuff like Twitter, comments and other social media. Looking back, I think I just wanted an excuse to toy with audio synthesis.

While the language is quite simple, it has some cool features to it. It supports chords (technically unlimited, so you can go crazy), loops and “subroutines”, so if there’s any repeated part of the sound, you only need to define them once.

The project comes with a command-line “compiler”, which takes in a MusicString source file and spits out a WAV file for you to play with (which I found really satisfying for some reason). Perhaps more interestingly though, it comes with a “visual IDE”, that makes it much easier to experiment with the language.

This IDE has visual feedback, showing you what notes are currently being played in realtime. It also has a number of references, showing letters and symbols corresponding to which notes, durations, volumes and instruments.

I had a number of plans to expand this project and the language, adding sound font support (the default version only supports procedural instruments - sine, triangle, sawtooth, square and noise), conditional execution, vibrato and a number of other things, but I ended up moving to other projects instead.

A number of my friends and I ended up having some fun with this project and a few people composed some tunes with MusicString (you can tell which ones by listening to which ones sound like actual music) and the project was a good opportunity to learn some more music theory and procedural audio generation.

The visual editor should be pretty usable and as part of the Patreon release I’m publishing the original source code as well, so if you’d like to poke around with it and experiment, feel free! If you end up making any cool tunes or sounds, I’d love to hear them too - and sharing them should be as simple as posting your music string in the comments!

The package includes pre-compiled versions of the visual editor and command line compiler for Windows, Linux and Mac, as well as a number of sample music strings to get you started with.

Looking through the old project files, I noticed that I actually made a DLL for GameMaker for this project as well as Visual Basic.NET version/example, which I completely forgot about. They don’t seem to have as many practical use-cases, but from what I vaguely remember, I did those just to go through the process of making them, since both were new to me at the time.

I used GameMaker for years making my early games and encountered third party DLL’s to extend its functionality, but how those were made was a black magic at the time, which I thought I’d never learn. Once I learned more about C, C++ and building other projects in it (like this one), I decided to use it to make the DLL.

Moments like that were always interesting and very satisfying to me, because something that seemed so difficult and mysterious to me at the time, was suddenly understandable. It was moments like this that made me realize that to learn really complicated things, all you need is time, patience and persistence - giving up is the worst possible thing you could do in a process of personal growth.

And last, but not least, thank you everyone for supporting me this far! I hope these old projects are interesting “filler”, while I have some new stuff cooking in the background. I can’t talk about it yet, but hopefully I will be able to soon. In the meanwhile, I’ve got tons more old stuff to share with you!

MusicString - minimalist music "programming" language (FrooxArchive #8)

More Creators