| hello,
use event instead of event_i - the latter is executed only in the init pass of
instr 1 and it makes no sense to put into if k-variable condition (since it
it will be executed after init)
event is k-time opcode, event_i i-time.
or use schedkwhen and you can use kans as trigger (sorry I don't have manual
at hand to explain closer, please check out the corrects syntax for schedkwhen
yourself)
greetings,
tarmo
On Thursday 15 March 2012 02:51:53 zappfinger wrote:
> Hi,
>
> In the following code, why does instrument 2 only gets triggered once?
>
> Richard
>
>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giSine ftgen 0, 0, 2^10, 10, 1
> giosc1 OSCinit 9000
>
> turnon 1
>
>
> instr 1
> kval init 0.0
>
> kans OSClisten giosc1, "/freq", "f", kval
> if kans == 1 then
> printk 1,kval
> aSnd oscil 1, kval, giSine
> outs aSnd, aSnd
> event_i "i", 2, 0, .25, i(kval) ;call instr 2
> ;printk 1,kval
> endif
> endin
>
> instr 2;
> printk 1, p4
> aSnd oscil 1, p4, giSine
> outs aSnd, aSnd
> endin
>
>
>
>
> e 300
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/OSC-and-event-i-tp5567496p5567496.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
|