Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Common Lisp and Music Composition (ldbeth.sdf.org)
131 points by wglb on Jan 17, 2023 | hide | past | favorite | 42 comments


On a closely related note, and possibly of interest, I am the author of Scheme for Max and Scheme for Pd, which put the Common Music 3 Scheme interpreter in Max and Pure Data. Common Music's most recent version used s7 Scheme as the language, which is mostly a a Scheme but borrows many features from Common Lisp (keywords, defmacro, etc). With Scheme for Max, you can basically run almost all Common Music code inside Max, Ableton Live, and Pd, allowing you to use it with more commercial tools (such as VST instruments, etc). It has extensive API functions for hooking into the host scheduler and data structures as well as running Lisp/Scheme code.

Project is here: https://github.com/iainctduncan/scheme-for-max Youtube here: https://www.youtube.com/c/musicwithlisp

There will be another release in the next month or two. I'll be continuing this project as a PhD project so it will keep going!

I do plan on eventually releasing a full Common Music portability shim too.


Other Common Lisp applications for music, written in LispWorks, http://www.lispworks.com :

ScoreCloud, Music Notation: https://scorecloud.com

MusicEase, Music Notation: https://www.musicease.com/

OpenMusic, Music composition with a visual programming language: https://github.com/openmusic-project/openmusic/ , https://openmusic-project.github.io/openmusic/

OM#, originally based on OpenMusic: https://github.com/cac-t-u-s/om-sharp , https://cac-t-u-s.github.io

Most of these applications are available for Mac and Windows, some even for Linux.

OpusModus, https://opusmodus.com (mentioned in the article) now is on Macs (Intel / Apple Silicon) and an upcoming version is promised for Windows


Maybe I've just been blind to it but feels like CL has been getting mentioned more on HN lately (I do remember the early days when Lisp/Scheme/Arc were mentioned a lot since this site runs on Arc). Actually gone through some of that Common Lisp the hard way that was linked here not terribly long ago.


I spent some time this year using Common Lisp. It's expanding my mind and I see all sorts of alternate histories. I'm starting to feel very curious about SmallTalk for that same reason.

There have been a lot of attempts to revitalize Lisp. Clojure is the one that comes to mind, and I do like that language. My personal take CL simply has a marketing problem. The name sounds so stale and boring that I never thought to pick it up. "Common" may have been a word that invoked unity in a fractured ecosystem at some point in time, but today it communicates "Nothing Special".


It's too married to emacs right now


I'd say it is worth trying VSCode and Alive, I've enjoyed the little bit I've done with it so far, has hot keys for things like compile file or just compile current form.


What's wrong with vlime?


Exposure to Smalltalk was very helpful in getting Objective C.


I completely agree about seeing more CL related topics here on HN. I thought since I am actively learning CL that it was due to "frequency illusion" [0].

[0] https://en.wikipedia.org/wiki/Frequency_illusion


What are you using to learn?


Mostly books. Old school ;-)

Toureztky's Common Lisp A Gentle Intro to Symbolic Programming Norvig's PAIP Seibel's Practical Common Lisp Graham's ANSI Common Lisp

I'd like to snag a copy of Sonya Keene's book on CLOS but hesitant to drop $50+ for a used book.


oh man you remind me I have a copy of PAIP I never fully worked through...

Also Lisp in Small Pieces (I went through a helluva lisp phase a long time ago but never got as deep as I should have).


> Common Lisp the hard way that was linked here not terribly long ago

Here: https://news.ycombinator.com/item?id=34326311


So how is programming in Common Lisp these days? I know a bit of Clojure/Fennel, but I feel like the Common Lisp ecosystem is a lot more fractured(I might very well be wrong tho)?


Feels alright though I'm still early in relearning it. Going through that Learning CL the hard way[1] plus grabbed On Lisp and slowly working through that as well. I also need to really mess with Quicklisp which I set up to give me a package manager. Alive is a damn good plugin for CL on VS Code if you don't wanna go down the Emacs hole.

It is worth mentioning Hard Way still has a bunch of holes in it, like I got to the chapter on vectors and it is basically blank

[1] - https://llthw.common-lisp.dev/


Same, still trying to get a good book that's pragmatic and for experienced developers. Many starts from the basics, or don't even talk about stuff like Quicklisp and ASDF.

I want a book to make production-ready software in Common Lisp, not to faff around. The Paul Graham "On Lisp" book seems excellent, and I'll dive into it next.


I think "Practical Common Lisp" is pretty good. The wikipedia for it is https://en.wikipedia.org/wiki/Practical_Common_Lisp

A direct link to the PDF is here too. https://github.com/ccceye/computer-book/blob/master/Practica...

Another interesting one is "Land of Lisp", https://www.amazon.com/Land-Lisp-Learn-Program-Game/dp/15932...

It's more theoretical, but kind of fun. It's a touch more academic (IMHO) than Practical Common Lisp, but pretty good.


