12 ms·
Alda – Text-Based Programming Language for Music Composition
- kennywinker 5y agoThis looks useful and fun, but without programmatic ways of specifying notes (i.e. ‘$v1 = $v2 + 12’) it’s not much of a “programming language” and mostly just a “text based notation system”.
- wizzwizz4 5y agoIt does have that? https://github.com/alda-lang/alda/blob/master/doc/variables.md https://github.com/alda-lang/alda/blob/master/doc/variables....
- joshuaissac 5y agoThat seems to be for repeating things, but kennywinker is asking about shifting a note's pitch.
- Willamin 5y agoLooks like a previous version was mostly a Clojure DSL, but the latest major version no longer is. There are variables and other useful features we know from other programming languages that aren't mentioned on the landing page. 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-migration-guide.md#attribute-syntax-has-changed-in-some-cases https://github.com/alda-lang/alda/blob/master/doc/alda-2-mig...
- Jorengarenar 5y ago>For instance, I consider CSS to be a programming language Out of curiosity, on what basis do consider CSS to be a programming language? And does it applies to versions prior to CSS3 too?
- SamBam 5y agoThis is what I've wondered about -- with this and with the other few "music programming languages" on HN in the past year. 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?
- kennywinker 5y agoIt sounds like there’s a layer built on top of this to write clojure that interacts with alda, and you definitely could with that. There are also a bunch of other options. Orca (a visual sound programming language) and sonic pi would be where i would start for two very different approaches to the concept.
- hdjjhhvvhga 5y agoFor anyone curious what it actually sounds like when played by a musician, see https://youtu.be/7nbBSwopG-E?t=969 https://youtu.be/7nbBSwopG-E?t=969 and https://youtu.be/7nbBSwopG-E?t=1033 https://youtu.be/7nbBSwopG-E?t=1033
- rglover 5y agoFun to watch, thanks for sharing.
- smoldesu 5y agoI actually quite like this. Current text notation in trackers is pretty painful to manipulate, and I've often found myself wanting for a plaintext language to use instead, specifically for writing niche or otherwise difficult portions programatically. The syntax in this language seems to be exactly what I'm looking for!
- schot 5y agoHow does this compare to LilyPond? I'm surprised it isn't mentioned at all, since from a first glance the notation looks very similar. [0]: http://lilypond.org/ http://lilypond.org/
- ARandomerDude 5y agoI don't see support for adding lyrics in Alda unless I'm missing it.
- tartoran 5y ago"LilyPond is a music engraving program", great for writing sheet music. This seems to be a music composition tool, eg you can use the repl to tweak your performance
- rekado 5y agoI actually used LilyPond for composition. It's a little less convenient because MIDI output is rather limited. But it gets the job done: https://guix.gnu.org/en/blog/2020/music-production-on-guix-system/ https://guix.gnu.org/en/blog/2020/music-production-on-guix-s...
- nemetroid 5y agoI didn't see anything in the tutorial that LilyPond doesn't also do (and in a similar way).
- hippari 5y agoSee https://www.youtube.com/watch?v=2L7edwef-5k https://www.youtube.com/watch?v=2L7edwef-5k Scheme seems like a much more powerful language for music composition, with the ability to deal with fractions and making your own tuning system.
- thebricksta 5y agoSorry to be a downer here, but can someone explain to me what the appeal of these projects are? In the past year or so I've seen a number of text-based music notation projects hit the front page of Hacker News and don't really understand the purpose they are trying to achieve. 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?
- Kluny 5y agoFor me, I think this is one of the coolest projects I've seen in a long time, and definitely the first musical programming language I've ever seen. I was a musician in high school and haven't picked up an instrument for a long time, but I still remember how sheet music works. As a drummer, I was never much good at reading notation or playing other instruments, so this would be a really accessible way for me to write music and see what it sounds like, as well as debugging it the way I would with code.
- eurasiantiger 5y agoHow about just using C? https://youtube.com/watch?v=tCRPUv8V22o https://youtube.com/watch?v=tCRPUv8V22o Maybe /s, maybe not…
- jeofken 5y agoThere is also the popular ABC music notation language, but it seems to be less comprehensive than OP
- jononor 5y agoAlda looks pretty neat. Manipulating it with a rewriting system (ala Lindenmayer) or a generative text model (hello GPT3) could be fun!
- nielsbot 5y agoI used to use GWBASIC to make music on the PC. I immediately thought the same thing.
- bodge5000 5y agoI'm yet to look deeply into Alda, is anyone aware of what it provides in the way of sound design (if anything at all)?
- Igelau 5y agoIt looks like the answer is "no", with the addendum that waveform synthesis has been on the TODO list for a while: https://github.com/alda-lang/alda/blob/master/doc/list-of-instruments.md https://github.com/alda-lang/alda/blob/master/doc/list-of-in...
- bodge5000 5y agoThat's a bit of a shame, the search continues then Cheers for finding out for me regardless
- incanus77 5y agoThis is neat. It’s basically a REPL for 80s BASIC-style Music Markup Language (MML), almost identical syntactically.
- montag 5y agoIndeed, MML is mentioned here: https://blog.djy.io/alda-a-manifesto-and-gentle-introduction/ https://blog.djy.io/alda-a-manifesto-and-gentle-introduction... This is another interactive MML project worth checking out: https://github.com/superctr/mmlgui https://github.com/superctr/mmlgui edit: unfortunately, we need to clarify...we're talking about Music Macro Language
- lioeters 5y agoThanks for this reference, it led me down a curious tangent. 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 https://steyn.pro/mml/examples/chopin.html For more links: https://en.wikipedia.org/wiki/Music_Markup_Language https://en.wikipedia.org/wiki/Music_Markup_Language
- montag 5y agoOh...no...this MML is XML-based markup (read: not practical for use by humans), not the same as Music Macro Language.
- lioeters 5y agoHahah, I see, thank you for the correction. https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MM...
- Mizza 5y agoI ended up creating a lighter version of this for one my projects, https://github.com/Miserlou/chords2midi https://github.com/Miserlou/chords2midi 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. https://bspaans.github.io/python-mingus/ https://bspaans.github.io/python-mingus/
- PaulDavisThe1st 5y agoWithout commenting on Alda specifically, people should understand that it's just one member of this list of highly overlapping (but also interestingly distinct) tools: https://github.com/toplap/awesome-livecoding https://github.com/toplap/awesome-livecoding "All things live coding : A curated list of live coding languages and tools"
- qrv3w 5y agoI love these text-based languages for music composition. Its something that is approaching a gap in music composition in real-life vs via computer. In real-life you can tell your bandmates to "just play a I V IV in C" and they get it. But we are still not quite at a place where we can tell a computer that exact phrase and get something useful. I love how close these text-based languages are getting though! 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 https://github.com/schollz/miti - [2] https://github.com/flipcoder/textbeat https://github.com/flipcoder/textbeat - [3] https://foxdot.org/ https://foxdot.org/ - [4] https://sonic-pi.net/ https://sonic-pi.net/ - [5] https://chuck.cs.princeton.edu/ https://chuck.cs.princeton.edu/ - [6] https://github.com/emicklei/melrose https://github.com/emicklei/melrose
- dexterhaslem 5y agowhat about trackers?
- kleer001 5y agoWhat are you asking? They're a different beast.
- bodge5000 5y agoTrackers are a very different beast, however for my sake I've found them a good intermediary whilst your looking for the live coding language that suits you. 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.
- yardshop 5y agoI think you must mean AKWF, Adventure Kid Wave Forms: https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/ 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!
- henearkr 5y agoI have written a small wrapper in bash for lilypond, just to get the same result, a command-line REPL, that compiles and plays instantly. But in lilypond instead of Alda.
- snambi 5y agoDoes it support karnatic music notations "Sa, Ri, Ga, Ma, Pa, Da, Ni"? Usually written as S,R,G,M,P,D. Makes it easy for Karnatic/Tamil musicians.
- Labo333 5y agoThis is music notation, not composition!
- Igelau 5y agoThis is the car, not the driving.
- deleted 5y ago[deleted]
- tenaciousDaniel 5y agoLove these little DSL experiments. The more the merrier
- flenserboy 5y agoI like it. Some eventual way to translate it to XeLaTeX or the like would also be nice.
- xrd 5y agoI'm glad to see more of these things. It's like a different take on Orca (https://github.com/hundredrabbits/Orca/ https://github.com/hundredrabbits/Orca/) or SonicPi (https://sonic-pi.net/ https://sonic-pi.net/). 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.
- diskzero 5y agoThis is a great insight. I have spent a lot of time creating a composition tool, but the assumption is that the user has some knowledge of composition. This is useful to a very small number of people. What is more useful is what you describe; an interactive bridge between the worlds of music notation, composition and algorithmic assistance. I would love to brainstorm some more if you have time. Drop me a note if you do!
- jeofken 5y agoVery cool! I’ve been an ABC user for years, but always missed being able to make full scores with multiple instruments or a whole orchestra. This is what I’ve been looking for
- empressplay 5y agoProgramming Language = repeat 4 [repeat 4 [playnotes (word "L repabove 1 "A repcount "B repcount "C repcount + 1 "R repabove 1)]]
- hikerclimber1 5y agoHopefully inflation in us reaches a billion percent
- sadsatan 5y agoabsoLUTELy
- sadsatan 5y agoabsoLUtEly this immediately screams HEY FUCK WITH ME PLEASE FOR HOURS ON END SO YOU DONT GET ANYTHING DONE
- iamcreasy 5y agoDoes anyone know any good resource on learning music theory using tools like this?
- vldmrs 5y agoI was surprised not to find any demo of the Alda generated music on their website.
- rawling 5y ago> An interesting thing to note here is the >. This is Alda syntax for “go up to the next octave.” 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"?
- rawling 5y agoMaybe because you physically move >that way> on a piano keyboard?
- quaintdev 5y agoAmazing. I wish they included mini player alongside each snippet. Another thing they could do is build a playground kinda thing like Go. Not sure if that's possible in this case.
- warmfuzzykitten 5y agoMacOS won't let me run alda by default, and I'm not sure they're wrong. There is an open source alda project, but these are binaries downloaded from alda.io. Who vouches for them?
- kebman 5y agoI have a feeling that learning a text-based tool like this, will give you greater control and flexibility over your work than NoteScore or Sibelius. Anyone tried both?