Re: [PD] removing NaN pure-pd

2008-10-29 Thread IOhannes m zmoelnig
Damian Stewart wrote:
 is there a pure Pd way to remove NaNs? i can't use expr with rjdj..
 

i thought expr is part of the RjDj distro...
but then: you can test while i cannot.
and this might be one of the later this week licensing things.

fgmasdr
IOhannes

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Frank Barknecht
Hallo,
IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:

 Damian Stewart wrote:
  is there a pure Pd way to remove NaNs? i can't use expr with rjdj..
 
 i thought expr is part of the RjDj distro...

Only the BSD parts of Pd are included in RjDj at the moment, so you
cannot use expr - which is tricky, as in fact there are several math
functions missing now in RjDj's Pd, for example no [pow~] yet - but
this will come as a builtin as soon as RjDj jumps to 0.42.

Ciao
-- 
Frank

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Damian Stewart
Frank Barknecht wrote:
 Hallo,
 IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
 
 Damian Stewart wrote:
 is there a pure Pd way to remove NaNs? i can't use expr with rjdj..
 i thought expr is part of the RjDj distro...
 
 Only the BSD parts of Pd are included in RjDj at the moment, so you
 cannot use expr - which is tricky, as in fact there are several math
 functions missing now in RjDj's Pd, for example no [pow~] yet - but
 this will come as a builtin as soon as RjDj jumps to 0.42.

and judging from the lack of replies i assume detecting NaNs is one of 
these things as well...

-- 
damian stewart | skype: damiansnz | [EMAIL PROTECTED]
frey | live art with machines | http://www.frey.co.nz

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Gunter Geiger
Damian Stewart wrote:
 Frank Barknecht wrote:
   
 Hallo,
 IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:

 
 Damian Stewart wrote:
   
 is there a pure Pd way to remove NaNs? i can't use expr with rjdj..
 
 i thought expr is part of the RjDj distro...
   
 Only the BSD parts of Pd are included in RjDj at the moment, so you
 cannot use expr - which is tricky, as in fact there are several math
 functions missing now in RjDj's Pd, for example no [pow~] yet - but
 this will come as a builtin as soon as RjDj jumps to 0.42.
 

 and judging from the lack of replies i assume detecting NaNs is one of 
 these things as well...
   
Adding this functionality would be trivial,  if you want you can add
a ticket on track regarding the issue. In the long run the correct solution
would be to try to figure out why there are NaN's  ... and fix it there.

Günter


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Andy Farnell
On Wed, 29 Oct 2008 17:55:00 +0100
Gunter Geiger [EMAIL PROTECTED] wrote:

  Only the BSD parts of Pd are included in RjDj at the moment, so you
  cannot use expr - which is tricky, as in fact there are several math
  functions missing now in RjDj's Pd, for example no [pow~] yet - but
  this will come as a builtin as soon as RjDj jumps to 0.42.


Just a quick but important note:
Please make sure [pow~] is compatible with latest vanilla versions
and not the broken (reversed parameter) version from cyclone.

cheers,

Andy

-- 
Use the source

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Charles Henry
On Wed, Oct 29, 2008 at 11:55 AM, Gunter Geiger [EMAIL PROTECTED] wrote:
 Adding this functionality would be trivial,  if you want you can add
 a ticket on track regarding the issue. In the long run the correct solution
 would be to try to figure out why there are NaN's  ... and fix it there.

 Günter

My best guess is that NaN's come from underflow, under normal
circumstances.  I wish there would be an easy way to change this
behavior via a compiler flag, but I don't think there is.

It seems to be a more pervasive problem, and it's unreasonable to
expect to add NaN handlers in application code.  Thank the IEEE
standards for this gem.

Chuck

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Charles Henry
 My best guess is that NaN's come from underflow, under normal
 circumstances.  I wish there would be an easy way to change this
 behavior via a compiler flag, but I don't think there is.

 It seems to be a more pervasive problem, and it's unreasonable to
 expect to add NaN handlers in application code.  Thank the IEEE
 standards for this gem.

I did some more searching around to find that someone has written just
such a handler for underflow here:
http://www.cenapad.unicamp.br/parque/manuais/Ibmcxx/complink/tasks/tutrapex.htm

The code uses the sigcontext struct when a floating point exception
occurs, to set the result to zero, once an underflow is created.

Underflow traps are enabled by (gcc) compiler flag -mfp-trap-mode=u

