I have a function which blows up at a certain point, moves to infinity. In this case, it is basically 1/0.
I was a little surprised to find that 1/0 = 0 (according to Pd). I was expecting NaN, or an overflow condition would could be trapped.
So what I have to do is examine the *input* for the values which will blow up my function, and set a flag. While this is easy in this single case, it is awkward in the general case.
This seems somewhat broken to me. Is this a bug?
Thanks BH
-- William Huston: WilliamAHuston@gmail.com Binghamton NY
*Public Service Mapping / Videography / Research* Blog http://WilliamAHuston.blogspot.com -- Facebook http://facebook.com/billhuston -- Twitter http://twitter.com/WilliamAHuston-- Youtube https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_congfirmation=1 Document collections: VirtualPipelines http://TinyURL.com/VirtualPipelines -- BHDCSDimockArchive http://bit.ly/BHDCSDimockArchive Please support my work: TinyURL.com/DonateToBillHuston
Just don’t allow your function to blow up in the first place.
On Thursday, May 24, 2018, William Huston williamahuston@gmail.com wrote:
I have a function which blows up at a certain point, moves to infinity. In this case, it is basically 1/0.
I was a little surprised to find that 1/0 = 0 (according to Pd). I was expecting NaN, or an overflow condition would could be trapped.
So what I have to do is examine the *input* for the values which will blow up my function, and set a flag. While this is easy in this single case, it is awkward in the general case.
This seems somewhat broken to me. Is this a bug?
Thanks BH
-- William Huston: WilliamAHuston@gmail.com Binghamton NY
*Public Service Mapping / Videography / Research* Blog http://WilliamAHuston.blogspot.com -- Facebook http://facebook.com/billhuston -- Twitter http://twitter.com/WilliamAHuston-- Youtube https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_congfirmation=1 Document collections: VirtualPipelines http://TinyURL.com/VirtualPipelines -- BHDCSDimockArchive http://bit.ly/BHDCSDimockArchive Please support my work: TinyURL.com/DonateToBillHuston
Hi William, there's no other sane way to handle division by 0 in the audio domain since the result must be a number and there are only two options: output 0 or some ridiculously large number (which would be quite dangerous). Pd *could* handle it differently in the control domain, but why? as Matt said: just don't divide by 0 :-)
Christof
Gesendet: Donnerstag, 24. Mai 2018 um 16:52 Uhr Von: "Matt Davey" hard.off@gmail.com An: "William Huston" williamahuston@gmail.com Cc: "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] 1 / 0 = 0? Just don’t allow your function to blow up in the first place.
On Thursday, May 24, 2018, William Huston <williamahuston@gmail.com[mailto:williamahuston@gmail.com]> wrote:
I have a function which blows up at a certain point, moves to infinity. In this case, it is basically 1/0. I was a little surprised to find that 1/0 = 0 (according to Pd). I was expecting NaN, or an overflow condition would could be trapped. So what I have to do is examine the *input* for the values which will blow up my function, and set a flag. While this is easy in this single case, it is awkward in the general case. This seems somewhat broken to me. Is this a bug? Thanks BH
-- William Huston: WilliamAHuston@gmail.com[mailto:WilliamAHuston@gmail.com] Binghamton NY
Public Service Mapping / Videography / Research Blog[http://WilliamAHuston.blogspot.com] -- Facebook[http://facebook.com/billhuston] -- Twitter [http://twitter.com/WilliamAHuston] -- Youtube[https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_congfirmation=1] Document collections: VirtualPipelines[http://TinyURL.com/VirtualPipelines] -- BHDCSDimockArchive[http://bit.ly/BHDCSDimockArchive] Please support my work: TinyURL.com/DonateToBillHuston[http://TinyURL.com/DonateToBillHuston] _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps://lists.puredata.info/l...]
Dear Christof,
I understand that tradeoff when working with real-time audio.
However, I was talking about control logic, not audio.
BH
-- William Huston: WilliamAHuston@gmail.com Binghamton NY
*Public Service Mapping / Videography / Research* Blog http://WilliamAHuston.blogspot.com -- Facebook http://facebook.com/billhuston -- Twitter http://twitter.com/WilliamAHuston-- Youtube https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_congfirmation=1 Document collections: VirtualPipelines http://TinyURL.com/VirtualPipelines -- BHDCSDimockArchive http://bit.ly/BHDCSDimockArchive Please support my work: TinyURL.com/DonateToBillHuston
On Thu, May 24, 2018 at 10:57 AM, Christof Ressi christof.ressi@gmx.at wrote:
Hi William,
there's no other sane way to handle division by 0 in the audio domain since the result must be a number and there are only two options: output 0 or some ridiculously large number (which would be quite dangerous). Pd *could* handle it differently in the control domain, but why? as Matt said: just don't divide by 0 :-)
Christof
Gesendet: Donnerstag, 24. Mai 2018 um 16:52 Uhr Von: "Matt Davey" hard.off@gmail.com An: "William Huston" williamahuston@gmail.com Cc: "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] 1 / 0 = 0? Just don’t allow your function to blow up in the first place.
On Thursday, May 24, 2018, William Huston <williamahuston@gmail.com[ mailto:williamahuston@gmail.com]> wrote:
I have a function which blows up at a certain point, moves to infinity. In this case, it is basically 1/0.
I was a little surprised to find that 1/0 = 0 (according to Pd). I was expecting NaN, or an overflow condition would could be trapped.
So what I have to do is examine the *input* for the values which will blow up my function, and set a flag. While this is easy in this single case, it is awkward in the general case.
This seems somewhat broken to me. Is this a bug?
Thanks BH
-- William Huston: WilliamAHuston@gmail.com[mailto:WilliamAHuston@gmail.com] Binghamton NY
Public Service Mapping / Videography / Research Blog[http://WilliamAHuston.blogspot.com] -- Facebook[http://facebook.com/ billhuston] -- Twitter [http://twitter.com/WilliamAHuston] -- Youtube[ https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_ congfirmation=1] Document collections: VirtualPipelines[http://TinyURL.com/VirtualPipelines] -- BHDCSDimockArchive[http://bit.ly/BHDCSDimockArchive] Please support my work: TinyURL.com/DonateToBillHuston[http:// TinyURL.com/DonateToBillHuston] _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps:// lists.puredata.info/listinfo/pd-list]
On Thu, May 24, 2018 at 10:57 AM, Christof Ressi christof.ressi@gmx.at wrote:
there's no other sane way to handle division by 0 in the audio domain since
the result must be a number and there are only two options: output 0 or some ridiculously large number (which would be quite dangerous).
Yes, but if you try division by a very small number close to zero you still get very large numbers that audio hardware will clip to +-1; the singularity at zero is weird.
Martin
Many math objects in pd have protection against nan/inf, not only in the audio control. It is the official policy
2018-05-24 12:49 GMT-03:00 Martin Peach chakekatzil@gmail.com:
On Thu, May 24, 2018 at 10:57 AM, Christof Ressi christof.ressi@gmx.at wrote:
there's no other sane way to handle division by 0 in the audio domain
since the result must be a number and there are only two options: output 0 or some ridiculously large number (which would be quite dangerous).
Yes, but if you try division by a very small number close to zero you still get very large numbers that audio hardware will clip to +-1; the singularity at zero is weird.
Martin
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/ listinfo/pd-list
expr can give you inf/nans eventually, but it was not originally part of pd's core
2018-05-24 13:43 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Many math objects in pd have protection against nan/inf, not only in the audio control. It is the official policy
2018-05-24 12:49 GMT-03:00 Martin Peach chakekatzil@gmail.com:
On Thu, May 24, 2018 at 10:57 AM, Christof Ressi christof.ressi@gmx.at wrote:
there's no other sane way to handle division by 0 in the audio domain
since the result must be a number and there are only two options: output 0 or some ridiculously large number (which would be quite dangerous).
Yes, but if you try division by a very small number close to zero you still get very large numbers that audio hardware will clip to +-1; the singularity at zero is weird.
Martin
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/li stinfo/pd-list
On Thu, May 24, 2018 at 12:43 PM, Alexandre Torres Porres porres@gmail.com wrote:
Many math objects in pd have protection against nan/inf, not only in the audio control. It is the official policy
I think it makes more sense to use FLT_MAX (1E+37) for +infinity, not
zero. For continuity with adjacent values. See attached patch.
Martin