hey, thanks for your help.
its working fine.
i also came across the pattern solution, but i have something else in mind:
the array is a collection of durations as a result of an l-system.
i would like to create a dictionary which contains different abstractions of this duration l-system pattern, ordered by their rythmic density, which i then can acces later via Pdef. so slicing the l-system pattern to a specific length of 4 or 8 was only the first step.
an example:
0: [8]
1: [4,4]
2: [4,2,2]
3: [3,1,2,2] <-- possible pattern from the l-system
4: [2,1,1,2,2]
5: [2,1,1,2,1,1]
6: [2,1,1,1,1,1,1]
7: [1,1,1,1,1,1,1,1]
to create the abstractions i would like to go with the following ideas from renick bell:
create the patterns of lesser density:
when reducing density, an item from the pattern is chosen at random and combined with a neighbour value to yield a similiar pattern of reduced density. this process is repeated until the list contains only one single item. in the example above 0:[8].
create the patterns of higher density:
when increasing density an item is randomly chosen and replaced with two items: an item of lesser value from the list of potential IOIs and the difference between the original IOI value and the lesser value. this is repeated until all the items in the pattern are the smallest of the potential IOIs. in the example above 7: [1,1,1,1,1,1,1,1].
*** UPDATE ***
i have deleted the other posts and will post my current upcommings with specific questions below to make it more clear. Im sorry for the confusion.