Csound Csound-dev Csound-tekno Search About

repeating sections in a score..

Date2007-10-21 21:07
FromRory Walsh
Subjectrepeating sections in a score..
I'm teaching Csound to undergrads this semester and they keep asking how 
to repeat a section without copying and pasting hundreds of times. I 
know about r statements but they don't let you play other i-statements 
until they finish. Generally what most of the students want to do is to 
lay down a drum beat first and then put down other things on top of 
that, for instance

r100; repeat for duration of track
backing track....
s

i"bass" 10 10;bass comes in after 10 seconds

I rarely use Csound scores for much, is there a way to do this?

Rory.



Date2007-10-21 21:18
Fromjpff
SubjectRe: repeating sections in a score..

On Sun, 21 Oct 2007, Rory Walsh wrote:

> I'm teaching Csound to undergrads this semester and they keep asking how to
> repeat a section without copying and pasting hundreds of times. I know about r
> statements but they don't let you play other i-statements until they finish.
> Generally what most of the students want to do is to lay down a drum beat
> first and then put down other things on top of that, for instance
> 
> r100; repeat for duration of track
> backing track....
> s
> 

the event stuff is eadier for a basic riff
Or use of #include and b works for fewer repeats

==John ff

Date2007-10-21 22:12
FromRory Walsh
SubjectRe: repeating sections in a score..
Thanks John, I didn't know about b.

Rory.


jpff wrote:
> 
> On Sun, 21 Oct 2007, Rory Walsh wrote:
> 
>> I'm teaching Csound to undergrads this semester and they keep asking how to
>> repeat a section without copying and pasting hundreds of times. I know about r
>> statements but they don't let you play other i-statements until they finish.
>> Generally what most of the students want to do is to lay down a drum beat
>> first and then put down other things on top of that, for instance
>>
>> r100; repeat for duration of track
>> backing track....
>> s
>>
> 
> the event stuff is eadier for a basic riff
> Or use of #include and b works for fewer repeats
> 
> ==John ff
> 

Date2007-10-22 22:56
FromCesare Marilungo
SubjectRe: repeating sections in a score..
jpff wrote:
> On Sun, 21 Oct 2007, Rory Walsh wrote:
>
>   
>> I'm teaching Csound to undergrads this semester and they keep asking how to
>> repeat a section without copying and pasting hundreds of times. I know about r
>> statements but they don't let you play other i-statements until they finish.
>> Generally what most of the students want to do is to lay down a drum beat
>> first and then put down other things on top of that, for instance
>>
>> r100; repeat for duration of track
>> backing track....
>> s
>>
>>     
>
> the event stuff is eadier for a basic riff
> Or use of #include and b works for fewer repeats
>
> ==John ff
>
>   


Not sure if this would be helpful to you, but to define and then recall 
sections you can also use score macros:

http://www.csounds.com/manual/html/ScoreMacros.html

This wouldn't help much if you want to repeat a single section for an 
entire track but it is still useful to write a piece using patterns.

You can define a macro of several lines. You can also pass arguments to 
them (like the starting time):

; the macro defining the riff/loop/whatever
#define LOOP1(T) #
i1   [$T+0]   1   8.00   10000
i1   [$T+1]   .   .   .
i1   [$T+2]   .   .   .
i1   [$T+4]   .   .   .
#

; a macro calling the macro above 4 times
#define LOOPX4(T) #
$LOOP1($T)
$LOOP1([$T+4])
$LOOP1([$T+8])
$LOOP1([$T+12])
#

;and so on
$LOOPX4(0)
$LOOPX4(16)
$LOOPX4(32)
$LOOPX4(48)

Am I abusing macros, John?

-c.

-- 
www.cesaremarilungo.com 

Date2007-10-23 00:36
FromRory Walsh
SubjectRe: repeating sections in a score..
Thanks Cesare, I just gave a class on this, pretty powerful stuff. 
Thanks for the examples, no doubt I will use them at some stage. In 5 or 
6 years of using Csound I've never explored the score language much, 
it's always been live stuff with me.

Rory.


Cesare Marilungo wrote:
> jpff wrote:
>> On Sun, 21 Oct 2007, Rory Walsh wrote:
>>
>>  
>>> I'm teaching Csound to undergrads this semester and they keep asking 
>>> how to
>>> repeat a section without copying and pasting hundreds of times. I 
>>> know about r
>>> statements but they don't let you play other i-statements until they 
>>> finish.
>>> Generally what most of the students want to do is to lay down a drum 
>>> beat
>>> first and then put down other things on top of that, for instance
>>>
>>> r100; repeat for duration of track
>>> backing track....
>>> s
>>>
>>>     
>>
>> the event stuff is eadier for a basic riff
>> Or use of #include and b works for fewer repeats
>>
>> ==John ff
>>
>>   
> 
> 
> Not sure if this would be helpful to you, but to define and then recall 
> sections you can also use score macros:
> 
> http://www.csounds.com/manual/html/ScoreMacros.html
> 
> This wouldn't help much if you want to repeat a single section for an 
> entire track but it is still useful to write a piece using patterns.
> 
> You can define a macro of several lines. You can also pass arguments to 
> them (like the starting time):
> 
> ; the macro defining the riff/loop/whatever
> #define LOOP1(T) #
> i1   [$T+0]   1   8.00   10000
> i1   [$T+1]   .   .   .
> i1   [$T+2]   .   .   .
> i1   [$T+4]   .   .   .
> #
> 
> ; a macro calling the macro above 4 times
> #define LOOPX4(T) #
> $LOOP1($T)
> $LOOP1([$T+4])
> $LOOP1([$T+8])
> $LOOP1([$T+12])
> #
> 
> ;and so on
> $LOOPX4(0)
> $LOOPX4(16)
> $LOOPX4(32)
> $LOOPX4(48)
> 
> Am I abusing macros, John?
> 
> -c.
>