Csound Csound-dev Csound-tekno Search About

[Csnd] Looping over oscil?

Date2010-12-16 02:13
FromToby
Subject[Csnd] Looping over oscil?
I was thinking it would be interesting to loop over a call to oscil
using different pan and frequency parameters.  I figured I could
generate the params with linrand and call the same oscil say 100 times.

Then I started looking at the looping structures.  Would I have to use
two loops, one for i-pass and one for k-pass?  Also, would this even
work, or would that one oscil line keep overwriting its state?  Would
a UDO make a difference?

Maybe I should just do this with the score generation program using
100 different events per note.

Thanks,

Tobiah


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-12-16 07:25
Fromjoachim heintz
Subject[Csnd] Re: Looping over oscil?
Attachments100726oscil_comp.csd  
you can use one instrument for triggering multiple instances of  
another instrument. for instance, in this example the amp, freq and  
pan parameters are evaluated new in each loop. it's also possible to  
calculate parameters in the called instrument, like here the peak  
parameter in instr 10:



0dbfs = 1
nchnls = 2
seed 0
gisine ftgen 0, 0, 2^10, 10, 1
instr 1 ;master instrument
ininstr = 10 ;number of called instances
indx = 0
loop:
ipan random 0, 1
ifreq random 100, 1000
iamp = 1/ininstr
event_i "i", 10, 0, p3, iamp, ifreq, ipan
loop_lt indx, 1, ininstr, loop
endin
instr 10
print p4, p5, p6
ipeak random 0, 1 ;where is the envelope peak
asig poscil p4, p5, gisine
aenv transeg 0, p3*ipeak, 6, 1, p3-p3*ipeak, -6, 0
aL, aR pan2 asig*aenv, p6
outs aL, aR
endin


i1 0 10



by the way, i strongly recommend to use poscil instead of oscil. i  
once made a test:

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




if you want to read about the different triggering options, have a  
look at the end of this chapter:
http://booki.flossmanuals.net/csound/_v/1.0/e-triggering-instrument-events/

	joachim


Am 16.12.2010 um 03:13 schrieb Toby:

> I was thinking it would be interesting to loop over a call to oscil
> using different pan and frequency parameters.  I figured I could
> generate the params with linrand and call the same oscil say 100  
> times.
>
> Then I started looking at the looping structures.  Would I have to use
> two loops, one for i-pass and one for k-pass?  Also, would this even
> work, or would that one oscil line keep overwriting its state?  Would
> a UDO make a difference?
>
> Maybe I should just do this with the score generation program using
> 100 different events per note.
>
> Thanks,
>
> Tobiah
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>
>


Date2010-12-16 21:54
FromToby
Subject[Csnd] Re: Re: Looping over oscil?
On 12/15/2010 11:25 PM, joachim heintz wrote:
> you can use one instrument for triggering multiple instances of another
> instrument.

That's pretty cool, but I guess I'll just move that out
into the score generation program.

> for instance, in this example the amp, freq and pan
> parameters are evaluated new in each loop. it's also possible to
> calculate parameters in the called instrument, like here the peak
> parameter in instr 10:
>
> 
> 
> 0dbfs = 1
> nchnls = 2
> seed 0
> gisine ftgen 0, 0, 2^10, 10, 1
> instr 1 ;master instrument
> ininstr = 10 ;number of called instances
> indx = 0
> loop:
> ipan random 0, 1
> ifreq random 100, 1000
> iamp = 1/ininstr
> event_i "i", 10, 0, p3, iamp, ifreq, ipan
> loop_lt indx, 1, ininstr, loop
> endin
> instr 10
> print p4, p5, p6
> ipeak random 0, 1 ;where is the envelope peak
> asig poscil p4, p5, gisine
> aenv transeg 0, p3*ipeak, 6, 1, p3-p3*ipeak, -6, 0
> aL, aR pan2 asig*aenv, p6
> outs aL, aR
> endin
> 
> 
> i1 0 10
> 
> 
>
> by the way, i strongly recommend to use poscil instead of oscil. i once
> made a test:
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>
> if you want to read about the different triggering options, have a look
> at the end of this chapter:
> http://booki.flossmanuals.net/csound/_v/1.0/e-triggering-instrument-events/
>
> joachim
>
>
> Am 16.12.2010 um 03:13 schrieb Toby:
>
>> I was thinking it would be interesting to loop over a call to oscil
>> using different pan and frequency parameters. I figured I could
>> generate the params with linrand and call the same oscil say 100 times.
>>
>> Then I started looking at the looping structures. Would I have to use
>> two loops, one for i-pass and one for k-pass? Also, would this even
>> work, or would that one oscil line keep overwriting its state? Would
>> a UDO make a difference?
>>
>> Maybe I should just do this with the score generation program using
>> 100 different events per note.
>>
>> Thanks,
>>
>> Tobiah
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe csound"
>>
>>
>



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"