| I'm finding it hard to follow the logic of your code but the following
will do what you want(untested):
k1 metro 1
kTrig changed k1
kRand random 0, 100
if kTrig == 1 then
printks "Random Value:%d", 0, kRand
endif
or with Csound6
if metro(1)==1 then
printks "Random Value:%d", 0, random:k(0, 100)
endif
On 9 May 2014 20:28, Askwazzup wrote:
> instr 2
>
> ktrig metro 1
> kcount init 1
> kcount = kcount + ktrig
> kcount2 init 1
>
> loop:
> gkamp random 0, 100
> kcount2 += 1
> if kcount2 < kcount then
> goto loop
> endif
>
> endin
>
> Hello!
>
> I'm trying to make an instrument (experimenting actually) that generates a
> random value every time the metro opcode ticks, however i suspect that there
> is a logic problem in the if function, thus the loop gets stuck. I am sure
> that there are a million ways of doing this in a much simpler fashion, but
> i'm also interested to find out why this one doesn't work.
>
> Would appreciate some help.
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Loop-problem-tp5735064.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>
|