Programming languages used for music

(timthompson.com)

161 points | by ofalkaed 1 day ago

29 comments

  • jim_lawless 0 minutes ago
    I saw a post about the SKOAR language here on HN in late 2015:

    https://news.ycombinator.com/item?id=10180423

    In the comments, I saw reference to MML ( Music Macro Language ... not exactly what I think the MML is on the list. ) Here's the one referenced in the HN post.

    https://en.wikipedia.org/wiki/Music_Macro_Language

    At the time, I built a small interpreter that included MML as an embedded language, but I don't think I have the (Windows) binaries handy.

  • listenfaster 26 minutes ago
    Very creative guy operating this site (look at this! https://timthompson.com/spacepalette/) though it looks like it’s been idle the past 4 years or so? The live-coding community around tidal cycles will point you to a the fruit of missing projects like tidal-cycles and strudel. A strong inviting community: https://club.tidalcycles.org/
  • sandebert 5 hours ago
    Switch Angel live-code using Strudel. Really impressive and interesting stuff.

    https://youtu.be/aPsq5nqvhxg

    • AlexB138 3 minutes ago
      This is pretty incredible to watch. I initially thought she must be pulling some kind of trick to make that look so fluid, but the fact that she is making very small typos and correcting them as she goes make it look very believable. This is really the first time I've watched someone use one of these tools and it feel like a musician using a new kind of instrument.
      • sandebert 2 minutes ago
        Yeah, she's got several videos, and shorts, where she does this. It's clear she really, really understands how to do what she wants to achieve!
    • george_____t 59 minutes ago
      Just to add some context, Strudel is TidalCycles ported from Haskell to JS. IMO, Haskell is a much nicer language for this stuff. Hopefully, now that GHC can output WebAssembly, someone can build a web-based music programming environment around the original TidalCycles instead.
    • lagniappe 45 minutes ago
      The person in that video really has an ear for synthesis. I've spent quite some time watching all the strudel videos and this creator consistently shows the best skill across genres.
    • ar_lan 29 minutes ago
      This was epic, and reminded me of the magic of programming when I first found a video game maker at a wee 11 years old.

      Writing code to make music feels so natural to me (a musically inept, but proficient coder) and this breaks down so many barriers.

      I wonder how Cursor fares with Strudel so far.

    • NeutralForest 2 hours ago
      I've watched a couple of her stuff, it's really inspiring and feels very cosy, like a slice of Internet that lives on its own and creates without being too bothered about the Algorithm™.
    • AStrangeMorrow 1 hour ago
      Yeah love her stuff. And honestly the voice description is part of the music flow at this point.

      I feel like that’s kinda how people imagined navigating whatever cyber domain when the first big cyberpunk novels came out

  • dmd 10 minutes ago
    And at least 5 times a year someone designs a new one where it is painfully obvious that they're almost entirely unaware that anyone has ever designed one before - or if you're very lucky, maybe they've heard of ABC.
  • Blackthorn 2 hours ago
    In order, the most popular ones of these are probably

    * Max. It's built into a popular DAW, and is shockingly capable as an actual programming language too. The entire editor for the Haken line of products is written in Max.

    * Pure Data or Supercollider.

    * Csound.

    Not ordering things like Scala or LilyPond that are much more domain-specific.

  • incanus77 28 minutes ago
    Surprised no mention of Alda. I’ve only tinkered with it, but it’s clever:

    https://alda.io/

  • turboladen 23 minutes ago
    It’s quite new, but I’ve been interested to try out this Rust-y syntax language that compiles to SuperCollider: https://vibelang.org/
  • benrutter 7 hours ago
    Looks interesting, but I think it's a little dated- sadly most of the links I tried on this page don't seem to be active anymore?

    Here's a currently active list on github in case somebody's left needing a fix of music programming: https://github.com/zoejane/awesome-music-programming

    • ofalkaed 7 hours ago
      Most of the languages on the list have not been maintained in decades with many being for functionally extinct if not completely extinct systems. It is not really a list meant to guide you to a language to use, it is more about historical/academic interest.
  • azath92 6 hours ago
    Almost an esolang, but orca is an amazing example of spatial programming for music production (GH https://github.com/hundredrabbits/Orca and video https://www.youtube.com/watch?v=gSFrBFBd7vY to see it in action)
    • lovich 4 hours ago
      Is this the one from the hippie(non perjorative) group living off a boat?

      If it’s the same, it’s one that if I win the lottery I’d spend my time learning along with this tool from Imogen https://mimugloves.com/

      I don’t think I’d ever produce something worth listening to, but if I won the lottery, why would I care beyond my own enjoyment?

      • listenfaster 33 minutes ago
        ‘Your own enjoyment’ is a rich reward. My unsolicited advice: Try making a mess with it everyday for a week / month / year and see if you don’t start to appreciate something in what you make. Orca is a brilliant piece of work.
      • NeutralForest 2 hours ago
  • zX41ZdbW 4 hours ago
    • yowlingcat 1 hour ago
      Very cool! Found this note interesting:

      ```

      Limitations

      I haven't, yet, found a good way to implement filters (low-pass, high-pass, band-pass, etc.). It does not have Fourier transform, and we cannot operate on the frequency domain. However, the moving average can suffice as a simple filter.

      ```

      I wonder if there's a way to implement the FFT using subqueries and OVER/partitioning? That would create a lot of room for some interesting stuff to happen, specifically making it easy/possible to implement filters, compression, reverberation, and other kinds of effects.

      Two other primitives that would be valuable to figure out: 1. How to implement FM/phase distortion. You can basically implement a whole universe of physical modeling if you get basic 6 op sine wave primitives right with FM + envelopes. 2. Sampling/resampling - given clickhouse should do quite well with storing raw sample data, being able to sample/resample opens up a whole world of wavetable synthesis algorithms, as well as vocal editing, etc.

      Honestly, although the repo's approach is basic, I think the overall approach is wonderful and have wanted to be able to use SQL to write music for a while. I've spent a lot of time writing music in trackers, and being able to use SQL feels like it would be one of the few things that could spiritually be a successor to it. I've looked at other live coding languages, many of which are well built and have been used by talented people to make good music (such as Tidal, Strudel, etc). But all of it seems like a step down in language from SQL. I'd rather have their capabilities accessible from SQL than have to use another language and its limitations just to get those capabilities.

      Food for thought -- thanks for the interesting and thoughtful work!

  • fnordlord 2 hours ago
    I really hope that Max becomes fully accessible in a text based format one day. It's so cool and I've spent a few months randomly through the years building neat plugins for Ableton but, for me, it would be so much stickier if it was code. Especially now with AI assistance, Claude can still be helpful but it hallucinates a lot harder when trying to describe visual code.
    • scragz 1 hour ago
      you can get the LLM to output max patches in JSON and copy paste directly into max. it was pretty decent at it when I tried and would probably be even better with relevant recent documentation in context.
  • chaosprint 5 hours ago
    Relevant to this discussion - my project Glicol (https://glicol.org) addresses this space. Currently working on a no_std rewrite, demo coming next year :)
  • heuermh 1 hour ago
    I have been using ChucK for a long time. Like others here, I appreciate Max/Pure Sound but would rather use my text editor.

      Delay delay;
      LPF filter;
      Reverb reverb;
      Gain feedback;
      
      adc => delay => filter => reverb => dac;
      filter => feedback => delay;
    • afandian 1 hour ago
      I'm curious what you did with it? I spent a little time with ChucK with the Oxford Laptop Orchestra (as was) which was an offshoot from the Princeton one. I was there as a technologist, not a musician. Always had a soft spot but never found myself using it again.
      • heuermh 1 hour ago
        I mostly use it for learning things. How does this guitar pedal effect work? Why does this Eurorack module sound so good? How can I drive this MIDI instrument from this OSC controller? etc.

        Ideally there would be an easy path from ChucK to implementing all of these things in hardware but I haven't quite got there yet.

        https://github.com/heuermh/lick

        • afandian 1 hour ago
          Wow that's a serious amount of work! I might take another look.
  • erk__ 4 hours ago
    There was a music language made for the Danish GIER machine, made in 1971 (at least the 2nd edition of the handbook is from there)

    The handbook for the language is sadly only in Danish so it might not be super interesting: https://datamuseum.dk/bits/30002486

    Here is the code for movement 1 and 2 of Eine Kleine Nachtmusik: https://datamuseum.dk/aa/gier/30000644.html

  • asupkay 1 hour ago
    There's a community in NYC called Livecode that hosts in person events for programming music and it's awesome
    • yogurtboy 1 hour ago
      This sounds sick! I wonder if there's something similar in Seattle.
  • bebb 4 hours ago
    There was one on HN a few weeks ago, tailored towards loops: https://news.ycombinator.com/item?id=46072280

    One interesting feature is it has built-in vibe coding, to produce an LLM-generated loop program to start one's creative journey.

  • 3ds 5 hours ago
    It's missing "Strudel" and "tidal cycles"
  • ako 6 hours ago
    Yesterday i used Claude Code to define and implement a YAML based DSL for playing backing tracks. I can ask an LLM to generate this DSL for any well known song, and it will include chord progression, lyrics, bass, drums, strumming pattern, etc. It's a go command line tool that plays the DSL via midi, and displays the chords, strumming patterns, and lyrics. Also does export to Strudel.
    • isodev 4 hours ago
      Depending on the source music, there are many aspects of this that normally require a license with a records company or some proxy. Especially the lyrics part. Be careful not to get into very expensive trouble. Just because the LLM can do it, doesn’t mean it’s ok to do it.
      • ako 4 hours ago
        Yes, I noticed that Claude Code silently refused to generate lyrics for some songs i requested. Benefit of this approach is that anybody can quickly generate a YAML file for a backing track, no need to share it anywhere.
        • isodev 3 hours ago
          I think the problem is that the artist doesn't get anything with this approach. If you really want to use someone else's music/artworks/lyrics, just buy it.
          • ako 2 hours ago
            It's not like this is very unique, YouTube has tons of training and backing track videos, which is what i typically use. And artist don't sell it in a way that can be consumed for guitar practice easily.
          • rerdavies 3 hours ago
            Most artists don't sell backing tracks though.
    • shevy-java 5 hours ago
      The problem I see is: people are not going to use a project that is AI generated for long really, unless they do it just for a one-off task. I'd like to constantly generate new music. I also have ideas based on existing music so I want to adjust this, but do so programmatically, and that seems ... hard.
      • ako 1 hour ago
        Sure, for something big code needs more review and validation. But this is just a small command line tool that allows you to ask an LLM to generate a DSL to play a backing track: https://raw.githubusercontent.com/ako/backing-tracks/refs/he...

        Not a big commitment from a user, and nothing lost if it doesn´t work as hoped.

        I'm just positively surprised how quickly you can create a prototype for these sorts of ideas with Claude Code. This is literally just a few hours of vibe-coding.

  • philprx 7 hours ago
    Strudel.cc ?
  • opminion 7 hours ago
    No Sonic Pi, which is a Ruby dialect?
    • 1313ed01 2 hours ago
      Sonic Pi is SuperCollider, but using Ruby instead of the default sclang language. Overtone is similar (and possibly originally by the same developer, iirc?) but using Clojure, and is also missing from the list.
      • iLemming 5 minutes ago
        Yeah, that's some glaring omissions - not including Sam Aaron's work makes me distrust the whole list. SonicPi is fundamental for teaching kids music and programming and Overtone is just mind-blowing - I watched people DJing music while evaling things in Emacs, that looked sick.
  • shevy-java 5 hours ago
    I kind of want to create music programmatically but so far it has been way too difficult. I also can barely find anything useful via oldschool google search anymore. I am almost stuck like with MIDI here ...
    • nablaone 1 hour ago
      Claude code is good at coding and music theory. IMHO, there is not need for a dedicated language.

      BTW. I've played with LLM in sound design tasks recently. Vibe coded MCP server for Waldorf Blofeld gave me good results. Sorry, no demo.

    • virgil_disgr4ce 3 hours ago
      ever tried Pd or max?
      • rerdavies 3 hours ago
        SuperCollider also has some traction, and is in the same genre as max and pd.
  • jackkinsella 8 hours ago
    Musicabc has some really nice JS and Obsidian plugins that essentially allow you to create little scrapbooks of musical ideas in markdown that are also playable as sound and viewable as sheet music.

    https://abc.hieuthi.com/

  • rausr 7 hours ago
    I recently tripped over Dogalog (live-coding with prolog-like code), which could be an addition: https://danja.github.io/dogalog/
  • gdelfino01 4 hours ago
    There is some sound and music functionality in the Wolfram Language:

    http://reference.wolfram.com/language/guide/SoundAndSonifica...

  • lynx97 6 hours ago
    Csound (I think v3) was the first music language I played with, back in the early 90s, under DOS even. Back then, running in real-time wasn't a thing. Generate a WAV file and play it after the program finished. Later, at the end of the 90s, I remember playing with CLM/CM, in common lisp.

    But the most productive experience was definitely SuperCollider. I can only recommend giving it a try. Its real-time sound synthesis architecture is great. Basically works sending timestamped OSC messages AOT (usually 0.2s). It also has a very interesting way of building up so-called SynthDefs from code into a DAG. I always wondered if a modern rewrite of the same architecture using JIT/AOT technology would be useful. But I digress... SC3 is a great platform to play with sound synthesis... Give it a try if you find the time.

    • whilenot-dev 5 hours ago
      I can vouch for the tutorial series from Eli Fieldsteel[0] for getting into SuperCollider and audio synthesis in general. If you were ever curious on how to bridge the gap between signal processing and music theory through mathematical operations, I think this is one of the best series out there.

      [0]: https://www.youtube.com/watch?v=yRzsOOiJ_p4&list=PLPYzvS8A_r...

  • yakshaving_jgt 2 hours ago
    Haskell is also a popular choice for music production and live music performance.

    https://youtu.be/XYe8AKYPUYc?si=ZYP4QM5FLn00-5u6

  • hellobluelings 6 hours ago
    There is also literate programming for music, right? Just like Donald Knuth describes it in his literate programming approach? See for example the videos by Fauci etc. They say things like eh eh, pause then play music using items such as a pen, there is even a conductor. Very entertaining. Is that true? Or just my imagination?
  • jarmitage 6 hours ago
  • oliverpaddock 3 hours ago
    [dead]