Csound Csound-dev Csound-tekno Search About

[Cs-dev] new bugs in turnoff2 and diskin

Date2007-09-30 05:31
FromJonathan Murphy
Subject[Cs-dev] new bugs in turnoff2 and diskin
I hadn't updated my version until yesterday, so I'm sorry that this is
last minute. It seems that the changes to goto_ops.c and diskin.c have
introduced problems. I think that the change to goto_ops.c has broken
turnoff2 for one or several modes. Reverting to the previous version
fixes the issues, so the new code is definitely broken. I haven't
explicitly checked diskin yet, but I'm pretty sure that the new
buffersize parameter is the culprit. I'll rebuild later today and get
debugging info.

Jonathan.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-09-30 10:42
FromJonathan Murphy
SubjectRe: [Cs-dev] new bugs in turnoff2 and diskin
I've worked out what's going on. diskin is fine, so sorry about the
noise there. The problem is just with turnoff2, in the case of mode 4,
when the instrument has already been deactivated. Instead of returning
a warning, csound hangs. Here is a patch:


--- goto_ops.c.1.9      2007-09-30 18:24:32.000000000 +0900
+++ goto_ops.c  2007-09-30 18:29:21.000000000 +0900
@@ -187,6 +187,9 @@
     }
     ip = &(csound->actanchor);
     ip2 = NULL;
+    if ((mode & 4) && !ip->p1){
+      return csoundPerfError(csound, Str("turnoff2: invalid instrument number"));
+    }  
     while ((ip = ip->nxtact) != NULL && (int) ip->insno != insno);
     if (ip == NULL)
       return OK;

Jonathan.

Jonathan Murphy  writes:

> I hadn't updated my version until yesterday, so I'm sorry that this is
> last minute. It seems that the changes to goto_ops.c and diskin.c have
> introduced problems. I think that the change to goto_ops.c has broken
> turnoff2 for one or several modes. Reverting to the previous version
> fixes the issues, so the new code is definitely broken. I haven't
> explicitly checked diskin yet, but I'm pretty sure that the new
> buffersize parameter is the culprit. I'll rebuild later today and get
> debugging info.
>
> Jonathan.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-09-30 12:50
FromJonathan Murphy
SubjectRe: [Cs-dev] new bugs in turnoff2 and diskin
Sorry, that patch won't work.

Jonathan.

Jonathan Murphy  writes:

> I've worked out what's going on. diskin is fine, so sorry about the
> noise there. The problem is just with turnoff2, in the case of mode 4,
> when the instrument has already been deactivated. Instead of returning
> a warning, csound hangs. Here is a patch:
>
>
> --- goto_ops.c.1.9      2007-09-30 18:24:32.000000000 +0900
> +++ goto_ops.c  2007-09-30 18:29:21.000000000 +0900
> @@ -187,6 +187,9 @@
>      }
>      ip = &(csound->actanchor);
>      ip2 = NULL;
> +    if ((mode & 4) && !ip->p1){
> +      return csoundPerfError(csound, Str("turnoff2: invalid instrument number"));
> +    }  
>      while ((ip = ip->nxtact) != NULL && (int) ip->insno != insno);
>      if (ip == NULL)
>        return OK;
>
> Jonathan.
>
> Jonathan Murphy  writes:
>
>> I hadn't updated my version until yesterday, so I'm sorry that this is
>> last minute. It seems that the changes to goto_ops.c and diskin.c have
>> introduced problems. I think that the change to goto_ops.c has broken
>> turnoff2 for one or several modes. Reverting to the previous version
>> fixes the issues, so the new code is definitely broken. I haven't
>> explicitly checked diskin yet, but I'm pretty sure that the new
>> buffersize parameter is the culprit. I'll rebuild later today and get
>> debugging info.
>>
>> Jonathan.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-09-30 15:23
Fromjpff
SubjectRe: [Cs-dev] new bugs in turnoff2 and diskin
True!
==John ffitch

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-09-30 16:57
FromJonathan Murphy
SubjectRe: [Cs-dev] new bugs in turnoff2 and diskin
However, this csd is broken by the changes to turnoff2. It works if I
revert to the previous version. Any suggestions?

Jonathan.



-+rtaudio=alsa -odac -+rtmidi=alsa -Mhw:1,0 -d -m0 



  sr		=		48000
  ksmps		=		16
  nchnls	=		2
  0dbfs		=		1

		massign		0, 0
		pgmassign	0, 0

  gisin		ftgen		1, 0, 32768, 10, 1
  giji_12       ftgen           2, 0, 32, -2, 12, 2, 256, 60, 1, \
  16/15, 9/8, 6/5, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 9/5, 15/8, 2

  gkon		init		0
  gkmax		init		8

                instr 1

  kst, kch, kd1, kd2		midiin		
  if (kst == 144) then
  kdec		=		kd1/1000
  kin		=		2.0 + kdec
  if (kd2 == 0) then
		turnoff2	kin, 4, 1
  gkon		=		gkon - 1
  elseif (kd2 > 0) then
		event		"i", kin, 0, -1, kd1, kd2
  gkon		=		gkon + 1
  if (gkon > gkmax) then
		turnoff2	2, 1, 1
  gkon		=		gkon - 1
  endif
  endif
  endif

                endin

                instr 2

  ikey		=		p4
  ivel		=		p5 * 0.0078125
  icps		cpstuni		ikey, giji_12
  iatt		=		0.03
  idec		=		10
  isus		=		0
  irel		=		1
		xtratim		irel
  krel		release		
  if (krel == 1) kgoto rel
  aenv1		linseg		0, iatt, 1, idec, isus, -1, isus
  aenv		=		aenv1
		kgoto		done
rel:
  aenv2		linseg		1, irel, 0, -1, 0
  aenv		=		aenv1 * aenv2
done:
  aosc		oscil		ivel, icps, gisin
  aosc		=		aosc * aenv * 0.2
		outs		aosc, aosc

                endin



i1 0 10000
e





jpff  writes:

> True!
> ==John ffitch
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net