[Csnd] conditional question
Date | 2012-08-22 01:22 |
From | peiman khosravi |
Subject | [Csnd] conditional question |
Hello, Is it not possible to combine k and i variables together in a conditional? Like this: if (kplay==idur) then turnoff endif The conditional seems to work at i-rate only. But if I change "idur" to a straight number it works as expected. Is this normal?
Thanks Peiman |
Date | 2012-08-22 02:02 |
From | Jim Aikin |
Subject | [Csnd] Re: conditional question |
I imagine it's normal ... but there's an easy workaround: kdur init idur if (kplay == kdur) then -- View this message in context: http://csound.1045644.n5.nabble.com/conditional-question-tp5715059p5715060.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-08-22 02:05 |
From | peiman khosravi |
Subject | [Csnd] Re: conditional question |
Attachments | test2.csd |
I'm sure I'm missing something but in the csd attached I'm the "test" button (in CsoundQT) to turn on after 5 secs but it comes on straight away. Thanks Peiman
On 22 August 2012 01:22, peiman khosravi <peimankhosravi@gmail.com> wrote: Hello, |
Date | 2012-08-22 02:29 |
From | peiman khosravi |
Subject | [Csnd] Re: conditional question |
Thanks Jim, I'll give this a go tomorrow. Best, Peiman On 22 August 2012 02:05, peiman khosravi <peimankhosravi@gmail.com> wrote: I'm sure I'm missing something but in the csd attached I'm the "test" button (in CsoundQT) to turn on after 5 secs but it comes on straight away. |
Date | 2012-08-22 05:06 |
From | Andres Cabrera |
Subject | Re: [Csnd] Re: conditional question |
Attachments | test.csd |
Hi Peiman, Here's one way it works. The main issue is that outvalue is a bit of an odd opcode as it sends a value both at init and every control block, so when the opcode is initialized it will send the value, which will happen always for k-rate conditionals! The other issue is that the value will never be exactly 1, so I've made a quick fix. Not ideal, but works here... Cheers, Andres On 8/21/12, peiman khosravi |
Date | 2012-08-22 09:45 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: conditional question |
Thanks Andres, That's great. Just as you think you know all the basic stuff you find out how much you don't know! Cheers, Peiman On 22 August 2012 05:06, Andres Cabrera <mantaraya36@gmail.com> wrote: Hi Peiman, |
Date | 2012-08-22 10:46 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: conditional question |
Attachments | readStereoAudioFile_3.csd |
This seems to be working nicely. I would like to simply it if possible but it works! Best, Peiman On 22 August 2012 09:45, peiman khosravi <peimankhosravi@gmail.com> wrote: Thanks Andres, |