< Back to IRCAM Forum

View Code for Built-In Lisp Functions

Good :musical_note: Afternoon,

I am trying to implement some of the functions in OM over to OM-sharp as I seem to have better performance with some patches in OM-sharp. However, some of my patches use lisp functions that are present in OM7.1 that are not available with the tty box in OM#.

Is it possible to view the lisp file for these objects so as to see how they are implemented in OM so I could then port them over to OM#? This would be similar to selecting say an OM+ object and pressing “E” on my keyboard to see the file that contains the function.

The object in question is split-sequence which I gather is from the cl-utilities collection. I would like to implement the same split-sequence behavior in OM#. I can pull the code from its github, but I cannot seem to properly implement the code in an internal lisp function object in OM#. :robot:

I tried following the steps shown here but I did not have any luck wrapping the split-sequence from github in a lambda function and declaring the variables.

Thanks in advance! :slight_smile:

#om-sharp

Dear Austin,

Split-sequence is part of cl-utilities package. It is not specific to OM.
So you might have to ask omsharp developper about how to use this in omsharp.
Beside, i am curious about your statement on " I seem to have better performance with some patches in OM-sharp". Can you be more more specific. I am curious to see the difference in order to improve better OM.

Best
K

Hi Karim,

Yes, I’d be happy to share and diagnose what might be going on to cause performance differences/changes. I’ve moved to using OM on my laptop and it just does not seem to behave quite the same as on my desktop - at least, as far as I can remember.

I’ve attached a video showing the performance. (I do note that it performs even slower when screen recording, however, it is about this bad even when using OM7.1 with no other programs open)

My CPU usage remains around 8-10% for OM when using the software and I have around 24GB of RAM available.

I’ve also attached my PC specs and screenshot of Task Manager.

Please let me know if I can provide or troubleshoot anything else!

Thank you very much :slight_smile:


Dear Austin,

Thank you for your feedback. You are running OM on windows 10. We are planning to port OM on win 64bits. Actually it is running on 32 bits, which could explain the slow performance. However, this seems very strange, for both, om and omsharp to have such slow display. I am testing om on a vm win7 and it seems running faster than what you showed in the mkv. Just to be clear, are these specs on your desktop computer or laptop and what are the differences in performance beteween the two?

Best
K

Thank you for taking a look, Karim. I appreciate it! It is odd, the behavior, because I don’t remember having any such issues on my desktop. The above posted videos are the performance of my laptop.

I think I’ll need to do some tinkering and testing other possibilities on the laptop to try and solve the issue. It’s just strange that OM behaves like this because other open applications (reaper, chrome, Musescore) all work without any sort of lag while in the same working session OM will be very slow.

Do you think that OM build for a x64 architecture would mitigate the issue?

Honestly, I don’t think it is related, though porting om to 64 bit on windows will have many enhancement.
this is something else i believe. It could most probably be related to the dlls. I should investigate this once i can get a REAL winodws machine.
Actually, i develop and use OM on a PC laptop (thinkpad, old generation) running linux (debian) and it runs like a charm. I test and develop the windows version on a vm on the same machine, though i run windows 7. I tried updating to windows 10 and 11, and had the system corrupted very fast.
The apparent reason that omsharp runs a little bit faster, is the fact that it doesn’t use icons for boxes. So might also be graphic related. So may i ask what kind of graphic card you are running on the laptop? is it an intel standard graphic card or a Nvidia?

Best
K

That it a very good point, Karim and I had briefly considered it too - the aspect of graphics usage on the system.

I will say, I’ve been generally disappointed in the GPU for this machine. It’s a Lenovo P15s Gen2 and has a Nvidia T500 GPU. It does an excellent job for processing tasks (the CPU is quite capable) but I have seen lackluster GPU performance in software such as OBS, Steam, sometimes YouTube.

Regarding the DLLs, are you referring to the ones that OM utilizes as part of the Windows Visual C++ Redistributables or something else?

On a second thought,
Can you try this:

  1. create a new workspace and import your patch.
    Tell me if the performance is better or the same.
    It might be also something to do with the workspace.

Best
K

Thank you for the idea!

I’ve created a new workspace in the same root directory (but a new folder) and I have imported only the patch shown in the video and its dependencies. Lo and behold, the latency is nearly gone. I can lasso select boxes, evaluation is quicker, and the workspace loads almost immediately.

Any idea why the workspace would cause such a slowdown?

IDEA - I was recently working on a project that generated several thousand MIDI files (~3200). These were of course kept in my out-files folder. I have moved them to another folder (not related to or located in my OM root folder) and the problem seems to have subsided. I am getting performance similar to the creation of a new workspace!

Could it be the MIDI files were somehow cached or otherwise interfering with the performance of OM?

