Csound Csound-dev Csound-tekno Search About

[Cs-dev] if-then new parser bug (fixed?)

Date2011-11-14 22:36
FromTito Latini
Subject[Cs-dev] if-then new parser bug (fixed?)
AttachmentsNone  

Date2011-11-15 23:04
FromVictor Lazzarini
SubjectRe: [Cs-dev] if-then new parser bug (fixed?)
I think John has fixed this last week as we were discussing this  
problem on irc. We'll check.
On 14 Nov 2011, at 22:36, Tito Latini wrote:

> Hi All, there is a little bug with if-then (perhaps fixed).
> `else' works well, the problem is `then'. The example of the `else'
> opcode in the manual fails when p5 is zero.
>
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
> instr 1
> ipch = cpspch(p4)
> ienv = p5
>
> if (ienv == 0) then
>        kenv adsr 0.01, 0.95, .7, .5
> else
>        kenv linseg 0, p3 * .5, 1, p3 * .5, 0
> endif
>
> aout vco2    .8, ipch, 10
> aout moogvcf aout, ipch + (kenv * 6 * ipch) , .5
> aout = aout * kenv
>    outs aout, aout
> endin
> 
> 
> i 1 0 2 8.00 0
> i 1 3 2 8.00 1
> 
> 
>
>
> Tested with Csound 5.14.2 (git  
> 6363fec367fb5258e78ec6a6e1ef2b7b820be2b4)
>
> uname -a
> Linux pantera 2.6.33.7.2-rt30 #2 SMP PREEMPT RT Mon Oct 24 12:33:25
> CEST 2011 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD  
> GNU/Linux
>
> csound -d else.csd
> ...
> ********************
> * USING NEW PARSER *
> ********************
> END OF INPUT
> ...
> new alloc for instr 1:
>
> INIT ERROR: linseg not initialised (krate)
>
> Early return from csoundPerform().
> ...
>
>
> It seems a linseg bug, but the appearance deceives. I have tried
> different combinations. Besides, this score section works:
>
>  
>  i 1 0 2 8.00 1
>  i 1 3 2 8.00 1
>  
>
> The error is in the `gotoType' variable (csound_orc_expressions.c: 
> 811).
>
>  gotoType = (argtyp2(csound, last->left->value->lexeme) == 'B') ||
>             (argtyp2(csound, tempRight->value->lexeme) == 'k');
>
> that results zero. I don't know if `tempRight->value->lexeme' works
> well (tomorrow I try to see), for now I use the following substitution
>
> diff -d csound_orc_expressions.c{~,}
> 827c827
> <                   int type = (gotoType == 1) ? 0 : 1;
> ---
>>                  int type = (gotoType == 0) ? 0 : 1;  /* or  
>> 'gotoType & 1' */
>
>
> (memo for type: 0 -> "kgoto", 1 -> "igoto")
>
>
> tito
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net