< Back to IRCAM Forum

Sorting Algorithms in OM

I’m currently trying to implement sorting algorithms in OM, so that an unsorted list of integers can be sorted into the correct order but each ‘pass’ is printed. I’ve tried copying some Common LISP code but I don’t have any understanding of it and haven’t been able to get it to work so far.

There is an old thread on this where another user was trying to do the same thing with a Bubble Sort, but the OM patch in the thread isn’t opening. I’m relatively new to OM so any pointers would be greatly appreciated!

Hi hbell25,

first of all, concerning the ‘bubblesort’ zip archive you found in the old thread:
it is composed by two files:

  • .lisp and .omp
    the .lisp file, should be loaded as a lisp file ie, you open it using open FROM the listener, then you evaluate the code with ctr/cmmd y
    OR you just put it in your init folder (inside OM app) and launch OM so the code will be loaded.
    The .omp file IS the patch. so, next you import it and the function should be available now.

Now concerning the first issue, If you need to implement some algorithms in om, I advise you to read this first:

Now if you need what i think you are looking for, maybe this will come handy:

The patch:
Patch 4.omp (5.9 KB)

Best
K

This is absolutely perfect, thank you!