Csound Csound-dev Csound-tekno Search About

[Cs-dev] powoftwo bug in 5.17?

Date2012-06-26 23:31
FromOeyvind Brandtsegg
Subject[Cs-dev] powoftwo bug in 5.17?
Hi,

I think there's a bug in powoftwo in 5.17.11 (installer downloaded as
"latest" from sourceforge today).
See the csd below

best
Oeyvind



-odac



	sr = 44100
	ksmps = 10
	nchnls = 2
	0dbfs = 1

	instr	1

	iNum		= p4				
	ipow		pow 2, iNum	
	ipow2	= powoftwo(iNum)
	print ipow, ipow2

	endin




; 	start	dur	num	bits
i1	0	1	2
i1	1	.	4
i1	2	.	6
i1	3	.	7
i1	4	.	8

e






-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-06-26 23:48
FromVictor Lazzarini
SubjectRe: [Cs-dev] powoftwo bug in 5.17?
I tried with floats and I see the issue with 2^8; it works with doubles csound. (OSX).

SECTION 1:
new alloc for instr 1:
instr 1:  ipow = 4.000  ipow2 = 4.000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
instr 1:  ipow = 16.000  ipow2 = 16.000
B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
instr 1:  ipow = 64.000  ipow2 = 64.000
B  2.000 ..  3.000 T  3.000 TT  3.000 M:  0.00000  0.00000
instr 1:  ipow = 128.000  ipow2 = 128.000
B  3.000 ..  4.000 T  4.000 TT  4.000 M:  0.00000  0.00000
instr 1:  ipow = 65536.000  ipow2 = 65536.000
B  4.000 ..  5.000 T  5.000 TT  5.000 M:  0.00000  0.00000
Score finished in csoundPerform().

Victor
On 26 Jun 2012, at 23:31, Oeyvind Brandtsegg wrote:

> Hi,
> 
> I think there's a bug in powoftwo in 5.17.11 (installer downloaded as
> "latest" from sourceforge today).
> See the csd below
> 
> best
> Oeyvind
> 
> 
> 
> -odac
> 
> 
> 
> 	sr = 44100
> 	ksmps = 10
> 	nchnls = 2
> 	0dbfs = 1
> 
> 	instr	1
> 
> 	iNum		= p4				
> 	ipow		pow 2, iNum	
> 	ipow2	= powoftwo(iNum)
> 	print ipow, ipow2
> 
> 	endin
> 
> 
> 
> 
> ; 	start	dur	num	bits
> i1	0	1	2
> i1	1	.	4
> i1	2	.	6
> i1	3	.	7
> i1	4	.	8
> 
> e
> 
> 
> 
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://flyndresang.no/
> http://www.partikkelaudio.com/
> http://soundcloud.com/brandtsegg
> http://soundcloud.com/t-emp
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-06-27 00:16
FromVictor Lazzarini
SubjectRe: [Cs-dev] powoftwo bug in 5.17?
fixed in GIT.

Victor
On 26 Jun 2012, at 23:48, Victor Lazzarini wrote:

> I tried with floats and I see the issue with 2^8; it works with doubles csound. (OSX).
> 
> SECTION 1:
> new alloc for instr 1:
> instr 1:  ipow = 4.000  ipow2 = 4.000
> B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
> instr 1:  ipow = 16.000  ipow2 = 16.000
> B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
> instr 1:  ipow = 64.000  ipow2 = 64.000
> B  2.000 ..  3.000 T  3.000 TT  3.000 M:  0.00000  0.00000
> instr 1:  ipow = 128.000  ipow2 = 128.000
> B  3.000 ..  4.000 T  4.000 TT  4.000 M:  0.00000  0.00000
> instr 1:  ipow = 65536.000  ipow2 = 65536.000
> B  4.000 ..  5.000 T  5.000 TT  5.000 M:  0.00000  0.00000
> Score finished in csoundPerform().
> 
> Victor
> On 26 Jun 2012, at 23:31, Oeyvind Brandtsegg wrote:
> 
>> Hi,
>> 
>> I think there's a bug in powoftwo in 5.17.11 (installer downloaded as
>> "latest" from sourceforge today).
>> See the csd below
>> 
>> best
>> Oeyvind
>> 
>> 
>> 
>> -odac
>> 
>> 
>> 
>> 	sr = 44100
>> 	ksmps = 10
>> 	nchnls = 2
>> 	0dbfs = 1
>> 
>> 	instr	1
>> 
>> 	iNum		= p4				
>> 	ipow		pow 2, iNum	
>> 	ipow2	= powoftwo(iNum)
>> 	print ipow, ipow2
>> 
>> 	endin
>> 
>> 
>> 
>> 
>> ; 	start	dur	num	bits
>> i1	0	1	2
>> i1	1	.	4
>> i1	2	.	6
>> i1	3	.	7
>> i1	4	.	8
>> 
>> e
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> 
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>> 
>> http://flyndresang.no/
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://soundcloud.com/t-emp
>> 
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> 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
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-06-27 09:10
FromTito Latini
SubjectRe: [Cs-dev] powoftwo bug in 5.17?
AttachmentsNone  

