apparent problems with if-then-elseif structure
Date | 2016-01-14 16:50 |
From | Karin Daum |
Subject | apparent problems with if-then-elseif structure |
I'm still investigating the performance of the different multichannel panning methods. For this purpose I'm just writing a program which allows me also to visualise the behaviour of the different methods. This is my first program in Csound. Now I realise that something goes wrong with the if-then-else(if) structure in Csound. Below you find a simple test program which shows the effect: |
Date | 2016-01-14 17:02 |
From | Rory Walsh |
Subject | Re: apparent problems with if-then-elseif structure |
Been there, asked that: On 14 January 2016 at 16:50, Karin Daum <karin.daum@desy.de> wrote: I'm still investigating the performance of the different multichannel panning methods. For this purpose I'm just writing a program which allows me also to visualise the behaviour of the different methods. This is my first program in Csound. Now I realise that something goes wrong with the if-then-else(if) structure in Csound. Below you find a simple test program which shows the effect: |
Date | 2016-01-14 17:02 |
From | Steven Yi |
Subject | Re: apparent problems with if-then-elseif structure |
if-then's can be tricky in csound due to rates. The issue here I see is that you are doing a k-rate comparison but also have I-time code. I would suggest doing something like: imethod = i(gkMethod) if imethod == 1 then elseif ... else... endif Typically it's best to always match up the rate of the conditions to each other and to the code within the branches. On Thu, Jan 14, 2016 at 11:50 AM, Karin Daum |
Date | 2016-01-14 17:03 |
From | Rory Walsh |
Subject | Re: apparent problems with if-then-elseif structure |
You can skip my post and just read Istvan's answer. On 14 January 2016 at 17:02, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2016-01-14 17:32 |
From | Karin Daum |
Subject | Re: apparent problems with if-then-elseif structure |
thanks, it’s really tricky when starting with Csound with these different rate
|
Date | 2016-01-14 18:06 |
From | Rory Walsh |
Subject | Re: apparent problems with if-then-elseif structure |
Agreed! I'm still getting caught out with these things many years later ;) On 14 January 2016 at 17:32, Karin Daum <karin.daum@desy.de> wrote:
|