Csound Csound-dev Csound-tekno Search About

[Csnd] this difficult to diagnose bug

Date2010-08-12 14:59
FromVictor Lazzarini
Subject[Csnd] this difficult to diagnose bug
I have sent this to the devel list, but it did not get picked up.  
There seems to be a bug now with negative p3 and release-time  
extension, which I am not sure how to fix. This must have creeped in  
between 5.08 (when it definitely worked) and now. It's hard to  
diagnose, but it breaks this CSD ( http://wiki.laptop.org/go/Csound#MIDI_playback 
, GM_example.csd) [which was working perfectly and I used it as a demo  
for a paper at ICMC2008]. I have prepared a simpler CSD that should  
demonstrate the bug. Here's my original report:

Hi everyone,

Rick Boulanger has brought to my attention a bug that is affecting a
CSD he has (and was previously working perfectly) in version 5.12. I
tracked it down to an interaction between
negative p3 / negative p1 and release-time extension.

It's a hard one to diagnose, but I think this simple CSD demonstrates
it.

Basically when using negative p3s (indeterminate duration) sometimes
if the note is killed with a matching negative p1 and then re-started
with the same p1 and
negative p3, this next note will not be killed by a negative p1 event.
This seems to happen when notes overlap because of the use of release-
time extension and
when the two notes hold separate instrument allocations. If no release-
time extension is used, no problem is detected.

Previously, this behaviour was not present in Csound (Rick's now
broken GM soundfont CSD  used in the XO for instance would play
perfectly).

The diagnostics CSD shows that if the release time (girel) is 0, then
the last note is cut. However if it is set to say, 0.5, then the last
note hangs. Other settings of release
time work, eg. 0.1 or 0.6, but not 0.4 or 0.5. It seems to be related
to note duration, but the relationship does not seem straight.



-odac


0dbfs = 1
nchnls=1
ksmps =1
girel init 0.5 ; release time, for certain values notes will hang,
                       ; with 0 there is never any problem.
gidur init 0.5 ; note duration
instr 1
k1 linsegr 0,0.1,1,girel,0
a1 oscili k1*p4,p5,1
out a1
endin
instr 2
k1 linsegr 1,1,1,0.1,2
ktrig init 1
ktrig2 init 0
kL release
if kL == 1 then
if ktrig2 == 1 then
scoreline "i-1 0.05 1", ktrig2
endif
ktrig2 = 0
else
ktrig1 delayk ktrig, gidur ; noteoff trigger idur behind noteon trigger
scoreline "i1 0.05 -1 0.1 440", ktrig
scoreline "i-1 0.05 1", ktrig1
ktrig = ktrig1 ; after noteoff trigger noteon on next k-period
endif
endin


f1 0 16384 10 1
i2 0 2
e 5




Any ideas welcome. I'm at a loss on how to go about fixing this one.



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"

