Csound Csound-dev Csound-tekno Search About

Re: Repeat command in score (NOT section-wise)

Date1999-04-30 17:07
FromGabriel Maldonado
SubjectRe: Repeat command in score (NOT section-wise)
The following stuff is already implemented in DirectCsound:


SCORE LOOPS 

{ - start of a loop 

} - end of a loop 

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)]
        }
}



-- 
Gabriel Maldonado

http://www.agora.stm.it/G.Maldonado/home2.htm



Anders Andersson wrote:
> 
> Hello dear audience! (And ffitch especially..)
> 
> Would it be hard to code a repeat opcode that's not bounded to repeat
> sections, like:
> 
> r4
> i31417 0 1 ; Find the hidden message! (I'm shure f1f0@m9ndfukc can =;p)
> i. +
> i.
> i.
> r0
> 
> It would be *VERY* appreciated, and useful!
> 
> As I've mentioned once before on this list, I don't like working with
> external tools, but prefer to code the score by hand, but as it lacks this
> feature it could be quite tedious sometimes!
> If this one thing get's implemented, it would almost be a joy to work with
> the score! =)
> 
> Things got MUCH better with the macro, [x+y] and include statements, It's
> just this simple thing left! (And a couple of others, like not having to
> set brackets around calculations and stuff..)
> 
> (The thing is that if one want's to have a specific thing repeated now, you
> can't have for example a global reverb running across the sections, not in
> a way I know of..)
> 
> I just came up with a crazy idea here..
> How about totally rewriting the score parsing, and....
> .. nah ..  :)
>