Hacker News new | past | comments | ask | show | jobs | submit login
Opusmodus: Common Lisp Music Composition System (opusmodus.com)
179 points by zetalyrae on Nov 8, 2023 | hide | past | favorite | 68 comments



Also there is Impromptu[0], a live coding Scheme. This is my favorite piece written in it[1]. The guy behind Impromptu created Extempore[2].

[0]: http://impromptu.moso.com.au/index.html

[1]: https://vimeo.com/2579694

[2]: https://extemporelang.github.io/


I've used Extempore and GRACE, the cross-platform GUI for Common Music. I am a Lisper so these tick that box. I always wanted to use Opusmodus, and I think I will now. It has great tutorials and documentation and seems to have matured nicely. It has high-concept functions for composing compared with some of the others that require for you to build those functions. I'm not sure how it will compare with Extempore's live coding abilities.


I've always wondered why Common Lisp has so many algorithmic composition applications. In addition to Opusmodus, Common Music, and Common Lisp Music, which were mentioned elsewhere ITT, there's also Open Music (http://repmus.ircam.fr/openmusic/home) and Incudine (https://incudine.sourceforge.net/), and then of course there's some SuperCollider client stuff. it feels like such a niche within a niche to write algorithmic composition software (something that requires an intersection of some very specific skills and knowledge) in a language like CL that hardly anyone knows, but I'm glad it exists even if I can't personally make use of the one that most interests me (Open Music) because of LispWorks.


Once you start using a lisp for representing music, everything else feels like concrete shoes! I have written about this in my thesis paper here if you are interested.

https://iainctduncan.github.io/papers/design.html#why-use-a-...


Open Music has precompiled LispWorks applications for Windows/86, Linux/86, macOS 86&ARM.

https://github.com/openmusic-project/openmusic/releases/tag/...

LispWorks is 'relatively' popular for Lisp-based music applications like Open Music, om#, Scorecloud, OpusModus and a few others, because the native GUI toolkit for Windows, Linux and macOS allows to write portable GUI applications. One pays for being able to use a niche language able to write such applications.


I'm aware, but I use *BSD on my computers and can't afford to pay for a FreeBSD LW license to compile something from source myself, so I'm shit outta luck. I am aware that the reason why it uses LispWorks is for the GUI toolkit, which is an understandable reason to since there isn't currently a real free software alternative to CAPI unless one wants to be reliant on Qt or GTK (neither of which are native to MacOS or Windows obviously). maybe one day if McCLIM gets better support for backends other than X11 there will be a real alternative, but even then, from digging into Open Music's source code it would be an absolutely massive undertaking to try to rewrite it to not be dependent on LW and it probably is the same for other CL composition software that uses LW.


Not to be confused with Common Music (https://commonmusic.sourceforge.net/) or Common Lisp Music (https://ccrma.stanford.edu/software/snd/snd/clm.html), two venerable Common Lisp packages for composition and sound generation.


Common Music switched from Common Lisp to Scheme in 2008 (and also supports SAL for people who don't like the Scheme syntax); it uses the S7 Scheme interpreter included with sndlib. Actually Common Lisp Music is neither Common Lisp anymore, but a C library and part of the mentioned sndlib (with some language bindings).


And I use the same one in Scheme for Max and Scheme for Pd.

s7 is by Bill Schottstaedt, one of the godfathers of computer music and the author of Common Lisp Music and the Snd editor. It has really nice design decisions for the composer-programmer.


OpusModus includes Common Lisp Music.


For those wondering "why lisp for music?", I wrote a chapter about this specifically in my recent Music Tech Master's Thesis, for which Scheme for Max was my thesis project. Might be of interest! (This is written to be accessible to a non-computer scientist audience, btw)

https://iainctduncan.github.io/papers/design.html#why-use-a-...



This GUI is made with LispWorks' CAPI toolkit.


Generally the application is based on LispWorks and thus available for macOS and Windows.


There are a lot of cross-platform open-source solutions with comparable capabilities, like e.g. Common Music, Nyquist, Csound, SonicPi, etc.

Maybe anyone has experience why Opusmodus would be preferable to the ones listed?


If you are interested in code-based composition, try my project:

https://glicol.org

I am still working on the composition system, together with many other stuff

here is an example of Kraftwerk:

https://glicol.org/demo#themodel


What I really want to see is a music programming language that does not require elementary knowledge of trig. In fact, I don't want it to use any numbers at all.

They all do: Faust, Impromptu, ChuCK, csound, SuperCollider, etc., etc. I suppose that by itself should convince me that there's no other way (there are things like Orca, but I'm thinking of things that look more like conventional programming languages).

I seldom think about numbers when I'm programming a synthesizer -- I just turn this knob more this way or this slider down a bit. Why can't a music programming language be more . . . gestural? Not sure what the right word is. I want the benefits of a textual programming language, but I don't really want to have to start thinking about sound waves in terms of literal numeric frequencies, particular since I really don't do that while doing sound design.

I don't meant to pick on your project in particular; it looks really cool. But since you're writing one of these, perhaps you can answer my question. Why do these languages ask synth programmers to think in terms of precise numbers when programming an "actual" synth isn't really like that at all?


> I want the benefits of a textual programming language, but I don't really want to have to start thinking about sound waves in terms of literal numeric frequencies

That's a bit of a contradiction. It's exactly the reason to use a programming language to have that level of control over signal processing. Otherwise you're better off with a tool like Reactor or VCV Rack.


TidalCycles doesn't. And you can try it online without installing anything.

https://strudel.cc/

Try evaluating `d1 $ s "bd sn"` to get a bass drum-snare drum rhythm going. Then `d1 $ s "bd*2 sn"` to kick the bass drum twice each loop instead of once. It can be extremely intuitive.


Doesn't what? Doesn't use numbers?

  scale(scales)
  .scaleTranspose("[0 <2 4>]*2")
  .struct("x*4")
  .velocity("<.8 .5>\*4")
  .velocity(0.8)
  .slow(2)
  )
  .fast(1)
  .note()
  .clip("<.4 .8 1 1.2 1.4 1.6 1.8 2>/8")


Require trig.


Because it's a text interface, not a gestural interface.

If you really want a gestural interface you can add it to any language that supports for MIDI control, or some other hardware connection option. (UDP, etc.)

The gestural part is trivial, just as putting a knob on a synth is trivial. The hard part is getting the knob to do something,. Which is not trivial at all.

In fact it's impossible without using numbers somewhere in the make-it-work chain. They may be a few levels down, but they're always going to be there.


I'm not suggesting that we banish numbers from the entire stack. I'm asking why they are absolutely necessary for a textual interface in this domain -- to the point that, as someone says below, it is a "contradiction" to suggest otherwise. As if there's some sort of impassable gulf between csound and VCV Rack.

Let's talk about LaTeX this way. Suppose LaTeX required everything to be specified in explicitly numeric terms. I find this sort of tedious, and I start asking why we can't just express the idea that things be "centered," or "justified," or "kerned" or "Large(r)," or "ragged right."

Would you really say that I am speaking in terms of contradictions? That what I really need is Word, that I must not understand the difference between a textual language and a gestural one, and that the only reason to use a textual language is precisely so that I can have precise control over these matters?

What I'm really asking here is whether we are really talking about the hard limits of programming languages, or if we are instead talking about a certain lack of imagination among programming language designers in this space?


I think what you are asking for is for an abstraction layer that is on top of what the current systems do. LaTeX is a very good analogy, as it is a set of macros that hide away the numericity of the underlying TeX typesetting system. Once upon a time people did use TeX to write papers because LaTeX did not exist yet.

Such a higher level macro system must make tradeoffs between sufficient control and conciseness (though its typically possible to insert low level code in between the macros since before any macro can be executed, rendered etc. it must be converted to the lower level anyway).

Developing such a system is probably a task for tech-savvy musician rather than a music-savvy techie. Its value proposition would be precisely to crystallize composition "invariants" that are expressive and versatile enough to enable people to compose genuinely new things.

But you should keep in mind that all LaTeX papers look a bit alike :-) (though much better than Word papers).


