Alda – Text-Based Programming Language for Music Composition
alda.io
alda.io
I've actually made my own musical language too - called miti [1], which is just one of many others including textbeat [2], foxdot [3], sonic-pi [4], chuck [5], and melrose [6]. Each has their own goals and capabilities.
- [1] https://github.com/schollz/miti
- [2] https://github.com/flipcoder/textbeat
- [3] https://foxdot.org/
- [4] https://sonic-pi.net/
Alda seems greatly inspired by the syntax of LilyPond, and in fact, I actually think the musical rendering is done via LilyPond. I'm surprised the docs don't seem to mention this heritage at all.
You can hear some recordings presumably made with these programs on this release: https://www.discogs.com/Various-Music-From-Mathematics/relea...
Some of it is gimmicky, some still kinda rocks.
The problem I've always had with the language is that it's quite arcane and if you want to do anything weird (like, a tie to nowhere) you're either at the mercy of somebody else having solved the problem first, or failing that, a huge learning curve. It's a lot like latex in that way. That said, if you just need to do simple stuff, the language almost magically gets out of your way.
It has a `lilypond` formula that has worked fine for me. Beware though that it installs some kind of TeX repository sized 7 GB.
Sorry I can't be of more help immediately!
Personally I love seeing this kind of niche (I assume?) commercial software. It's great that people can make a living working on this kind of thing.
Not that theres anything wrong with that, but if $400 is the price for ending my suffering, I'll pay out in a heartbeat ;)
Out of interest, are you aware of any language, framework or environment that includes sound synthesis as well, essentially making it an all-in-one?
I do wonder if I'm asking too much, since Supercollider already exists but I'm not much a fan of using it because of how verbose it is and I'm a little bit upset it uses its own language (so I couldn't import more generic modules), but its worth asking anyway. My current plan is to use a non-livecoding module for an existing language, since the ability to change on the fly isn't important to me
I think SuperCollider is the best out there. It's syntax is weird yeah but you can use OSC to talk to anything else (this could easily be added to miti as well). Really I don't think a really good all-in-one exists there are lots of things that do all, but none do all as well as something that just does one thing.
Of course, supercollider does indeed fit this role, but as I've said I do have problems with it. Currently I'm looking at using a generic language, with some synthesis and composition modules. Suprisingly, game frameworks (e.g. Love2D) are looking promising for this, so that could be good, if a little bit overkill.
We are at this place since at least 3 decades ago. How come you never heard about Band in a box? [0]
> I love how close these text-based languages are getting though!
Comparing to what BIAB can do now after 3 decades of development all these text-based languages are sooooo amateurish and ridiculous. They are not even reinventing the wheel. I'd say they're reinventing the circle.
You can definitely do this exact thing in Band in a Box, simple as typing in the chord progression as a lead sheet.
I use Renoise (not free, but very cheap imo and very powerful), and have a sample pack called AWKW (I think, its something like that) which is just a load of single cycle waveforms, and I use that to build rudimentary subtractive synths.
https://www.adventurekid.se/akrt/waveforms/adventure-kid-wav...
4000+ single-cycle wave files of all sorts of sounds from various synths and instruments and such. Lots of great noises in there!
I've been thinking about going even simpler, and just building all my synths out of Sine, Triangle, Square and Sawtooth, but for now AKWF is working a treat
If I want to transport music notation between software programs, I have MIDI for that, which does a good job of capturing all elements of a performance (keys, timing, velocity, pedals, aftertouch, etc.) These types of notation formats almost always fail to achieve MIDIs precision across all the aspects of a performance.
If I want to compose music, I need a format that makes it easy to visualize and manipulate notes in context of the other notes playing across all instruments. DAW piano rolls do a fantastic job of overlaying note information, and traditional combined scores do the same too. Again, text notation usually falls flat here - for example, if you had a large ensemble, and wanted to know which chord was being played on the 2nd beat of the 5th measure, how easily can do you do that? How do you determine if it's an open spacing or closed spacing? How do you determine the root without walking back through all the octave shifts?
For me, it is very much just a markup for music notation that can be tracked in version control. Just like how one would write markdown and then generate html pages, I write Lilypond to generate scores.
Example workflow- I write a song, and use Ableton to capture it. I’m performing with real instruments, and creating arrangements without writing anything down.
Now I want to perform it with other musicians. I have a few options.
I can notate what I created by hand. I can use a proprietary graphical notation tool, which are expensive and generally have sub-par UX.
Or I can use a text-based system like Lilypond, and generate it. I can create reusable blocks, code snippets, look at a diff when I make changes, print the whole arrangement, print just the scores for individual instruments, adjust arrangements as easy as you adjust prose in a text editor.
And also, not have to think much about the presentation layer. Mature tools in this category like Lilypond output great looking scores.
If the piano roll works for you, chances are these kinds of things won't. For me personally, the piano roll has never worked. Whilst I'm still trying to find my place within live coding, I've found trackers (especially Renoise) to be the best for me for the time being.
Where these projects really excel though is in algorithmic composition and generative music (modular synthesis is also quite well known for this), so rather than telling the computer exactly what to play and when, you define the rules and tweak them to change the results.
Of course they can also be used for a more traditional style of music as well, its simply another form of writing music for computers. Some people (most people) find the piano roll works for them, others prefer trackers and sequencers, others prefer code. Its purely preference at that point
I think for some people, the appeal is immediately obvious, and for others it isn't. If the appeal isn't there for you, that's OK. It just means it's probably not the right tool for you.
One of the things I find most fascinating about music-making is how varied and personal the workflows are, and how deeply those workflows affect the resulting music.
You aren't being a "downer" by not liking the sound of a tuba. It's just not your jam. But it certainly is for others and that's OK too.
It's a very different perspective on computer UI design and one I personally prefer, although I get why it's not for everyone.
Well put. A lot of these feel like the wrong tool for the job, and I have a really hard time understanding why you'd want to track pitch data in a format like this when, as you say, DAWs exist and midi tracks can be moved around between them.
The only time these types of projects make more sense to me is when they present opportunities for discoverability or non-linear sequencing that can result in new or interesting ideas. For example, the Orca Sequencer used in this demo vide](https://www.youtube.com/watch?v=Pe8wE0sx31Q) is an example of a tool that folks use as a synth-agnostic sequencer that takes advantage of a non-linear format to create music that you might not in a DAW/piano roll. Or at the very least, makes you take a wholly different route to get there.
Projects like Alda, however, make less sense to me since they are squarely pointed at linear-workflow music tracking, which is such a saturated space that it's hard to come in with a new format that doesn't just feel like a more painful way to do what a DAW can let you do.
But, then, I also do close to 100% of my 3D-modelling in what looks like code.
For me, the question isn't "why do people like text-based description languages" it is "why do people dislike them".
And I guess the answer is "it doesn't matter, we are all different, and at the end of the day, what works for me may not work for you, and vice versa".
Heck, I even use both vi and emacs.
It's such a busy space, partly because these projects rarely bring anything new to the table. And if they do you end up with something that takes a long time to learn and has almost as much complexity as a real instrument.
So it's rare for either approach to get traction without some kind of championing by academia or industry.
Music notation works at a higher level of abstraction than that, and is intended to be intelligible by humans first and foremost.
there's an entire generation of people who mainly compose through ableton live's piano roll though
I understand now that you likely meant that MIDI does not capture the score itself, so it does not work as a notation file format, whereas these text-notation languages do describe the score.
MIDI is a protocol meant to be able to capture the performance of music, and much of the performance isn't human-intelligible data, so MIDI doesn't work as notation.
However, the case I was making is that MIDI can capture all the data present in a score already and transport between applications. No, you would never read MIDI itself from a file and try to play it on a piano, but I also doubt you could easily read Alda straight from a text file without rendering it either.
MIDI cannot work its way back to the original score itself, but it can capture a perfect performance of the score and allow that performance to be notated in another scoring program. That doesn't quite get you back to the original score however.
So now I suppose I can see some value in trying to develop more score representation formats with more compatibility - it'd be cool to be able to write a proper score then drag-and-drop it like MIDI into a DAW. Yes, that's usually possible through MIDI export, but it'd be neat if that was a first-class feature and we all passed around scores on the web instead of MIDI files.
EDIT: On further thinking, passing scores around wouldn't really be sufficient either, as oftentimes you do want a copy of an exact performance with humanized timings. I suppose you really would need to embrace both formats, or create some sort of hybrid that can capture elements of either/both freely.
Music is really just a non-verbal language. If you become fluent in the language, you can appreciate music in its textual form just like you can appreciate Shakespeare for its literary value.
To my mind, this is why notational representations still persist, even in the age of media recordings. That higher level of abstraction still carries plenty of value and its compactness (over performance) is convenient to creators and academics who wish to reference them with fast read access.
Most composers compose using a piano. Orchestration is something that generally happens later, after the song has already been worked out on one instrument.
Yes, some older composers cut their teeth with pianos, staff-paper and pencils and established workflows based strictly on getting the whole song on paper before the orchestration/arrangement, and still work that way today.
However, I'd argue the vast majority of younger composers and people who write in more electronic-influenced genres definitely do not follow that workflow. It'd be very hard to write an entire pop/rap/dance track that relies heavily on the drum and bass interplay by first writing it all out on piano.
I think the only real argument would be whether most people compose with piano or guitar--and piano outnumbers guitar by a lot last I checked.
Everything else is in the noise.
https://woodandsteel.taylorguitars.com/issue/2021-issue-1/fe...
Most of the time mountaineers use a mountaineering jacket to run errands in town when it's raining.
I'm not sure that measuring "most" has much explanatory power in either case.
However, I once tried a (small) composition project in Lilypond, and it really slowed to a crawl when I started to make major changes to what I'd already written. The ability to "refactor" is just so much easier in a visual editor like Musescore or Sibelius.
Perhaps for more experienced composers, with less of a need for complete redos, tools like these are better at "getting out of your way".
https://youtube.com/watch?v=tCRPUv8V22o
Maybe /s, maybe not…
Text notation is keyboard entry friendly, and version control friendly. Systems that support it will often render it to something that is more convenient for viewing, often as you edit or on save (e.g., there are VSCode extensions that render scores from LilyPond and ABCNotation; for LilyPond, there’s also support for navigating into the source from the rendered score.)
T:The Three Smokestacks
M:4/4
L:1/8
C:Solomon Foster
R:Reel
K:G
EF|G2BG FGAF|GBdg ecAF|G2BG FGAF|GEFD EDEF|
G2BG FGAF|GBdg ecAF|G2BG FGAF|GEFD EDEF||
GBdg e2ef|gefd edBA|GBdg e2ef|gefd e2dB|
GBdg e2ef|gefd edBA|Beed efgf|ecAF GFEF|
The header L: field defines the default length of a note. In the body of the tune, uppercase letters A-G are notes in the octave that starts with middle C, lowercase letters a-g are notes in the octave above that. A number following a note name is a multiplier for the note length. Bar lines are pipes.The drawback to ABC is as you wander away from that original use case, it gets harder and harder to use. Here's snippet of an arrangement of Sleigh Ride I was working on a few years ago:
z +mf+ (+accent+e .^d/) z/ z|(+accent+e .d/) z/ z +p+ .^F/.=G/||[K:G bass octave=-1] +crescendo(+ .A .A .A .A|.A .A .A .A|+f+ +crescendo)+ +accent+ d zz +sfz+ G|
Studying it again, I can mostly figure out what it is trying to do -- z is a rest, things surrounded in +s are extra commands, so +p+ and +f+ are dynamics, +accent+ puts an accent over the next note, etc. It's still pretty easy to understand, but I'd have a hell of a time playing the music from that notation. And I coded up that ABC, if someone else had done it there's a decent chance I'd have to stop and look up some of their notation in the ABC standard.Do you happen to know any good textual notation for polyphonic composition?
https://github.com/toplap/awesome-livecoding
"All things live coding : A curated list of live coding languages and tools"
Of course there are also varying definitions of what a programming language is. For instance, I consider CSS to be a programming language, but I know many people disagree with that position (and that's okay). I personally don't think that a "programming language" must be a general-purpose, turing-complete language. Alda seems to be a non-general purpose, turing-incomplete language. At this point though, we're maybe getting into semantics a bit.
Syntax change: https://github.com/alda-lang/alda/blob/master/doc/alda-2-mig...
Out of curiosity, on what basis do consider CSS to be a programming language? And does it applies to versions prior to CSS3 too?
They almost always seem to be simply "music notation", not music programming. At the end of the day, it's not that different from sheet music, just written slightly differently.
If I wanted to actually program music based on this, could I? Could I write a loop that plays random notes on the pentatonic scale? Or that systematically plays through every scale, without writing out all the notes by hand?
I think that something that Alda looks like it lacks right now is doing things around intervals rather than notes, as transpositions and key changes will be very tedious without embedded knowledge of intervals.
My project is based around a Python library called Mingus, which I think gives you most of what you'd ever need to build a music programming project.
[0]: http://lilypond.org/
https://guix.gnu.org/en/blog/2020/music-production-on-guix-s...
All of these are super fun.
But, it feels like we are missing an amazing EDITOR to go with these LANGUAGES.
For example, when "live coding" music I've not yet seen a great editor that could simulate what options there are for the next measure.
I can do this with two turntables and a mixer. When I used to DJ, I can put a record on the other deck, listen to the beat, mix and match it, adjust the treble/bass, even the tempo and merge it in WITHOUT anyone hearing those experiments. I was always worried about timing it correctly, and when you shift to the other deck, sometimes is was great and sometimes is was terrible, which is what you get out of live music.
I wish there were good editors that would permit me to enter in the chords and notes I want (like all these tools do), and at the same time, give me a window into insights like "adding this next chord progression would take it into a more jazzy realm" or "if you spread these notes over two measures and drop them an octave it will get really interesting." I suppose it is a lot to ask a computer to make those qualitative analyses of the music, but it seems like at least it could gather up some options. Computers are good at pattern matching.
And, I've also yet to see these editors offering a way to collaborate, either in person, or over the internet. With a shared language and networks, we can do this. Timing is the biggest thing, but music has a consistent tempo (so your collaboration might not arrive in this measure, but we could guarantee it enters the composition on the next measure at the exact right time).
I remember a FOSCON with _why (the lucky stiff). He came with a band to FreeGeek in Portland, and did this interactive music thing, where he put up a ruby program that all the attendees to the event could attach to with their own IRB session. And, then people could collaborate on the performance with him. It didn't go well. A veteran Perl programmer said "it was like watching a train wreck" (Perl people were pretty jealous of Ruby at that moment). It didn't go well, indeed, but it was so a fascinating idea to try and I wish there were more examples of this kind of thing. That would be such a great way to teach music.
I would love to brainstorm some more if you have time. Drop me a note if you do!
It might not be the same thing - this one is XML-based, rather than "BASIC-style" - but I found an example of what Music Markup Language looks like, with Chopin's Trois Nocturne:
https://steyn.pro/mml/examples/chopin.html
For more links: https://en.wikipedia.org/wiki/Music_Markup_Language
https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MM...
This is another interactive MML project worth checking out: https://github.com/superctr/mmlgui
edit: unfortunately, we need to clarify...we're talking about Music Macro Language
Cheers for finding out for me regardless
Whyyy?
You are going up an octave. The notes/pitch/frequency are going up. The subsequent c is higher than the preceding b. Why the hell do you notate that "b > c", not "b < c"?
Usually written as S,R,G,M,P,D. Makes it easy for Karnatic/Tamil musicians.