Csound Csound-dev Csound-tekno Search About

[Cs-dev] linseg bug?

Date2011-07-17 10:58
Fromaum
Subject[Cs-dev] linseg bug?
"linseg 1 p3 2" gives constant value 1.000 for long P3. Is it my fault or the
bug?
Here is csd file:





sr = 44100

kr = 4410

ksmps = 10

nchnls = 2

instr 1

  kf linseg 1, p3, 2

  printks "%f %n" , 10, kf
endin








i 1 0 5000






Here is the result:
csound t1.csd 
time resolution is 0.833 ns
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.10 beta (float samples) Dec  3 2009
libsndfile-1.0.20
UnifiedCSD:  t1.csd
STARTING FILE
Creating orchestra
Creating score
orchname:  /tmp/file2C4PA6.orc
scorename: /tmp/filerQfQ7j.sco
rtaudio: pulseaudio module enabled
orch compiler:
9 lines read
	instr	1	
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.000s
sorting score ...
	... done
Elapsed time at end of score sort: real: 0.003s, CPU: 0.010s
Csound version 5.10 beta (float samples) Dec  3 2009
0dBFS level = 32768.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 1024-byte blks of shorts to test.wav (WAV)
SECTION 1:
new alloc for instr 1:
1.000000 
1.000000 
1.000000 
1.000000 
1.000000 
1.000000 
1.000000 
etc.
Thanks for any help.
aum



--
View this message in context: http://csound.1045644.n5.nabble.com/linseg-bug-tp4596059p4596059.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-17 12:57
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] linseg bug?
Cannot reproduce.  Or in other words works for me.

What platform?  I notice you are using 5.19 which i a a littl eold, but
libnseg has not changed for ages (I think)
==John ff

> "linseg 1 p3 2" gives constant value 1.000 for long P3. Is it my fault or
> the
> bug?
> Here is csd file:
>
> 
>
> 
>
> sr = 44100
>
> kr = 4410
>
> ksmps = 10
>
> nchnls = 2
>
> instr 1
>
>   kf linseg 1, p3, 2
>
>   printks "%f %n" , 10, kf
> endin
>
> 
>
>
>
>
> 
>
> i 1 0 5000
>
> 
>
> 
>
>
> Here is the result:
> csound t1.csd
> time resolution is 0.833 ns
> virtual_keyboard real time MIDI plugin for Csound
> 0dBFS level = 32768.0
> Csound version 5.10 beta (float samples) Dec  3 2009
> libsndfile-1.0.20
> UnifiedCSD:  t1.csd
> STARTING FILE
> Creating orchestra
> Creating score
> orchname:  /tmp/file2C4PA6.orc
> scorename: /tmp/filerQfQ7j.sco
> rtaudio: pulseaudio module enabled
> orch compiler:
> 9 lines read
> 	instr	1
> Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.000s
> sorting score ...
> 	... done
> Elapsed time at end of score sort: real: 0.003s, CPU: 0.010s
> Csound version 5.10 beta (float samples) Dec  3 2009
> 0dBFS level = 32768.0
> orch now loaded
> audio buffered in 256 sample-frame blocks
> writing 1024-byte blks of shorts to test.wav (WAV)
> SECTION 1:
> new alloc for instr 1:
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> etc.
> Thanks for any help.
> aum
>
>
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/linseg-bug-tp4596059p4596059.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-17 13:52
Frompeiman khosravi
SubjectRe: [Cs-dev] linseg bug?
AttachmentsNone  None  
It may be an old printks issue?

On 17 July 2011 12:57, <jpff@cs.bath.ac.uk> wrote:
Cannot reproduce.  Or in other words works for me.

What platform?  I notice you are using 5.19 which i a a littl eold, but
libnseg has not changed for ages (I think)
==John ff

> "linseg 1 p3 2" gives constant value 1.000 for long P3. Is it my fault or
> the
> bug?
> Here is csd file:
>
> <CsoundSynthesizer>
>
> <CsInstruments>
>
> sr = 44100
>
> kr = 4410
>
> ksmps = 10
>
> nchnls = 2
>
> instr 1
>
>   kf linseg 1, p3, 2
>
>   printks "%f %n" , 10, kf
> endin
>
> </CsInstruments>
>
>
>
>
> <CsScore>
>
> i 1 0 5000
>
> </CsScore>
>
> </CsoundSynthesizer>
>
>
> Here is the result:
> csound t1.csd
> time resolution is 0.833 ns
> virtual_keyboard real time MIDI plugin for Csound
> 0dBFS level = 32768.0
> Csound version 5.10 beta (float samples) Dec  3 2009
> libsndfile-1.0.20
> UnifiedCSD:  t1.csd
> STARTING FILE
> Creating orchestra
> Creating score
> orchname:  /tmp/file2C4PA6.orc
> scorename: /tmp/filerQfQ7j.sco
> rtaudio: pulseaudio module enabled
> orch compiler:
> 9 lines read
>       instr   1
> Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.000s
> sorting score ...
>       ... done
> Elapsed time at end of score sort: real: 0.003s, CPU: 0.010s
> Csound version 5.10 beta (float samples) Dec  3 2009
> 0dBFS level = 32768.0
> orch now loaded
> audio buffered in 256 sample-frame blocks
> writing 1024-byte blks of shorts to test.wav (WAV)
> SECTION 1:
> new alloc for instr 1:
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> 1.000000
> etc.
> Thanks for any help.
> aum
>
>
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/linseg-bug-tp4596059p4596059.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2011-07-17 21:24
Fromaum
SubjectRe: [Cs-dev] linseg bug?
It is not the printks bug. linseg output is sometimes wrong. Constant or
wrong range (e.g. linseg 4, p3, 14 goes over 15), depending on p3, kr,
ksmps. My system is Fedora 12 with Planet CCRMA and csound 5.10 beta.
Upgrade will be probably the solution. Thanks. aum

--
View this message in context: http://csound.1045644.n5.nabble.com/linseg-bug-tp4596059p4597238.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-17 23:51
FromVictor Lazzarini
SubjectRe: [Cs-dev] linseg bug?
I think this might not be a bug, but a limitation of 32bit floats. The  
increment is too small for a 32bit float. If you run the
same csd with a doubles version of csound, it will work. That is why  
John says it works for him.

Maybe we should consider making all envelope increments double  
precision by default?

On 17 Jul 2011, at 21:24, aum wrote:

> It is not the printks bug. linseg output is sometimes wrong.  
> Constant or
> wrong range (e.g. linseg 4, p3, 14 goes over 15), depending on p3, kr,
> ksmps. My system is Fedora 12 with Planet CCRMA and csound 5.10 beta.
> Upgrade will be probably the solution. Thanks. aum
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/linseg-bug-tp4596059p4597238.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> 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




------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-18 11:17
Fromaum
SubjectRe: [Cs-dev] linseg bug?
AttachmentsNone  None  
I think you are right. 1/(4410*5000) is about 2^-28, near the limit of
32bit float precision.

I do not know what the default precision should be. I do not know the
effect of 64bit arithmetic in 32bit csound on the speed of calculations.
I think for most users with relatively short sounds 32bit envelopes are
ok. For long sounds 64bit version of csound is the option (this is my
case, too). Maybe it would help others to mention it somewhere in the
documentation, maybe with some practical tips.
Thanks
aum

On 07/18/2011 12:51 AM, Victor Lazzarini [via Csound] wrote:
> I think this might not be a bug, but a limitation of 32bit floats. The
> increment is too small for a 32bit float. If you run the
> same csd with a doubles version of csound, it will work. That is why
> John says it works for him.
>
> Maybe we should consider making all envelope increments double
> precision by default?



View this message in context: Re: linseg bug?
Sent from the Csound - Dev mailing list archive at Nabble.com.

Date2011-07-18 11:20
FromVictor Lazzarini
SubjectRe: [Cs-dev] linseg bug?
AttachmentsNone  None  
In my opinion all increments should be double, as in oscillators. I have changed line/expon but all other envelope opcodes should be changed too.

Victor
On 18 Jul 2011, at 11:17, aum wrote:

I think you are right. 1/(4410*5000) is about 2^-28, near the limit of
32bit float precision.

I do not know what the default precision should be. I do not know the
effect of 64bit arithmetic in 32bit csound on the speed of calculations.
I think for most users with relatively short sounds 32bit envelopes are
ok. For long sounds 64bit version of csound is the option (this is my
case, too). Maybe it would help others to mention it somewhere in the
documentation, maybe with some practical tips.
Thanks
aum

On 07/18/2011 12:51 AM, Victor Lazzarini [via Csound] wrote:
> I think this might not be a bug, but a limitation of 32bit floats. The
> increment is too small for a 32bit float. If you run the
> same csd with a doubles version of csound, it will work. That is why
> John says it works for him.
>
> Maybe we should consider making all envelope increments double
> precision by default?



View this message in context: Re: linseg bug?
Sent from the Csound - Dev mailing list archive at Nabble.com.
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev_______________________________________________
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




Date2011-07-18 12:05
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] linseg bug?
In my opinion we should be using doubles everywhere!
==John ff