Maybe some constants or enums to give names to specific numbers.

let CENTERED = 0; let JUSTIFIED = 1;


You are looking for what we call an "algorithmic music language", where the focus is on manipulating symbolic music representations rather than digital audio.

OpusMondi is one of these. Others include my project (Scheme for Max, mentioned elsewhere at top level of the thread), Common Music, OpenMusic, etc.

Visual options include Max and Pd, which have an entire message/event layer that does not have to be used for digital audio at all.

All of these can output to standard synthesizers if the digital sound part is not your interest.


Sonic Pi binds MIDI codes to symbols like `:a4` for their corresponding note names, if that helps. It's not comprehensive -- there are no entries for doubled flats/sharps, for instance -- but you can write basic chords/melodic lines with a pretty limited need for numbers.

You'll still need some for `sleep` (or `play_pattern_timed`), but if we're being pedantic about it, note lengths are already numbers as is.


I agree. When possible/working with sound, I would take a tactile experience (right-brain/feel?) over a mathematical/analytical experience (left-brain/logic?). I also don't know music theory and I haven't dedicated time to learn math, so I lean on my intuition more than anything.


> does not require elementary knowledge of trig

As math fields go, trig is fairly easy. The part you need to understand for music is a nicely-delimited chunk that you can learn quickly. I find it very rewarding as a way to think about music; you might too.

