Csound Csound-dev Csound-tekno Search About

Re: [Csnd] if/elseif or assignment problem

Date2011-02-11 21:35
From"Partev Barr Sarkissian"
SubjectRe: [Csnd] if/elseif or assignment problem
There's a great bit about this in a early chapter 
of "The Audio Programming Book" about "if / else" statements. 
Just reading about that couple days ago.

Isn't there supposed to be an "else, else" just before 
the "endif"???

-Partev


==================================================================


--- julien@c-lab.de wrote:

From: Julien Claassen 
To: csound mailing list 
Subject: [Csnd] if/elseif or assignment problem
Date: Fri, 11 Feb 2011 22:10:23 +0100 (CET)

Hello everyone!
   whatever can be wrong with this instrument. It's short and to my eyes it 
looks to the book:
sr = 48000
ksmps = 16
nchnls = 2

massign 1, 1
instr 1
 	kt init 0 ; tried this in and out...
 	kf midictrl 105 ; get the pushbutton with discrete values
 	if (kf == 0) then
 		kt init 1
 	elseif kf == 26) then
 		kt init 2
 	elseif (kf == 51) then
 		kt init 3
 	endif
 	a1 oscil 20000, 440*kt, 1
 	outs a1, a1
endin

   It gives me a cryptic error about line 10. Is there a way to make the new 
csound parser give more helpful output? I mean, helpful to the unsuspecting 
user and not the parser interested person? :-)
   Kindly yours
         Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net
the Linux TextBased Studio guide
======= AND MY PERSONAL PAGES AT: =======
http://www.juliencoder.de


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"





_____________________________________________________________
Netscape.  Just the Net You Need.


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"

Date2011-02-11 22:35
FromJulien Claassen
SubjectRe: [Csnd] if/elseif or assignment problem
Hello Partev!
   No, not as far as I know. Anyway, I got it working with one example, without 
the elseif. And even the elseif.csd example from the manual, doesn't show it. 
It istn't necessary structurally, since you always "close" an if-statment with 
an endif. That much for the language point of view.
   Warm regards
            Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net
the Linux TextBased Studio guide
======= AND MY PERSONAL PAGES AT: =======
http://www.juliencoder.de


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"

Date2011-02-11 22:37
Frompeiman khosravi
SubjectRe: [Csnd] if/elseif or assignment problem
This is the problem:

       elseif kf == 26) then

P

On 11 February 2011 22:35, Partev Barr Sarkissian
 wrote:
> There's a great bit about this in a early chapter
> of "The Audio Programming Book" about "if / else" statements.
> Just reading about that couple days ago.
>
> Isn't there supposed to be an "else, else" just before
> the "endif"???
>
> -Partev
>
>
> ==================================================================
>
>
> --- julien@c-lab.de wrote:
>
> From: Julien Claassen 
> To: csound mailing list 
> Subject: [Csnd] if/elseif or assignment problem
> Date: Fri, 11 Feb 2011 22:10:23 +0100 (CET)
>
> Hello everyone!
>   whatever can be wrong with this instrument. It's short and to my eyes it
> looks to the book:
> sr = 48000
> ksmps = 16
> nchnls = 2
>
> massign 1, 1
> instr 1
>        kt init 0 ; tried this in and out...
>        kf midictrl 105 ; get the pushbutton with discrete values
>        if (kf == 0) then
>                kt init 1
>        elseif kf == 26) then
>                kt init 2
>        elseif (kf == 51) then
>                kt init 3
>        endif
>        a1 oscil 20000, 440*kt, 1
>        outs a1, a1
> endin
>
>   It gives me a cryptic error about line 10. Is there a way to make the new
> csound parser give more helpful output? I mean, helpful to the unsuspecting
> user and not the parser interested person? :-)
>   Kindly yours
>         Julien
>
> --------
> Music was my first love and it will be my last (John Miles)
>
> ======== FIND MY WEB-PROJECT AT: ========
> http://ltsb.sourceforge.net
> the Linux TextBased Studio guide
> ======= AND MY PERSONAL PAGES AT: =======
> http://www.juliencoder.de
>
>
> 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"
>
>
>
>
>
> _____________________________________________________________
> Netscape.  Just the Net You Need.
>
>
> 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"