Date2010-08-12 15:11
FromFelipe Sateler
Subject[Csnd] Re: this difficult to diagnose bug
Attachmentssignature.asc  
On 12/08/10 09:59, Victor Lazzarini wrote:
> 
> I have sent this to the devel list, but it did not get picked up. There
> seems to be a bug now with negative p3 and release-time extension, which
> I am not sure how to fix. This must have creeped in between 5.08 (when
> it definitely worked) and now. It's hard to diagnose, but it breaks this
> CSD ( http://wiki.laptop.org/go/Csound#MIDI_playback, GM_example.csd)
> [which was working perfectly and I used it as a demo for a paper at
> ICMC2008]. I have prepared a simpler CSD that should demonstrate the
> bug. Here's my original report:
> 
> Hi everyone,
> 
> Rick Boulanger has brought to my attention a bug that is affecting a
> CSD he has (and was previously working perfectly) in version 5.12. I
> tracked it down to an interaction between
> negative p3 / negative p1 and release-time extension.
> 

> 
> Any ideas welcome. I'm at a loss on how to go about fixing this one.

If you have working and broken revisions, bisecting is a good tool to
detect the problematic commit (and maybe you have an automated test
now?). I believe you used this to fix the portmidi issue a while back.

http://wingolog.org/archives/2006/01/20/cvs-bisect

-- 
Saludos,
Felipe Sateler


Date2010-08-12 15:19
FromVictor Lazzarini
Subject[Csnd] Re: Re: this difficult to diagnose bug
yes, I did. Maybe this is a good way to go.
On 12 Aug 2010, at 15:11, Felipe Sateler wrote:

> On 12/08/10 09:59, Victor Lazzarini wrote:
>>
>> I have sent this to the devel list, but it did not get picked up.  
>> There
>> seems to be a bug now with negative p3 and release-time extension,  
>> which
>> I am not sure how to fix. This must have creeped in between 5.08  
>> (when
>> it definitely worked) and now. It's hard to diagnose, but it breaks  
>> this
>> CSD ( http://wiki.laptop.org/go/Csound#MIDI_playback, GM_example.csd)
>> [which was working perfectly and I used it as a demo for a paper at
>> ICMC2008]. I have prepared a simpler CSD that should demonstrate the
>> bug. Here's my original report:
>>
>> Hi everyone,
>>
>> Rick Boulanger has brought to my attention a bug that is affecting a
>> CSD he has (and was previously working perfectly) in version 5.12. I
>> tracked it down to an interaction between
>> negative p3 / negative p1 and release-time extension.
>>
> 
>>
>> Any ideas welcome. I'm at a loss on how to go about fixing this one.
>
> If you have working and broken revisions, bisecting is a good tool to
> detect the problematic commit (and maybe you have an automated test
> now?). I believe you used this to fix the portmidi issue a while back.
>
> http://wingolog.org/archives/2006/01/20/cvs-bisect
>
> -- 
> Saludos,
> Felipe Sateler
>



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"

Date2010-08-12 16:47
FromAaron Krister Johnson
Subject[Csnd] Re: this difficult to diagnose bug
Hi Victor,

I wouldn't know how to fix it, but it is interesting to note that the latest versions, at least from 5.12 to the recent CVS, had a score sorting problem that I mentioned involving neg p3....it's a long shot, but perhaps they are related? It's worth noting that John ffitch fixed my problem in CVS...

One way to go about troubleshooting this is to diff the source code relevant to the issue, between 5.08 and 5.12, and see what has been added or removed. Maybe that will tell you something? 'Diff' itself might have so much output that at would be counter productive, but perhaps a 'birds eye view' of the code in an editor might be enlightening...maybe an intelligent IDE would show what functions have been added or changed between versions. I imagine you know what source file would be relevant to the problem?

AKJ

On Thu, Aug 12, 2010 at 8:59 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

I have sent this to the devel list, but it did not get picked up. There seems to be a bug now with negative p3 and release-time extension, which I am not sure how to fix. This must have creeped in between 5.08 (when it definitely worked) and now. It's hard to diagnose, but it breaks this CSD ( http://wiki.laptop.org/go/Csound#MIDI_playback, GM_example.csd) [which was working perfectly and I used it as a demo for a paper at ICMC2008]. I have prepared a simpler CSD that should demonstrate the bug. Here's my original report:

Hi everyone,

Rick Boulanger has brought to my attention a bug that is affecting a
CSD he has (and was previously working perfectly) in version 5.12. I
tracked it down to an interaction between
negative p3 / negative p1 and release-time extension.

It's a hard one to diagnose, but I think this simple CSD demonstrates
it.

Basically when using negative p3s (indeterminate duration) sometimes
if the note is killed with a matching negative p1 and then re-started
with the same p1 and
negative p3, this next note will not be killed by a negative p1 event.
This seems to happen when notes overlap because of the use of release-
time extension and
when the two notes hold separate instrument allocations. If no release-
time extension is used, no problem is detected.

Previously, this behaviour was not present in Csound (Rick's now
broken GM soundfont CSD  used in the XO for instance would play
perfectly).

The diagnostics CSD shows that if the release time (girel) is 0, then
the last note is cut. However if it is set to say, 0.5, then the last
note hangs. Other settings of release
time work, eg. 0.1 or 0.6, but not 0.4 or 0.5. It seems to be related
to note duration, but the relationship does not seem straight.

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
0dbfs = 1
nchnls=1
ksmps =1
girel init 0.5 ; release time, for certain values notes will hang,
                     ; with 0 there is never any problem.
gidur init 0.5 ; note duration
instr 1
k1 linsegr 0,0.1,1,girel,0
a1 oscili k1*p4,p5,1
out a1
endin
instr 2
k1 linsegr 1,1,1,0.1,2
ktrig init 1
ktrig2 init 0
kL release
if kL == 1 then
if ktrig2 == 1 then
scoreline "i-1 0.05 1", ktrig2
endif
ktrig2 = 0
else
ktrig1 delayk ktrig, gidur ; noteoff trigger idur behind noteon trigger
scoreline "i1 0.05 -1 0.1 440", ktrig
scoreline "i-1 0.05 1", ktrig1
ktrig = ktrig1 ; after noteoff trigger noteon on next k-period
endif
endin
</CsInstruments>
<CsScore>
f1 0 16384 10 1
i2 0 2
e 5
</CsScore>
</CsoundSynthesizer>


Any ideas welcome. I'm at a loss on how to go about fixing this one.



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"




--
Best,

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org


Date2010-08-12 16:51
FromAaron Krister Johnson
Subject[Csnd] Re: this difficult to diagnose bug
Interesting. Just saw Felipe's post....sounds like there is already a robust tool for doing such snooping. Never mind my earlier post!

AKJ

On Thu, Aug 12, 2010 at 10:47 AM, Aaron Krister Johnson <aaron@akjmusic.com> wrote:
Hi Victor,

I wouldn't know how to fix it, but it is interesting to note that the latest versions, at least from 5.12 to the recent CVS, had a score sorting problem that I mentioned involving neg p3....it's a long shot, but perhaps they are related? It's worth noting that John ffitch fixed my problem in CVS...

One way to go about troubleshooting this is to diff the source code relevant to the issue, between 5.08 and 5.12, and see what has been added or removed. Maybe that will tell you something? 'Diff' itself might have so much output that at would be counter productive, but perhaps a 'birds eye view' of the code in an editor might be enlightening...maybe an intelligent IDE would show what functions have been added or changed between versions. I imagine you know what source file would be relevant to the problem?

AKJ


On Thu, Aug 12, 2010 at 8:59 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

I have sent this to the devel list, but it did not get picked up. There seems to be a bug now with negative p3 and release-time extension, which I am not sure how to fix. This must have creeped in between 5.08 (when it definitely worked) and now. It's hard to diagnose, but it breaks this CSD ( http://wiki.laptop.org/go/Csound#MIDI_playback, GM_example.csd) [which was working perfectly and I used it as a demo for a paper at ICMC2008]. I have prepared a simpler CSD that should demonstrate the bug. Here's my original report:

Hi everyone,

Rick Boulanger has brought to my attention a bug that is affecting a
CSD he has (and was previously working perfectly) in version 5.12. I
tracked it down to an interaction between
negative p3 / negative p1 and release-time extension.

It's a hard one to diagnose, but I think this simple CSD demonstrates
it.

Basically when using negative p3s (indeterminate duration) sometimes
if the note is killed with a matching negative p1 and then re-started
with the same p1 and
negative p3, this next note will not be killed by a negative p1 event.
This seems to happen when notes overlap because of the use of release-
time extension and
when the two notes hold separate instrument allocations. If no release-
time extension is used, no problem is detected.

Previously, this behaviour was not present in Csound (Rick's now
broken GM soundfont CSD  used in the XO for instance would play
perfectly).

The diagnostics CSD shows that if the release time (girel) is 0, then
the last note is cut. However if it is set to say, 0.5, then the last
note hangs. Other settings of release
time work, eg. 0.1 or 0.6, but not 0.4 or 0.5. It seems to be related
to note duration, but the relationship does not seem straight.

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
0dbfs = 1
nchnls=1
ksmps =1
girel init 0.5 ; release time, for certain values notes will hang,
                     ; with 0 there is never any problem.
gidur init 0.5 ; note duration
instr 1
k1 linsegr 0,0.1,1,girel,0
a1 oscili k1*p4,p5,1
out a1
endin
instr 2
k1 linsegr 1,1,1,0.1,2
ktrig init 1
ktrig2 init 0
kL release
if kL == 1 then
if ktrig2 == 1 then
scoreline "i-1 0.05 1", ktrig2
endif
ktrig2 = 0
else
ktrig1 delayk ktrig, gidur ; noteoff trigger idur behind noteon trigger
scoreline "i1 0.05 -1 0.1 440", ktrig
scoreline "i-1 0.05 1", ktrig1
ktrig = ktrig1 ; after noteoff trigger noteon on next k-period
endif
endin
</CsInstruments>
<CsScore>
f1 0 16384 10 1
i2 0 2
e 5
</CsScore>
</CsoundSynthesizer>


Any ideas welcome. I'm at a loss on how to go about fixing this one.



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"




--
Best,

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org




--
Best,

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org


Date2010-08-12 17:01
FromSteven Yi
Subject[Csnd] Re: Re: this difficult to diagnose bug
Hi All,

Also to note, there is Fisheye to use for viewing commits, diffs, etc.:

http://fisheye1.atlassian.com/changelog/csound/csound5

Great tool!

steven

On Thu, Aug 12, 2010 at 11:51 AM, Aaron Krister Johnson
 wrote:
> Interesting. Just saw Felipe's post....sounds like there is already a robust
> tool for doing such snooping. Never mind my earlier post!
>
> AKJ
>
> On Thu, Aug 12, 2010 at 10:47 AM, Aaron Krister Johnson 
> wrote:
>>
>> Hi Victor,
>>
>> I wouldn't know how to fix it, but it is interesting to note that the
>> latest versions, at least from 5.12 to the recent CVS, had a score sorting
>> problem that I mentioned involving neg p3....it's a long shot, but perhaps
>> they are related? It's worth noting that John ffitch fixed my problem in
>> CVS...
>>
>> One way to go about troubleshooting this is to diff the source code
>> relevant to the issue, between 5.08 and 5.12, and see what has been added or
>> removed. Maybe that will tell you something? 'Diff' itself might have so
>> much output that at would be counter productive, but perhaps a 'birds eye
>> view' of the code in an editor might be enlightening...maybe an intelligent
>> IDE would show what functions have been added or changed between versions. I
>> imagine you know what source file would be relevant to the problem?
>>
>> AKJ
>>
>> On Thu, Aug 12, 2010 at 8:59 AM, Victor Lazzarini
>>  wrote:
>>>
>>> I have sent this to the devel list, but it did not get picked up. There
>>> seems to be a bug now with negative p3 and release-time extension, which I
>>> am not sure how to fix. This must have creeped in between 5.08 (when it
>>> definitely worked) and now. It's hard to diagnose, but it breaks this CSD (
>>> http://wiki.laptop.org/go/Csound#MIDI_playback, GM_example.csd) [which was
>>> working perfectly and I used it as a demo for a paper at ICMC2008]. I have
>>> prepared a simpler CSD that should demonstrate the bug. Here's my original
>>> report:
>>>
>>> Hi everyone,
>>>
>>> Rick Boulanger has brought to my attention a bug that is affecting a
>>> CSD he has (and was previously working perfectly) in version 5.12. I
>>> tracked it down to an interaction between
>>> negative p3 / negative p1 and release-time extension.
>>>
>>> It's a hard one to diagnose, but I think this simple CSD demonstrates
>>> it.
>>>
>>> Basically when using negative p3s (indeterminate duration) sometimes
>>> if the note is killed with a matching negative p1 and then re-started
>>> with the same p1 and
>>> negative p3, this next note will not be killed by a negative p1 event.
>>> This seems to happen when notes overlap because of the use of release-
>>> time extension and
>>> when the two notes hold separate instrument allocations. If no release-
>>> time extension is used, no problem is detected.
>>>
>>> Previously, this behaviour was not present in Csound (Rick's now
>>> broken GM soundfont CSD  used in the XO for instance would play
>>> perfectly).
>>>
>>> The diagnostics CSD shows that if the release time (girel) is 0, then
>>> the last note is cut. However if it is set to say, 0.5, then the last
>>> note hangs. Other settings of release
>>> time work, eg. 0.1 or 0.6, but not 0.4 or 0.5. It seems to be related
>>> to note duration, but the relationship does not seem straight.
>>>
>>> 
>>> 
>>> -odac
>>> 
>>> 
>>> 0dbfs = 1
>>> nchnls=1
>>> ksmps =1
>>> girel init 0.5 ; release time, for certain values notes will hang,
>>>                      ; with 0 there is never any problem.
>>> gidur init 0.5 ; note duration
>>> instr 1
>>> k1 linsegr 0,0.1,1,girel,0
>>> a1 oscili k1*p4,p5,1
>>> out a1
>>> endin
>>> instr 2
>>> k1 linsegr 1,1,1,0.1,2
>>> ktrig init 1
>>> ktrig2 init 0
>>> kL release
>>> if kL == 1 then
>>> if ktrig2 == 1 then
>>> scoreline "i-1 0.05 1", ktrig2
>>> endif
>>> ktrig2 = 0
>>> else
>>> ktrig1 delayk ktrig, gidur ; noteoff trigger idur behind noteon trigger
>>> scoreline "i1 0.05 -1 0.1 440", ktrig
>>> scoreline "i-1 0.05 1", ktrig1
>>> ktrig = ktrig1 ; after noteoff trigger noteon on next k-period
>>> endif
>>> endin
>>> 
>>> 
>>> f1 0 16384 10 1
>>> i2 0 2
>>> e 5
>>> 
>>> 
>>>
>>>
>>> Any ideas welcome. I'm at a loss on how to go about fixing this one.
>>>
>>>
>>>
>>> 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"
>>>
>>
>>
>>
>> --
>> Best,
>>
>> Aaron Krister Johnson
>> http://www.akjmusic.com
>> http://www.untwelve.org
>>
>
>
>
> --
> Best,
>
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>


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"