< Back to IRCAM Forum

Call Lisp Listner from outside

I wonder if there is a way to call the Lisp Listener of OpenMusic from an external lisp editor. Ideally I would like have it inside VS Code or Eclipse.

I have long way ago abandoned making my projects with graphical cable and boxes and I am enjoying composing my music only within the OM lisp editors buffers and OM function boxes. However I need a better editor now than the lisp editor built inside Open Music.

If that is impossible i would like to know how can I export all OM code and OM lisp files inside an external lisp environment and run everything through CLISP or SBCL. Since I don’t need anymore the graphic environment of OM.

The main reason why I would like to still stick in some way to OM and not leaving it entirely is because I need the OM midi lisp files since I haven’t found a way yet to figure out how to install portmidi in my lisp environment.

Hi Andrew,

In your very relevant and interesting question you have brought us here, are in fact two topics:

-the editor
-the compiler

Concerning switching the editor, this will be perfect if possible. It is! But, needs some (a lot ) of coding, since the om listener is a custom built in one. It is really basic I agree.Would be really nice to have for instance an emacs editor (my own preference). So this have to be notes.

Concerning compilers, such as SBCL (my prefered also), the problem is, that it doesn’t include a graphic gui. So eiher you forget about the graphic side of OM, you can of course (with some work) compile OM without the gui-api part and use SBCL with your preferred editor.

The last resort, is to use the excellent LispWorks that OM uses to get running but it is not free. You can use the free version, but this have some limitations. LW’s editor is alright.

Hope these infos helps.

Best
K

Strikes me that the first move would be to determine how OM’s dependence on LispWorks libraries breaks down, component-wise. The build-om.lisp file shows what look like ten basic modules:

(load-om-kernel)
  
(load-om-projects '("basicproject" "musicproject"))
(load-om-projects '("midi"))
(load-om-projects '("sdif"))
(load-om-projects '("mathtools"))
(load-om-projects '("omsounds"))
(load-om-projects '("space"))
(load-om-projects '("harmonicproject"))
(load-om-projects '("sheet"))

In kernel-pack.lisp, the *kernel-package* component is subdivided thus:

(AddPackage2Pack *lisp-package* *kernel-package*)
(AddPackage2Pack *control-package* *kernel-package*)
(AddPackage2Pack *data-package* *kernel-package*)
(AddPackage2Pack *maquette-package* *kernel-package*)
(AddPackage2Pack *player-package* *kernel-package*)
(addPackage2Pack *fileutils-package* *kernel-package*)
(addPackage2Pack *di-package* *kernel-package*)
(addPackage2Pack *system-package* *kernel-package*)

(AddPackage2Pack *kernel-package* *om-package-tree*)

This reminds me of something else I had planned to ask, namely, why doesn’t OM use ASDF? Is it because of the age of the codebase? If that could be refactored into GUI and non-GUI systems, guys like @andrew0082 could load the audio-only part in an external editor.

FWIW, my first choice is SBCL / SLIME.

-Jonathan J-S

call the Lisp Listener of OpenMusic from an external lisp editor

You can start an OM repl reading and writing to *terminal-io* by evaluating #'start-tty-listener from the lispworks package. E.g. in emacs you can run OM as an inferior lisp by passing the name of your OM image to 'run-lisp (and evaluate the expression above in OM somewhere), and interact with OM directly from your lisp-mode emacs buffers.

Slime support is slightly more complicated, as it depends on a running swank server in the image (and compile-file is not available in delivered images). I’ve implented it in om#, but the same approach would be applicable to OM6, so you can just grab the code from there.

-anders

Thank you very much for all your answers, they are all really helpful for me.
Following Dumaiu I guess I will simply try to import the libraries into a different editor. I will then save the code in a file from that different editor and at each evaluation of a user lisp function inside OM I’ll make the code load automatically inside OM so I can see the output in a nice score and be able to hit a midi play button to here the final result.
All the best.