If you’re interested, the de facto standard way to download and install a third-party Common Lisp library (e.g. cl-utilities, Alexandria) is called Quicklisp. I will aver, having tried myself, that there are some obstacles to using it within OM, but nothing I consider insurmountable.

Karim @haddad, I’d been meaning to ask about this anyway, and I’m not the first. Would you have any theoretical objection to bundling Quicklisp with OpenMusic? If one of us were able to produce a Quicklisp edition usable with OM, would you include it? The same question applies for OM#, for @bresson?

The best argument I’ve seen against Quicklisp is that it’s insecure, yet, I have a hard time taking OM seriously as a potential attack vector.

-Jonathan

Dear Austin,

If you want and if it possible, send me your workspace in order to inspect it. Sometimes, if we displace some non .omp files in the workspace folder, this could cause such problems.

Best
K

Dear Johnathan,

It could be a good idea, but on the other hand source of problems. I already have some compatibility issues between asdf debian based install and the one LW provides. Here is a sample from LW listener:

Warning: You are using ASDF version 3.3.5
(probably from (require “asdf”) or loaded by quicklisp) and
have an older version of ASDF 3.3.4 registered at
#P"/usr/share/common-lisp/source/cl-asdf/asdf.asd". Having an
ASDF installed and registered is the normal way of configuring
ASDF to upgrade itself, and having an old version registered
is a configuration error. ASDF will ignore this configured
system rather than downgrade itself. In the future, you may
want to either: (a) upgrade this configured ASDF to a newer

anyhow, alexandria is provided in OM:
/openmusic/OPENMUSIC/code/api/foreign-interface/ffi/alexandria/alexandria.asd

I can’t seem to locate cl-utilities, but the mentionned function (split-sequence) is available in OM.

Best
K

Do you mean you have ASDF installed through the package manager (apt / dpkg)? If I may be permitted to say, that sounds like a mistake. Most every Lisp distro comes with ASDF 3, so having an additional, OS-managed version on disk would invite conflicts such as you describe. See if uninstalling cl-asdf clears that error.

Yes; I mentioned it because I thought @apoorbaugh might recognize the name. OpenMusic also includes Screamer! :scream:

cl-utilities, and the other libs I name-dropped, are Quicklisp-installable in an ordinary Lisp distro. Have you used Quicklisp much, Karim?

-J.

Do you mean you have ASDF installed through the package manager (apt / dpkg)? If I may be permitted to say, that sounds like a mistake. Most every Lisp distro comes with ASDF 3, so having an additional, OS-managed version on disk would invite conflicts such as you describe. See if uninstalling cl-asdf clears that error.

No this is no error, just a warning. Just contacted LW support, and they say it is alright if there are no conflicts. I have installed the cl-asdf along with clx, clim and macclim. A while ago (in a very far galaxy :slight_smile: ) I started a port of OM on sbcl. That’s the reason why I have a asdf from Debian. I don’t think that sbcl has asdf automatically installed.

cl-utilities, and the other libs I name-dropped, are Quicklisp-installable in an ordinary Lisp distro. Have you used Quicklisp much, Karim?

No not lately.

Thank you for your feedback and advices.

Best
K

A very worthy goal. How far did you get? May I see?

It might not have in that long-ago galaxy, but it definitely does now.

De rien.

-J.

Thank you all for your input and for sharing some awesome information that I do not think I would have stumbled on myself. I am always appreciative of this great community!

What initially started as a request for function code morphed into performance debugging, and now I have several great posts of resources to look into.

Take care. :slight_smile:

2 Likes

Dear Johnathan,

Concerning the code, it is not in a pleasant state, ie. it is really messy. This was before github happened :slight_smile: So it is somehwere in my archives.
I will take a look on my HDs if i can still find it somewhere.
It was based on OM’s 5.x code using cl-cffi-gtk which is based on gtk2 using also clx.
As I remember it had limited interaction, so i let down trying to find an graphic toolkit for sbcl. Do you have an idea, what should work the best?

Best
K

Not from personal experience, I regret to say. Here’s an overview of the current state of the art. I doubt you’ll find anything which can equal the capabilities of CAPI, in the short term at least. That was a smart choice. I’m curious about McCLIM, which I see is still in active development.

I think the right way to port to SBCL would be to start with the non-graphical bits, like the (omNG-...) funcs.

-J.

1 Like

When i ported OM to Linux I first tried with cl-gtk (and possibly som Tk-bindings?) inside sbcl, based on the work Karim had already done, but giving up after some time. I dont think i want to share that code with anyone.

Of course the main point with OM is its graphical interface and musical editors. There are other good GUI-toolkits for CL, which one could be a good alternative to capi now?

1 Like