Hi All,
I am trying to resolve a specific poblem, but I can not find out the right Lisp code to do it, so any help will be appreciated, thanks in advance.
My problem is the following: given a whatever series of pitches, I want to randomly transpose some of them to superior octave, and then repeat the cycle until all pitches are in the superior octave.
i have set the code for random transposition:
(lambda (series)
(loop for i in (flat series) collect
(om::omif
(and
(< i (om::om+ 1200 (om::list-max series)))
(> i (om::list-min series)))
(om::om+ i (om:nth-random '(0 1200)))
i))
)
and tried to use it inside an iterative process:
(lambda (series)
(flat
(loop for i = series
while (equal (om::list-min i) (om::list-min series))
do (loop for k in (flat i) collect
(om::omif
(and
(< k (om::om+ 1200 (om::list-max series)))
(> k (om::list-min series)))
(om::om+ k (om:nth-random '(0 1200)))
k))
collect i))
)
but OpenMusic go into an infinite loop. Or, in another attempt woith different code, it transposes also more than one octave high the already transposed pitches.
I have looked for useful examples in some LISP book, but I can not arrive to a solution.
Many thanks in advance, ciao
Fabio