Yea this is a thing too, I have no idea what is recommended in the current ecosystem. SBCL + Quicklisp? I don't even really know what ASDF is.


https://lispcookbook.github.io/cl-cookbook/ ? Implementations, Quicklisp and ASDF explained


Thank you. I have come across your posts about moving from Python to CL, and the work you've been doing with the cookbook and other libraries is very much appreciated.

Your recent efforts might be one of the reasons there is a little bit of Lisp hype on this forum lately :-)


Thank you! That is a very nice resource


If you want true common lisp SBCL is probably the most universally known, and yeah everything I've read indicates one of the first things you should do is download and run the quicklisp setup so you have it working with your environment. Though it is funny how Hard Way did it during initial setup but then hasn't used it at all and I'm a chunk of the way through. Even as a beginner book I'd probably briefly touch on packages because it is so important to modern development.


FYI PG put the PDF up on his site so you can just legally download it.


I have bookmarked this version with restored images: https://www.lurklurk.org/onlisp/onlisp.html


It's not very fractured, especially in open source as many "common libraries" support most implementations.

It very much helps that there's a single standard that is quite rich (unlike Scheme) which makes for much easier portability between implementations, to the point that somewhat common repeated trope was developers using one implementation for faster iteration and another for deployment (for example, CCL for development and SBCL for faster code in deployment, or CCL/SBCL for development and ECL for target deployment).


People sticking to their good intentions for the new year, maybe? Common Lisp is a pretty great language, though (especially with defstar and alexandria).


I actually don't know defstar or alexandria but I'm very rusty on CL (touched it I dunno a decade ago? along with a bit of time off and on with Racket scheme and Clojure at various points).


Music from code is a very interesting idea, but it always struck me as a something to be done after a melody is made rather than a tool for creating music. The instantaneous translation of motion to music on an instrument is difficult if not impossible to replicate with code. Euclidean rhythms are a good application.


I remember seeing someone perform a live gig at a Haskell conference programming music in real time - there's probably videos online somewhere (youtube)


Almost certainly 'yaxu who has a bunch of videos on YouTube re: TidalCycles (the live coding env he created in Haskell) - https://www.youtube.com/@yaxu/videos

Also does a lot on the Euler Room channel including a live stream this last weekend - https://www.youtube.com/@Eulerroom/videos

There's a web based version called Strudel that's a good way to get a quick intro without the hassle of the TidalCycles setup - https://strudel.tidalcycles.org/


Don't think this is at a haskel conference, but this looks like fun: https://www.youtube.com/watch?v=G1m0aX9Lpts. Their web site is https://sonic-pi.net/.

An explanation of sonic https://www.youtube.com/watch?v=OLLwG_SN8oo


Sonic Pi is really neat, especially the work that has been done using Erlang in the playback scheduler.


I used to use Common Music[1], a Scheme music composition environment and loved it... but it seems the project died years ago.

I'd love to find another lightweight Scheme-based music programming language without any graphical dependencies.

[1] - https://ccrma.stanford.edu/courses/220b-winter-2006/cm/doc/c...


I have ported most of it to Max/MSP and Pure Data as the Scheme for Max and Scheme for Pd projects. I'll put a top level post up on this thread. Common Music is great, unfortunately the author now has to teach in Python, hence it languishing.


btw, if you want to use it with not graphical deps, you should be able (though I haven't done it) to run it in Pd headless.


The author mentions using OpusModus, noting that it is similar in the spirit of Symbolic Composer. OpusModus is primarily the work of Janusz Podrazik, who also happened to be one of the main authors of Symbolic Composer.

Janus is also the co-author of a very nice book on the fundamentals of composition with OpusModus. [1] The book also servers a nice introduction to Lisp as well!

[1] https://diastemastudiericerche.org/product/marco-giommoni-ja...


Related talk in Clojure: http://skillsmatter.com/podcast/home/functional-composition

He starts with a sine wave and builds up abstractions until he has a Bach canon.


Interesting article. Thanks.

Noticed a lot of use of setq... Wondering if this is simply the author's muscle memory or if there is a speed or reduced complexity advantage compared to using setf.

I think this kind of demonstrates the amazing plasticity of Lispy environments. There are multiple ways of doing something as relatively straightforward as assignment, all within the one version of the environment (I know, other langs can do this too, but still neat).

I'm gradually getting my head around Emacs lisp. Lots of setq there.


There is no speed advantage. Some argue that you should always use setf, and that setq leaks an unfortunate implementation detail. Others argue that you should use setq whenever possible, so that use of setf clearly flags the fact that something more complex is going on.


I have been a happy user of OpusModus for a while. The latest version is based on LispWorks. OpusModus used to be based on CCL, but sadly CCL does not have a clear path forward to run on M-based Macs. It would be great for CCL to get some technical help, but OpusModus has left that platform.


Good though that they are using LispWorks since they are active on the users group for LW. They once answered a question I had on app signing.

re: article: I would like to try the software.


Reminds me of this clojure talk https://youtu.be/Mfsnlbd-4xQ




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

Search: