| Try current version of DirectCsound (if you are using a PC) it includes the new score
opcodes '{' and '}' to implement nested loop without any section interruption.
This is the manual:
Syntax:
{ num NN
...... body........
}
Score loops are a very powerful tool. Derived by repeats (r opcode), they allow to define
any parameter,
and the score events inside the loop are not separated by a section termination in each
iteration. So it is
possible to implement overlapping loops. Loops can be nested. The syntax is similar to
that of the repeats:
the macro $NN is incremented in each iteration (notice that, differently from repeats, it
starts with a zero
value); num argument must be set to the number of iterations.
NB: exponential ramp symbol has been changed to '(' or ')' in order to allow curly-brace
characters to be used
for loops.
EXAMPLE:
{ 10 nn
i1 [$nn/2] .5 [$Line(10, $nn , 10000, 4000)] [$Line(10,$nn,440,110)]
{ 5 bb
i1 [$nn/2+$bb/10] .1 [(1+$nn/4)*$Line(10 , $bb, 2000, 500)] [$Line(10,
$bb, 400, 600)]
}
}
SONICMAN wrote:
>
> How would I have a line in a score repeat say 10, 20, 30 times? or
> infinitely? what is the command?
>
> Also is there a random command that works in scores?
>
> Thanks,
> Marcus
--
Gabriel Maldonado
|