Date2012-06-27 10:56
FromVictor Lazzarini
SubjectRe: [Cs-dev] powoftwo bug in 5.17?
Good, could you commit it?
On 27 Jun 2012, at 09:10, Tito Latini wrote:

> The problem is `sizeof(int)' and not the double samples.
> A possible fix in OOps/aops.c:31 is
> 
> #if ULONG_MAX == 18446744073709551615UL
> #  define POW2MAX   (24.0)
> #else
> #  define POW2MAX   (15.0)
> #endif
> 
> tito
> 
> On Wed, Jun 27, 2012 at 12:16:56AM +0100, Victor Lazzarini wrote:
>> fixed in GIT.
>> 
>> Victor
>> On 26 Jun 2012, at 23:48, Victor Lazzarini wrote:
>> 
>>> I tried with floats and I see the issue with 2^8; it works with doubles csound. (OSX).
>>> 
>>> SECTION 1:
>>> new alloc for instr 1:
>>> instr 1:  ipow = 4.000  ipow2 = 4.000
>>> B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
>>> instr 1:  ipow = 16.000  ipow2 = 16.000
>>> B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
>>> instr 1:  ipow = 64.000  ipow2 = 64.000
>>> B  2.000 ..  3.000 T  3.000 TT  3.000 M:  0.00000  0.00000
>>> instr 1:  ipow = 128.000  ipow2 = 128.000
>>> B  3.000 ..  4.000 T  4.000 TT  4.000 M:  0.00000  0.00000
>>> instr 1:  ipow = 65536.000  ipow2 = 65536.000
>>> B  4.000 ..  5.000 T  5.000 TT  5.000 M:  0.00000  0.00000
>>> Score finished in csoundPerform().
>>> 
>>> Victor
>>> On 26 Jun 2012, at 23:31, Oeyvind Brandtsegg wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I think there's a bug in powoftwo in 5.17.11 (installer downloaded as
>>>> "latest" from sourceforge today).
>>>> See the csd below
>>>> 
>>>> best
>>>> Oeyvind
>>>> 
>>>> 
>>>> 
>>>> -odac
>>>> 
>>>> 
>>>> 
>>>> 	sr = 44100
>>>> 	ksmps = 10
>>>> 	nchnls = 2
>>>> 	0dbfs = 1
>>>> 
>>>> 	instr	1
>>>> 
>>>> 	iNum		= p4				
>>>> 	ipow		pow 2, iNum	
>>>> 	ipow2	= powoftwo(iNum)
>>>> 	print ipow, ipow2
>>>> 
>>>> 	endin
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ; 	start	dur	num	bits
>>>> i1	0	1	2
>>>> i1	1	.	4
>>>> i1	2	.	6
>>>> i1	3	.	7
>>>> i1	4	.	8
>>>> 
>>>> e
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> 
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>> 
>>>> http://flyndresang.no/
>>>> http://www.partikkelaudio.com/
>>>> http://soundcloud.com/brandtsegg
>>>> http://soundcloud.com/t-emp
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and 
>>>> threat landscape has changed and how IT managers can respond. Discussions 
>>>> will include endpoint security, mobile security and the latest in malware 
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> 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
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and 
>>> threat landscape has changed and how IT managers can respond. Discussions 
>>> will include endpoint security, mobile security and the latest in malware 
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> 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
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-06-27 11:07
FromTito Latini
SubjectRe: [Cs-dev] powoftwo bug in 5.17?
AttachmentsNone