< Back to IRCAM Forum

"rewrite" the patch into the "new buffer" window

Hi everyone, I have a patch with a simple algorithm in it. I would like to have the algorithm in the form of a “function” (object) that could be inserted into the workspace, such as the “om+” addition function. I assume that I need to write the “function” in The Lisp Editor. Is there a tutorial on how to “rewrite” the patch into the “new buffer” window?

Dear Perth,

You can find some existing documentation. reagrding this topic here:

And here:

Best
K

Hi Karim, thank you, yes, I am familiar with these tutorials. However, I would like to learn more about the LISP dialect used by OM. Could you please recommend some relevant literature or tutorials?

I also encountered a bizarre/trivial problem. I have a list, for example (1 2 3 4 3 2 5), and I need to list all the elements that appear more than once in it. The output should look like this: (2 3). I solve this by always comparing two neighboring elements using the “MEMBER” function, but there is nothing to compare the last member of the list with (there is no before-last and last, there is only last). Therefore, the result is “nil” and then the rest of the algorithm stops working. It would be enough for me to be able to write “if NIL” then end the iteration and display only what you did before NIL appeared. Is there such a solution? Thank you very much, Petr

Dear Petr,

OM uses Common Lisp which most of it can be applied in OM’s programming. here a practical book to start with (you can read it online):

https://gigamonkeys.com/book/

And here is the Common Lisp “bible” (not really recommended to begin with but essential to consult when in doubt):

For specific OM programming you can consult the Dev documentation here (or ask me:-):

Now for your problem, i just took this from the web and adapt it in OM:

here is the folder with the OMlisp function and patch:

dups.zip (1.7 KB)

Best regards
K

Hi Karim, thank you very much for the excellent information. I just have a problem with the patch you sent me. The evaluation is having problems, see prinscr. At the same time, the function object has two inputs. What goes in the second one?

I have been using OM for about 10 years, I am also involved in CAC as a musicologist, I use OM for analysis, etc., but I have never written any functions. I will now try to take the next step in mastering the OM language. That is why I am thinking about Mac OS (I have been working on a Windows machine so far). Question: from the perspective of using OM, is there a difference between Mac Pro and Mac Air?
Have a nice day, P-

Dear Petr,

Of course, i am sorry. This was a recursive function, therefore will not work as a lambda function.

Try this:
dups1.zip (1.5 KB)

Got it from here:

http://www.lispology.com/show?4L2E

Now concerning hardware, i cannot really give you great advise. What i know of, is that Mac Pro are more expensive as Mac Air, and the last one i believe (not sure) are discontinued.
However my advise will be this:
if you intent to spend money on a Mac, get yourself an ARM (M1-2-3…) and not an intelm since Apple next OS release will be only comnpatible with The first ones ARM (M1 2 3 4etc…)

You have a also another alternative, that i will advise, if you are familiar with computers, and that is to install a linux along your windows. I personally work and develop on Linux. I use Debian, and this since sometime now. Never was let down. Its free stable and safe.

Best regards

k

Dear Karim, thank you very much for your help and advice, as well as for the link to lispology.com. I was on vacation with my family and didn’t have time for OM. Now I would like to ask one more thing. How could duplicates be printed using objects from the OM menu?

And regarding MAC and Linux. I have been in IRCAM several times (always at PRISMA group meetings) and everyone I spoke to used MAC. I know that the first IRCAM CAC applications such as Crime, Esquisse, etc. were for MAC, and this established a tradition of using Mac for CAC. Based on reports from the IRCAM forum, it seems that OM is primarily for Mac and works with certain limitations on Win or Ubuntu. Or am I wrong? Or is Debian an exception? (Surely it is if you work on it).

I’ve never had the opportunity to verify this, so I’m asking again.

Thank you for the opportunity to communicate, and best regards,

Petr

Dear Petr,

Sorry didn’t get exactly what you are asking here:
What do you mean printed from the OM menu? Do you mean printing the result to a printer?

Now concerning operating systems:

The fact that many users are working on Apple Computers is the fact that in the 80’s it was a solution beside using DEC and IBM main frames that were not personal computers.
Now fortunately we have the computing power way beyond that.
Now concerning on “reports from the IRCAM forum”, well i won’t rely on that. Linux operating system runs servers, are safe security wise and very efficient in computing.
Now concerning OM, it runs great on most Linux distributions. (By the way Ubuntu IS a Debian based distribution). The choice of the OS is just personal and relies on what really you want to do. For developing, and personally for work, i will choose without any doubt Linux. It’s free, secure and very efficient. the only issue is to like most PC, you have to know how to use is and this for all OSes.

Best
K

Dear Karim, good evening. I apologize for my poor explanation regarding duplicates. I received a patch from you that can “write out” (I think the correct term is “print”) duplicates from a list. Thank you again for it. I was wondering how it is possible to express its algorithm visually, i.e. using “boxes” and “objects” etc. (I apologize for my clumsy terminology).

And with regard to OS, there is no objective reason to spend money on a MAC in order to use OM. This also applies in cases where the OM user is not familiar with computers and is only a PC user. Is that correct?

Have a nice evening. P-