(I'm not talking about Fourier transforms; just basic trig.)


Music is numbers. Musical instructions that don't use numbers seem as feasible as architectural plans without measurements -- which is to say, somewhat, but impossible to do precisely.

(Music notation might not have explicit numbers but it's got stand-ins for them.)


What about Orca?

https://100r.co/site/orca.html

Esoteric visual music programming language that uses a 2D grid of operators.


Orca is explicitly mentioned in the comment to which you are responding.


oops!


this is an interesting point.

I would say live coding opens many possibilities, for example this one:

```

a: sin 440 >> mul 0.1

b: sin 441 >> mul 0.1

```

and you can use a loop to create 100 sine oscillators with random frequency

it's totally different from a physical synth

also there are tons of variation in terms of "patterns" for sequencing

just a unique feeling


What's the core benefit in comparison to all the other existing open-source audio/music programming environments (https://en.wikipedia.org/wiki/List_of_audio_programming_lang...)?


Glicol has a synth-like syntax, trying to balance the simplicity and readability needed for live coding music performances.

This syntax is also deeply integrated with the customised audio engine under the hood. And this audio engine can be used as an independent Rust audio library.

You can also use Glicol's DSL in Rust projects.

There are many use cases in this YouTube channel, such as Glicol running on Bela, functioning as a VST, and as a CLI tool:

https://youtube.com/playlist?list=PLT4REhRBWaOOrLQxCg5Uw97gE...

But all in all, I just feel comfortable coding with it for experimenting sound design and improvisation.


cool, thanks.


Something I noticed about all these projects (and they are quite a few) is that they are quite old (some going back ~2 decades or so).

I wonder what is the dynamic behind that longevity. Music hasn't changed ofcourse but on tech side I would think there are significant new possibilities.

Is it something related to the difficulty of implementing low level algorithms (famously a lot of linear algebra stuff goes back decades and rests on C / Fortran libraries). Is it that there isn't enough interest to justify new efforts or are those systems already near "perfection"?


> some going back ~2 decades or so

Some indeed started long ago; e.g. Common Music had its roots in the eighties and became a pretty popular composition environment during the nineties; in 2008 there was even a fundamental redesign and it's still developed. But there was also a certain abundance of new tools; many were released that essentially had the same goal and offered the same features, just implemented a little differently.

> Music hasn't changed ofcourse

Music and the way music is composed, produced and consumed has changed tremendously over the years, and so have the tools. In the past the focus was on algorithmic composition, and tools allowed to extend the possibilities of a composer also to sound design, but it took years until computers were fast enough to render a composition in real-time. Then came the time of the DAW's when eventually everyone could produce music with little investments. In the last ten years live coding became popular which is yet another way of composing and producing music, with new requirements for interactivity and ergonomic efficiency of the tools, and yet a different view of the composer and the composition process.


However, and this is something I wrote about recently in my thesis, we are now experiencing somewhat of a renaissance of older approaches as it is only fairly recently that it has become practical to run the older (lisp-based) algorithmic tools in real-time. I can run Scheme during live playback and have the GC finish it's business fast enough to use it with very acceptable audio latencies within Ableton Live for example. I'm just now embarking on a PhD in this area actually, and its pretty exciting how many previously dusty things can be used in exciting new ways.

I discuss this a bit here: https://iainctduncan.github.io/papers/introduction.html


Thanks for the thesis; looks interesting, will have a close look at it. Actually, I'm not really sure whether "Lisp has always been an elegant and productive way to represent and build music"; from my point of view the optimal way to represent music incorporating all relevant dimensions and relations has yet to be found; actually Dannenberg himself switched to SAL, away from Lisp (see his algorithmic composition book).

What's the topic of your PhD? Who is your supervisor?


Well, Dannenberg's SAL is really a sugar layer over XLisp though right? I remember citing his writing somewhere from the book with Simoni on why Lisp is great for music. My impression was that SAL's raison d'etre was to be more accessible to people for whom lisp is too weird than anything else, but perhaps I am not completely correct.

My PhD is an interdisciplinary between music and CS, working with George Tzanetakis and Andy Schloss at University of Victoria in BC Canada, continuing the same work I did for the Masters. So that is Scheme for Max and other Scheme related music work, targeting algorithmic composition, mainstream production, and live coding contexts. Some of the current initiatives include a browser based Scheme algorithmic music system (not yet published, but using a WASM C++ worker for a sample-based scheduler), further work on s4m, s4pd, and Ableton Live tools, integrations with Csound (I wrote the csound6~ port for Max), likely a standalone host (similar to Grace), an object system and score tool, and some actual music!

(EDIT: I was wrong and thinking Nyquist, not SAL!)


> Dannenberg's SAL is really a sugar layer over XLisp though right?

SAL was designed and published in 2008 by Rick Taube; the present implementations are transpilers to Scheme or XLisp, but SAL is quite different from both Scheme and Lisp (in syntax and semantics).

> My PhD is...

Sounds interesting; but what is the actual research focus (besides the programming work and tool implementation)?


Ah right, typed too soon, I was thinking of Nyquist, which is over Xlisp. YMMV, but for me personally I find Lisp much nicer to represent music than SAL.

My PhD is interdisciplinary, so it is not a pure research CS - it's a combination of CS work, project work, and music composition & performance. The research side will be into how Scheme and recent developments in the Scheme side of PLT can be used in modern machines/environments for exploring algorithimic composition and live-coded composition and improvisation.


> I find Lisp much nicer to represent music than SAL

Lisp and Scheme are indeed very flexible to represent about anything, but on a very fundamental and general purpose level; of course you can do some kind of "DSL" with macros, but it's still "Lispy". SAL has less degrees of freedom and helps users not to get lost or bogged down, but it's still a general purpose programming language, not a specification system covering the essence of musical structures and processes.

> My PhD is interdisciplinary, so it is not a pure research CS..

Here in Switzerland "interdisciplinary" means that the research topics concern more than one research area, not that it's not pure research. Usually the PhD students are more challenged than with a "traditional" PhD, because there are more professors involved, each with his own research focus, that is most important to him (so it happens that the student does actually work for more than one PhD).

Concerning Scheme, depending on how big the "composition" is and whether it does sound generation and has to be controlled in real-time, a traditional byte-code interpreter will likely get to its limits, even on present HW.


Well sure, you can bring any real-time sound system to its limits if you want to - some of my additive synthesis experiments do that very quickly even on pure C++.

But as far as practical use goes, I run 16 algorithmic sequencers implemented completely in s7 in real-time, inside Ableton Live, at an output latency of 8ms, and do so for long enough for compositions. This is while Live does a ton of software synthesis and FX dsp too, and all of the sequencers can be altered on the fly without audio dropouts! This is on the cheapest M1 you can get too. So it's absolutely practical for real time work. This is also without even a ton of attention to real-time GC in s7 - I haven't dug into that yet, but Bill has told me that while he did a lot of work to make it fast, it doesn't use an implementation specifically targeted at lowest possible pause times.

Whether the tradeoffs of Scheme vs other options are worth it for a particular composer/producer/performer varies of course, but it really is time to put to rest the notion that we can't run a Scheme interpreter for real-time music generation.


Blinking cursor. Full stop - can't use. But thanks for building it, anyways.


That's so racist.


Huh? How come?


It just seemed like a funny way to mislabel something that to me is, sincerely, a strange if refreshingly naked form of bigotry. What's wrong with blinking cursors? They're so easy to find.


I see :-)

Well, it's not that I have anything against blinking cursors, nor I'm trying to infringe on their rights. Rather, it is that seeing the cursors blinking kind of freezes my brain. I simply cannot code if the cursor in the editor is blinking. It's a common problem[1][2].

[1] https://jurta.org/en/prog/noblink [2] https://www.justanswer.com/neurology/j0wg1-team-started-issu...


FWIW, I have also authored a related tool. I wrote Scheme for Max and Scheme for PD, enabling you to run s7 Scheme inside Max, PureData, and Live (through Max). It uses the same Scheme interpreter as the Common Music (mentioned here) and allows you to run a fair bit of common music code, though it is in general targetted at being a bit more low level. And of course includes a bunch of Max integration things not in CM. You can use it, for example, to write sequencers and automation tools that share Max buffers, sync with the transport, use the Live API in Ableton Live, etc.

Project page here: http://github.com/iainctduncan/scheme-for-max

Demos here: https://youtube.com/c/musicwithlisp

Long form (thesis) paper on the project: https://iainctduncan.github.io/papers/index.html


For even easier (and still reasonably robust) text-based music composition, look into ABC notation:

https://en.wikipedia.org/wiki/ABC_notation#Example


This is interesting and inspiring! However, if you don't know anything about music, would it be fun to play around with it, or tedious? Trying to allocate my down-the-rabbit-hole cycles a bit...


What notation rendering library are they using?


> That Opusmodus has adopted MusicXML as the de facto standard for displaying notated scores should be no surprise. This is inextricably bound up with the development of the distinctive Opusmodus Notation script (OMN). It gives the composer the means to design into the very composition of a score a host of musical details that have until now been impossible to bring together in a single line of script.

https://opusmodus.com/forums/notation-viewer/


> That Opusmodus has adopted MusicXML

What are some other notable and open formats for notating scores? I'd like to know the what the popular formats are, do a survey and choose one for my own work.


ABC is the other major player in the space besides MusicXML and Lilypond.

The Mutopia project [1] is magnificent but largely abandoned in favor of MuseScore [2] which uses MusicXML. The amount of music available there is staggering but locked in to their backend.

Unfortunately automated translation is difficult because Lilypond is very oriented towards specifics on how the notation is rendered.

And, if you are interested in general archives of music, IMSLP [3] (Internet Music Score Library Project) has to be mentioned as well, but mostly contains scans of existing engraved music.

[1] https://github.com/MutopiaProject/MutopiaProject

[2] https://musescore.com/sheetmusic

[3] https://imslp.org


Have a look at MNX, which is in the process of being designed:

https://w3c.github.io/mnx/docs/

It's an open JSON format that's being hashed out by members of the music technology community. It's not production-ready yet, but I encourage you to get involved in the discussions! https://github.com/w3c/mnx/

(I lead creation of the format, as one of the co-chairs of the W3C Music Notation Community Group.)


MusicXML is pretty much the game in town as far as open formats go. Lilypond is an open TeX-like format, but it's really a domain-specific programming language for Lilypond itself.


> Everyone Can Code

Right...


Begin rant.

Call me crazy, but all the great music of today is being done in video games and cinema scoring. I'm sure this system is useful for some, but I can't help but feel the kinds of modern classical featured are just noise. The claim is often that music is cultural. I'm sure that's true, but then where is the great modern Western classical music? Why was it thrown away? There are reasonable explorations to be had. For example, modern composers could have chosen to integrate Jazz harmonies (which still sound concordant), but instead they chose to go off the deep end with atonality, aharmony, and arhythm. We gotta end the postmodernism and return to actually nice things.

And really, it's sad because the kinds of scores being produced with the rhythm changes every measure, etc. They really ultimately sound like the pretentious ramblings of some drunk/high guy at a MIDI controller instead of the carefully assembled score. It takes real talent to properly keep meter over the course of an entire song. Just banging some keys and then making other people attempt to replicate it... I mean props to the replicators (the players), but the scorer just threw some notes on a page.

In my opinion, this is a racist response by mainly European composers to the popularity of Jazz music which is associated mainly with African Americans, from whom the source originated. They were jealous of what they perceived as the novel rhythms and harmonies, but instead of building off that or inventing something new that still had rhythmic and harmonic value.. they did this


> Call me crazy, but all the great music of today is being done in video games and cinema scoring.

Okay, you're crazy.

...But seriously, when's the last time you heard a good speed metal song in a video game? And no, Brütal Legend doesn't count.

> but then where is the great modern Western classical music?

What, like Johannsson? With how much new material is being released every year the question isn't "where are the great works," but "how do we separate the greatest works from the lesser ones?"

> We gotta end the postmodernism and return to actually nice things.

This reminds me of Beethoven's Große Fuge, which some called repellent and other called a masterpiece. It's like how I don't understand Cubism but some people love it so there must be something I just don't see.

And remember Hitchen's Razor: "Never attribute to malice that which is adequately explained by stupidity."


> I'm sure that's true, but then where is the great modern Western classical music?

It's like literally everywhere! I almost exclusively listen to contemporary Western classical music (WCM) and it's never been more exciting and better. There has never been a time where there are so many different dominant styles at the same time. There are atonalists [1] like Unsuk Chin, Jennifer Koh, Charles Wuorinen, Fred Lerdahl. There are neo-Romanticists like Jennifer Higdon, Michael Torke, Thomas Ades. There are minimalists like Caroline Shaw, Max Richter, Bent Sorensen, Christine Southworth and their ur-father Philip Glass who still writes music at 86.

If you're interested in my full opinions about the cultural force of contemporary WCM please read this [2] HN comment of mine.

Seriously contemporary WCM is awesome. It's very cliche but "if you don't like it, move on".

> In my opinion, this is a racist response by mainly European composers to the popularity of Jazz music which is associated mainly with African Americans, from whom the source originated. They were jealous of what they perceived as the novel rhythms and harmonies, but instead of building off that or inventing something new that still had rhythmic and harmonic value.. they did this

Meh, I don't think this is true at all. They're just entirely different artistic traditions. Just because haiku exists doesn't mean American novels can't.

I don't dispute that tons of normie classical music listeners (like r/classicalmusic) are racists/elitists. These people almost exclusively listen to old German common practice stuff like Bach or Mozart. They pretend that 18th century German music is somehow superior to everything else. Almost none of them would consider Ligeti or Glass even classical music. This is not the contemporary Western classical music scene at all. It seems like you may not have a sophisticated enough understanding of this subculture, imho.

[1] mostly Ligeti/Messiaen inspired people as opposed to Serialists

[2] https://news.ycombinator.com/item?id=37424409


The accusation of racism is an interesting take. There were strong links and crossovers between jazz and classical music until serialism happened. They didn't develop independently. It wasn't all that unusual for black jazz players and composers to be as classically trained as white musicians.

But serialism was too far for most people. And still is. Failed composer/critic Adorno, who adored serial music and is a Big Name on the scene, absolutely loathed jazz and popular music.

It's not really atonal. It's antitonal. Truly atonal music wouldn't care about standard pitches or notation at all, because they're still based on the harmonic series. It's antitonal because it pretends that's not true, while also trying its best to avoid the usual paths through harmonic space.

As for the quality - there's an opera called Wozzeck which is performed fairly regularly. The rest is mostly museum music - relegated to special academic festivals. Not mainstream at all.

It's actually very structured, and if you know what's happening you can hear the patterns and components going by.

But as music it has a very limited emotional range. And intellectually, most of it is pure crossword puzzling for the sake of it.


I suggest you listen to some of Maria Schneider's work. It fuses jazz, classical, and even rock (she collaborated with David Bowie on his last album).

And Schneider is just one counterexample to your thesis.

https://en.m.wikipedia.org/wiki/Maria_Schneider_(musician)


I would classify her as a Jazz artist. Contemporary Jazz is great.


> the kinds of modern classical featured are just noise

Ok? Maybe they chose noisy examples on purpose? Focusing on their specific music choices is purely bikeshedding, and misses the point of the whole point of the project.

And your rant about "music of today" shows that you live in a bubble. There is no "music of today". There's a vast sea of musical diversity in this world.

> In my opinion, this is a racist response

It's really unclear what response you're referring to. Are you talking about your own response?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: