< Back to IRCAM Forum

AI assistant for programming in OM

Hello, has anyone had any positive experiences with AI assistance when programming in OM? Can anyone recommend an AI assistant that is capable of understanding instructions given in everyday language and then carrying out those instructions? Thank you, PetrH

Hi Petr,

Yes I had some experience with AI and OM, and some of it very so so. I tested Claude. It does find things, but you need to be extra careful with what it outputs. Most of the code is somehow clumsy and awkward even if it works. Sometimes it doesn’t you need always to verify.

It could a help for starting or finding things but i won’t be very confident in its output.

Best
K

1 Like

Hi Karim, exactly. I’ve had the same experience, which is why I’m surprised that so many people are saying that AI is replacing entry-level programmers. If AI were tested for programming skills in OM, we wouldn’t be able to talk about AI as ā€œintelligenceā€ or a threat to humanity :slight_smile:

I’ve used chatgpt for some work, speeds up ad-hoc development work massively.

I’m talking lisp with cgpt, not sure how well it performs with human-language-semantic-only prescriptions though.

Interesting - seems cgpt’s lisp-powers has improved extremely much since initial attempts 8-12 months ago, where the output contained lots of very basic syntax-errors, and extremely ugly ā€œC++Python-styleā€ lisp-code. The syntax trouble is gone, its easy to adjust style preferences.

If presented with OM code it seems to be able to adapt, extend, specialize etc.

What are you looking for?

For general tasks where you’re expected to use python, c++, java, web etc i think its very true. Good friends - expert programmers - tell me they use various AI-powered tools for most of their coding now.

Seems most entry-level and assistant programmer jobs are getting superflous, forcing people to ā€˜jump’ from their masters-exam-level to pro in some way.

Hi Anders, it’s good to ā€œhearā€ from you. I’m a little confused about who’s who—Vinjar or Anders? But let’s get to the point: AI. Sometimes I have to interrupt my creative work with OM to deal with programming issues. There are a number of processes whose formalization takes me a lot of time. So I’d like to have a tool on hand that can quickly handle the problematic formalization for me. I tried the free version of ChGPT—it suggested complete nonsense. I tried GEMINI—PRO.2.0., which our university has a subscription to. The success rate was about 1 in 10 (and it keeps apologizing and claiming that it’ll get it right this time). I gave Gemini the following task (prompt). It understood immediately what was required, but none of its suggestions worked.

P.

A task for Gemini, which ā€œunderstandsā€ it but cannot complete it (formalize it in OM):

"Imagine that the starting point of a numerical series (sequence) is given. Let the starting point be the number 6000. Additional numbers are successively added to this number, causing the series to grow—it has more members. The numbers added are positive integers. Once the sequence reaches the value 10,800 through successive addition, the addition of positive integers stops, and negative integers begin to be added. The sequence thus changes direction—it becomes descending. It will continue to decrease until it reaches the value 2,400. Then the process repeats. Positive integers are added up to 10,800, and then negative integers are added down to 2,400. It’s like a ā€œsnakeā€ that first winds upward toward the upper ā€œturning pointā€ of 10,800 and then downward toward the lower ā€œturning pointā€ of 2,400.

What matters is how the ā€œsnakeā€ approaches the turning points. Let’s say the sequence currently has a value of 10,600. The next number to be added is 300. After adding it, the sequence would reach 10,900, which is unacceptable. So, when moving upward, we can add numbers such that the resulting sequence reaches a value closest to, but not greater than, 10,800, and the same applies when moving downward.

In OpenMusic, you can use the function dx->x to construct the sequence, setting the initial value in the first slot and adding to the second slot—gradually adding whole positive numbers and then whole negative numbers.

Question: How do you create such a ā€œsnakeā€?"

