Csound Csound-dev Csound-tekno Search About

[Cs-dev] Patch to make xscanu/xscans work again

Date2007-01-14 03:49
Fromdark141@gmail.com
Subject[Cs-dev] Patch to make xscanu/xscans work again
AttachmentsNone  

Date2007-01-14 04:32
From"Dr. Richard Boulanger"
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
Very excited to see these fixes in there!!!! Thanks so much for  
making them.

Dr. B.


On Jan 13, 2007, at 10:49 PM, dark141@gmail.com wrote:

> changes:
>
> - fix broken detection of string parameter for ifnstif parameter  
> (i.e. the
> filename of the connection matrix)
>
> - handle connection matrix files in CRLF format as well as LF format
>
> - scsnux_initw now initialises x0 (and x2) as well as x1.  this  
> causes correct
> initialisation of the mass displacements, (i.e. as per the manual
> description) when init > 0.   without this, this present initiation  
> of x1
> will simply be lost on the first iteration.
>
> (if there is a better procedure for submitting patches, please  
> point me to it)
>
> cheers,
> lily.
>
> --- csound5/Opcodes/scansynx.c	2005-12-28 00:07:02.000000000 +1300
> +++ ../Csound5.04/Opcodes/scansynx.c	2007-01-14 16:29:36.000000000  
> +1300
> @@ -91,8 +91,11 @@
>      }
>      if (fi->flen != len)
>        csound->Die(csound, Str("scanux: Init table has bad size"));
> -    for (i = 0 ; i != len ; i++)
> +    for (i = 0 ; i != len ; i++) {
> +      p->x0[i] = fi->ftable[i];
>        p->x1[i] = fi->ftable[i];
> +      p->x2[i] = fi->ftable[i];
> +    }
>      return OK;
>  }
>
> @@ -273,7 +276,7 @@
>      p->d = f->ftable;
>
>      /* Spring stiffness */
> -    if (*p->i_f != SSTRCOD) {
> +    if (!p->XSTRCODE) {
>        int j, ilen;
>
>        /* Get the table */
> @@ -325,18 +328,28 @@
>          return csound->InitError(csound, Str("SCANU cannot load %s"),
> filnam);
>        }
>        else {
> -#define MATRIX "\n"
> -#define MATLEN (sizeof(MATRIX)-1)
> -#define NMATRIX "\n"
> -#define NMATLEN (sizeof(NMATRIX)-1)
> +#define MATRIXLF "\n"
> +#define MATLENLF (sizeof(MATRIXLF)-1)
> +#define MATRIXCRLF "\r\n"
> +#define MATLENCRLF (sizeof(MATRIXCRLF)-1)
> +#define NMATRIXLF "\n"
> +#define NMATLENLF (sizeof(NMATRIXLF)-1)
> +#define NMATRIXCRLF "\r\n"
> +#define NMATLENCRLF (sizeof(NMATRIXCRLF)-1)
>          int j;
>          char *pp = mfp->beginp;
> -        if ((i=strncmp(pp, MATRIX, MATLEN))) {
> +        if ((i=strncmp(pp, MATRIXLF, MATLENLF))==0) {
> +          pp += MATLENLF;
> +        }
> +        else if ((i=strncmp(pp, MATRIXCRLF, MATLENCRLF))==0) {
> +          pp += MATLENCRLF;
> +        }
> +        else {
>            csound->Message(csound, "%d: Looking for (%ld)%s Found %. 
> 12s\n",
> -                                  i, (long) MATLEN, MATRIX, pp);
> +                                  i, (long) MATLENLF, MATRIXLF, pp);
>            return csound->InitError(csound, "Not a valid matrix");
>          }
> -        else pp += MATLEN;
> +
>  #ifdef USING_CHAR
>          csound->AuxAlloc(csound, len*len * sizeof(char), &p->aux_f);
>          p->f = (char*)p->aux_f.auxp;
> @@ -346,7 +359,8 @@
>          p->f = (unsigned long*)p->aux_f.auxp;
>  #endif
>          while (pp < mfp->endp) {
> -          if (strncmp(pp, NMATRIX, NMATLEN)==0) break;
> +          if (strncmp(pp, NMATRIXLF, NMATLENLF)==0) break;
> +          if (strncmp(pp, NMATRIXCRLF, NMATLENCRLF)==0) break;
>            if (2 != sscanf(pp, "%d %d", &i, &j)) break;
>  #ifdef USING_CHAR
>            p->f[i*len+j] = 1;
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-01-14 05:12
From"David Akbari"
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
AttachmentsNone  

Date2007-01-15 06:31
Fromjpff
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
Is there any reason why these changes are not needed in scansyn as
well?

==John ffitch

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-01-15 06:46
Fromdark141@gmail.com
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
AttachmentsNone  

Date2007-01-15 13:48
From"Dr. Richard Boulanger"
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
they probably are needed there too.

-dB

On Jan 15, 2007, at 1:31 AM, jpff wrote:

> Is there any reason why these changes are not needed in scansyn as
> well?
>
> ==John ffitch
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-01-15 13:50
From"Dr. Richard Boulanger"
SubjectRe: [Cs-dev] Patch to make xscanu/xscans work again
any improvements or extensions to the scanned opcodes are especially  
interesting to me and my students at Berklee.
Thanks for focusing on them.

-dr.B.

On Jan 15, 2007, at 1:46 AM, dark141@gmail.com wrote:

> On Monday 15 January 2007 19:31, jpff wrote:
>> Is there any reason why these changes are not needed in scansyn as
>> well?
>>
>> ==John ffitch
>
> the assignment to x0 and x2 in the initw function could (and IMO  
> should)
> certainly be applied.  however it might subtly change the sound of the
> output. it depends if you favour exact backward compatibility vs.  
> following
> the manual specification...
>
> the other two changes were particular to the functionality of  
> xscanu of
> reading directly from a connection matrix file.
>
> there's also another bug i'm currently chasing in both scans and  
> xscans where
> interpolations greater than linear cause periodic glitches in the  
> output.  i
> don't have a fix for this yet.
>
> i'm very glad that this project is receptive to patches at all.   
> unlike gcc,
> where it appears patches from non core developers simply fall on  
> the floor.
>
> lily.
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net