> In my opinion all increments should be double, as in oscillators. I
> have changed line/expon but all other envelope opcodes should be
> changed too.
>
> Victor
> On 18 Jul 2011, at 11:17, aum wrote:
>
>> I think you are right. 1/(4410*5000) is about 2^-28, near the limit of
>> 32bit float precision.
>>
>> I do not know what the default precision should be. I do not know the
>> effect of 64bit arithmetic in 32bit csound on the speed of
>> calculations.
>> I think for most users with relatively short sounds 32bit envelopes
>> are
>> ok. For long sounds 64bit version of csound is the option (this is my
>> case, too). Maybe it would help others to mention it somewhere in the
>> documentation, maybe with some practical tips.
>> Thanks
>> aum
>>
>> On 07/18/2011 12:51 AM, Victor Lazzarini [via Csound] wrote:
>> > I think this might not be a bug, but a limitation of 32bit floats.
>> The
>> > increment is too small for a 32bit float. If you run the
>> > same csd with a doubles version of csound, it will work. That is why
>> > John says it works for him.
>> >
>> > Maybe we should consider making all envelope increments double
>> > precision by default?
>>
>>
>> View this message in context: Re: linseg bug?
>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>> ------------------------------------------------------------------------------
>> AppSumo Presents a FREE Video for the SourceForge Community by Eric
>> Ries, the creator of the Lean Startup Methodology on "Lean Startup
>> Secrets Revealed." This video shows you how to validate your ideas,
>> optimize your ideas and identify your business strategy.
>> http://p.sf.net/sfu/appsumosfdev2dev_______________________________________________
>> 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
>
>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>



------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-18 12:08
FromVictor Lazzarini
SubjectRe: [Cs-dev] linseg bug?
yes, but we have not binned the floats version yet, so I think we need  
to change the increments.

Victor
On 18 Jul 2011, at 12:05, jpff@cs.bath.ac.uk wrote:

> In my opinion we should be using doubles everywhere!
> ==John ff
>
>> In my opinion all increments should be double, as in oscillators. I
>> have changed line/expon but all other envelope opcodes should be
>> changed too.
>>
>> Victor
>> On 18 Jul 2011, at 11:17, aum wrote:
>>
>>> I think you are right. 1/(4410*5000) is about 2^-28, near the  
>>> limit of
>>> 32bit float precision.
>>>
>>> I do not know what the default precision should be. I do not know  
>>> the
>>> effect of 64bit arithmetic in 32bit csound on the speed of
>>> calculations.
>>> I think for most users with relatively short sounds 32bit envelopes
>>> are
>>> ok. For long sounds 64bit version of csound is the option (this is  
>>> my
>>> case, too). Maybe it would help others to mention it somewhere in  
>>> the
>>> documentation, maybe with some practical tips.
>>> Thanks
>>> aum
>>>
>>> On 07/18/2011 12:51 AM, Victor Lazzarini [via Csound] wrote:
>>>> I think this might not be a bug, but a limitation of 32bit floats.
>>> The
>>>> increment is too small for a 32bit float. If you run the
>>>> same csd with a doubles version of csound, it will work. That is  
>>>> why
>>>> John says it works for him.
>>>>
>>>> Maybe we should consider making all envelope increments double
>>>> precision by default?
>>>
>>>
>>> View this message in context: Re: linseg bug?
>>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>>> ------------------------------------------------------------------------------
>>> AppSumo Presents a FREE Video for the SourceForge Community by Eric
>>> Ries, the creator of the Lean Startup Methodology on "Lean Startup
>>> Secrets Revealed." This video shows you how to validate your ideas,
>>> optimize your ideas and identify your business strategy.
>>> http://p.sf.net/sfu/appsumosfdev2dev_______________________________________________
>>> 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
>>
>>
>>
>> ------------------------------------------------------------------------------
>> AppSumo Presents a FREE Video for the SourceForge Community by Eric
>> Ries, the creator of the Lean Startup Methodology on "Lean Startup
>> Secrets Revealed." This video shows you how to validate your ideas,
>> optimize your ideas and identify your business strategy.
>> http://p.sf.net/sfu/appsumosfdev2dev_______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> 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




------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-18 12:24
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] linseg bug?
> yes, but we have not binned the floats version yet, so I think we need
> to change the increments.
>
> Victor


Do you have a list of which need change?  I would rather not either of us
repeat the work of the other.



------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-07-18 12:37
FromVictor Lazzarini
SubjectRe: [Cs-dev] linseg bug?
I guess all of the ones in ugens1 to start with. I've done line and  
expon just to check it's worth it (in GIT now).

Victor
On 18 Jul 2011, at 12:24, jpff@cs.bath.ac.uk wrote:

>> yes, but we have not binned the floats version yet, so I think we  
>> need
>> to change the increments.
>>
>> Victor
>
>
> Do you have a list of which need change?  I would rather not either  
> of us
> repeat the work of the other.
>
>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> 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




------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net