Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 12 hours, 37 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

Growing lists in OMLoop

Author 3 Subscribed Users |
Profile photo of dgeers
dgeers

Dear OM users,

After years away from OM, I returned recently and am having problems with omloop.  In particular, I am not sure how I can use it to repeatedly add to and alter a list via an iterative function.

For instance, if I would want to randomly choose a subset of consecutive notes from of a list of notes and append them to the original list, and then do this many times, with the ability to choose anything from the newest and longest version of the list each time, over and over again.  In other words, upon each iteration the algorithm would be able to choose from the entire collected list thus far.  The “collect” object seems interesting here, but I don’t think it is the solution, is it?

I am also interested to get all iterations of the collect object to output to the patch.  In the tutorials they print this to the Listener, but how can one return it to the patch itself?

In general, any examples related to these concepts would be extremely welcome.

Thanks much,

Doug

April 8, 2013 at 19:06 #4498
Profile photo of ruben_gjertsen
ruben_gjertsen

Hello,

 

I have 2 recursion examples, both using a lambda path with 2 inputs (current/previous number/list). The first example combines accum and collect to save each step in the calculation, with 3 sublists as input. Built this on something I found in the tutorials.

Best,

Ruben

 

 

 

 

 

 

Attachments:
  1. RecursionExample

    RecursionExample.tiff

  2. RecursionWithoutCollect

    RecursionWithoutCollect.tiff

  3. InsideLambda

    InsideLambda.tiff

April 8, 2013 at 20:51 #4554
Profile photo of Karim
Karim

Dear Doug,

 

Can you give us a textual example even if it is short, like

orig list -> (1 2 3 4)

random list (15 6 7)

etc…

K

April 8, 2013 at 21:39 #4559
Profile photo of dgeers
dgeers

Thanks, Ruben and Karim, for your replies.

I had thought to use recursion but wasn’t sure how to structure it.  Ruben, your patches give me an idea of how to start.  That is great.

However I’d love any input from Karim too, who I know is an OM master.  Here is an example of what I might want to do:

1. Begin with a list of melodic motives strung together as a unit, such as for a simple example ((6700 7200 7300 7700) (5900 6400 6500 7100) (7200 6600 6800 7200 6600 6800) (7300 8000 7100 7800)).  (Another algorithm would map these to rhythms.)

2. After this initial unit happens once, it will recur with at least one but possibly two or more consecutive melodic cells appended once more.  For the moment, this could be chosen at random.

3. Now this longer list would recur, with again one or more consecutive elements of it appended, possibly the material just previously appended.

4. This process would repeat numerous times to create a long melodic string.  After that is created, selected motives or groups of them would be additionally transformed or selectively deleted.  (The latter can be ignored for now, since it would treat the completed string.)

Thanks again for any input,

Doug

April 9, 2013 at 00:13 #4560
Profile photo of ruben_gjertsen
ruben_gjertsen

Hi Doug,

Testing this out of curiousity. Do these patches do what you had in mind? I’m not sure you need the recursion just to repeat and append elements. It could be developed further, of course.

Best,

Ruben

 

Attachments:
  1. Doug-motive

    Doug-motive.tiff

  2. Recursive-motive

    Recursive-motive.tiff

  3. Inside-lambda

    Inside-lambda.tiff

April 9, 2013 at 15:41 #4571
Profile photo of dgeers
dgeers

Ruben,

Thanks for your suggestions.  Between your patches and some more reading of the manual and tutorials, I’ve made progress in my work.  It isn’t exactly what I want yet, but much closer.

Best wishes,

Doug

April 17, 2013 at 00:50 #4627
Profile photo of Karim
Karim

Dear Doug,

 

I don’t understand very well your problem. Sorry. If it is just appending a permutated list of the same melody, just use this :

see pict 1

(considering (1 2 3 4) are a sequence of melodic groups.)

 

Now if you want to append other stuff, please do forward an example with only integers first in order that i can understand what you want to do .

Sometimes the answer is pretty simple.

 

best

K

Attachments:
  1. Screen-Shot-2013-04-17-at-12.11.19

    Screen-Shot-2013-04-17-at-12.11.19.png

April 17, 2013 at 11:13 #4633

You must be logged in to reply to this topic.

Log in now