I think there are ways of ā€œpreparingā€ OM to be understood by AI. that includes having a lot of training data out there, but also keeping the documentation up to date, and complete, with lots of example patches, and so on. I believe there are also certain formats / standards that one can use to explicitly ā€œteachā€ AI things these days. I am only starting to learn about these things myself at my day job (which is not in music, sadly).

Anyways, I do hope this is an IRCAM focus some day, I know IRCAM is busy making improvising AI agents and so forth, which is fun, but I’ve had so many ideas for OM patches that were like . . ." hmmm, this would take me 3 weeks to
program . . . but I’d rather be composing, so I’m just gonna make some kludgey thing in python and do the rest manually."

I would to be able to describe a patch to Gemini and it gets me even partway there.

I get the feeling that OM is maybe doomed to be mostly-open-source for now on, in which case it may be up to us users to ā€œprepareā€ it for AI.

I’m just surprised that there’s a lot of industry-specific or specialized software that AI ā€œcan do,ā€ but OM can’t—or can do only very little of it

Not sure if i understand - do you want your AI-tool to make OM patches?

Or is a lisp-function to put in a patch ok?

The last case is straight forward (asked cgpt for a snake-suggestion now, which seems to work as expected), so you’re probably more on the gui/patch thing.

OM - the code, docs, example patches etc - is of course available, seems semantics also is grabbed quite well. It can set up new ad-hoc OM code and patches which run as expected.

More interesting is of course having it do the user-interaction, the wanna-be patching done by a composer. What would this look like?

not sure what you mean by ā€œdoomed to be mostly-open-sourceā€ - how would this impact AI-level tools in OM?

do you want your AI-tool to make OM patches?

Yes.

not sure what you mean by ā€œdoomed to be mostly-open-sourceā€ -
how would this impact AI-level tools in OM?

I think what I am talking about is called ā€œharness engineeringā€ nowadays—basically setting up and teaching the AI to work with a particular software paradigm so that you can focus on what you want to build, rather than tweaking your prompts endlessly (and sometimes hopelessly, because the AI simply doesn’t know enough.)

I get the feeling that there is a low likelihood that IRCAM teams will focus on OM in the future, and thus, this kind of thing would be up to the community to work on.

Interesting. What gives you this impression?

where does the open-source part enter?

Interesting. What gives you this impression?

I don’t think I’ve seen much about it on the IRCAM newsletters; but of course you guys are here answering questions, which is much appreciated. Maybe I just work in the corporate world and have a doomed outlook where contemplative-creative tools (as opposed to real-time performance tools) are always in last place.

where does the open-source part enter?

I would imagine users uploading tons of example patches.

I did ask cgpt to guide me how to build a specific idea I had about a year ago, and it immediately hallucinated several non-existant objects that I should connect together. But,…that was a year ago.

No, you have the right impression unfortunately.

K

Hi petrh,

I am not a programer and I used Deep Seek for creating lisp code for various rhythm development tools that I use in my work. I must have about 40, at least, modules by now. From simple rhythm manipulations to rhythm textures creation.
As I know, more or less, what I need need as result on the compositional level, it is easier to ā€œtuneā€ the code. Sometimes I needed 3, 4 versions minimum to get it working corectly.

It is fun doing it and it helps a lot to tune your compositional thought…

greetings,

Dimitris

sounds like your perfect OM-composer! Need something? Program it! (Or ask Karim… :slight_smile: )

Good ā€œcontemplative-creative toolsā€ (great term btw!) are by nature insistingly ill-defined, in a state of constant artistic-intuitive R&D. OM is like the best art: once something is described in a program-note, article at a conference or forum, it already became a bit boring. Bugs, lack of documentation, version-mismatch, backwards-incompatibililty - halleluja!

In my view this makes much of AI a perfect companion to OM.

Hi Dimitris, is this what you mean? Free one?

p.

Hi,

The best approach is perhaps to prompt for LISP functions/methods. If you know what to ask for, you’ll likely get good results which you can then use in your patchers as generic LISP functions/methods.

All the best,
António