I'm really not sure about how all of this can be applied successfully.
 Has anyone implemented this kind of handler before?

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-29 Thread Martin Peach
Charles Henry wrote:
  My best guess is that NaN's come from underflow, under normal
  circumstances.  I wish there would be an easy way to change this
  behavior via a compiler flag, but I don't think there is.
 
  It seems to be a more pervasive problem, and it's unreasonable to
  expect to add NaN handlers in application code.  Thank the IEEE
  standards for this gem.

I did some more searching around to find that someone has written just
such a handler for underflow here:
http://www.cenapad.unicamp.br/parque/manuais/Ibmcxx/complink/tasks/tutrapex.htm

The code uses the sigcontext struct when a floating point exception
occurs, to set the result to zero, once an underflow is created.

Underflow traps are enabled by (gcc) compiler flag -mfp-trap-mode=u

I'm really not sure about how all of this can be applied successfully.
  Has anyone implemented this kind of handler before?

In the perform routine of sqosc~, I used:
if (finite(sample))*out++ = sample;
else *out++ = 0.0;
to get rid of denormals.

For MSW builds that required adding:
#include float.h /* for _finite */
#define finite _finite

Seems like the simplest solution to me...


Martin



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN pure-pd

2008-10-27 Thread Damian Stewart
is there a pure Pd way to remove NaNs? i can't use expr with rjdj..

d
-- 
damian stewart | skype: damiansnz | [EMAIL PROTECTED]
frey | live art with machines | http://www.frey.co.nz

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN

2008-09-29 Thread Damian Stewart
David Brynjar Franzson wrote:
 the expr works fine with expr (isnan($f1), 0, $f1). The route f method
 doesn't work since NaN is treated as a valid floating point number.

on pd-0.40-3-extended (osx intel) trying to use this i get :

expr: syntax error: illegal comma

,
0
,
$f1


error: expr: syntax error
  expr (isnan($f1) , 0 , $f1)
... couldn't create

-- 
damian stewart | skype: damiansnz | [EMAIL PROTECTED]
frey | live art with machines | http://www.frey.co.nz

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN

2008-09-29 Thread Damian Stewart
Damian Stewart wrote:
 David Brynjar Franzson wrote:
 the expr works fine with expr (isnan($f1), 0, $f1). The route f method
 doesn't work since NaN is treated as a valid floating point number.
 
 on pd-0.40-3-extended (osx intel) trying to use this i get :
 
 expr: syntax error: illegal comma

... which is because it needs to be expr ( if(isnan($f1), 0, $f1) )

-- 
damian stewart | skype: damiansnz | [EMAIL PROTECTED]
frey | live art with machines | http://www.frey.co.nz

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


[PD] removing NaN

2008-09-13 Thread David Brynjar Franzson
Hi,

 is there any simple way to replace all NaN values with Zeros or
to filter them out?

thanks,
David Brynjar

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN

2008-09-13 Thread Thomas Mayer
David Brynjar Franzson wrote:
 Hi,
 
  is there any simple way to replace all NaN values with Zeros or
 to filter them out?

If you do not have lists, then route should do the trick:

[route f]
|   |
|   [0(

cu Thomas
-- 
Prisons are needed only to provide the illusion that courts and police
are effective. They're a kind of job insurance.
(Leto II. in: Frank Herbert, God Emperor of Dune)
http://thomas.dergrossebruder.org/


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN

2008-09-13 Thread tim

[expr] contains a function 'isnan'. 
Not sure how to use it though.
can someone give an example ?

Tim



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] removing NaN

2008-09-13 Thread David Brynjar Franzson
the expr works fine with expr (isnan($f1), 0, $f1). The route f method
doesn't work since NaN is treated as a valid floating point number.

thanks for the help,
David Brynjar

On Sat, Sep 13, 2008 at 11:05 AM, tim [EMAIL PROTECTED] wrote:
 [expr] contains a function 'isnan'.
 Not sure how to use it though.
 can someone give an example ?

 Tim

 On Sat, 2008-09-13 at 10:36 -0400, David Brynjar Franzson wrote:
 Hi,

  is there any simple way to replace all NaN values with Zeros or
 to filter them out?

 thanks,
 David Brynjar

 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management - 
 http://lists.puredata.info/listinfo/pd-list
 --
 ...
 www.timvets.net
 [EMAIL PROTECTED], [EMAIL PROTECTED]
 0032 474 89 66 86
 skype: tim167_
 ...



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list