hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
I'm assuming this copysign function is like the [sgn~] object in zexy, right? If not, what would it be? cheers
2015-06-07 16:57 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
It's spelled "copysig" in expr. But I couldn't get it to work.
copysig in expr only takes one argument, whereas the c math function takes two arguments: float copysignf(float x, float y);
It returns the absolute value of x with the sign of y.
Smells like a bug to me...
cheers, Jan
On 06/07/2015 09:57 PM, Alexandre Torres Porres wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
You can substitute the copysign function with this ugly thing:
[expr $f1*if($f2==0, 1, $f2/abs($f2))]
cheers, jan
On 06/07/2015 10:39 PM, Jan Baumgart wrote:
It's spelled "copysig" in expr. But I couldn't get it to work.
copysig in expr only takes one argument, whereas the c math function takes two arguments: float copysignf(float x, float y);
It returns the absolute value of x with the sign of y.
Smells like a bug to me...
cheers, Jan
On 06/07/2015 09:57 PM, Alexandre Torres Porres wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Well, I'm worried about the bugs in expr and that they get fixed actually, there are more bugs I found by the way. Now Shahrokh doesn't seem to be working on it and making updates anymore. I remember I complained about something in 2009 to him and it never got fixed. I could list them all as well, but I won't make a bug report if it can't be fixed...
So, what could we do? Could we just fix it and update it? Or does he have to do it?
I remember some issues regarding its license as well, but never really understood them, maybe the license issue prevents people from updating it?
cheers
2015-06-07 17:51 GMT-03:00 Jan Baumgart raga.raga@gmx.de:
You can substitute the copysign function with this ugly thing:
[expr $f1*if($f2==0, 1, $f2/abs($f2))]
cheers, jan
On 06/07/2015 10:39 PM, Jan Baumgart wrote:
It's spelled "copysig" in expr. But I couldn't get it to work.
copysig in expr only takes one argument, whereas the c math function takes two arguments: float copysignf(float x, float y);
It returns the absolute value of x with the sign of y.
Smells like a bug to me...
cheers, Jan
On 06/07/2015 09:57 PM, Alexandre Torres Porres wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Jan Baumgart Technischer Mitarbeiter Hochschule für Musik und Darstellende Kunst Eschersheimer Landstr. 29-39 60322 Frankfurt am Main
On 06/07/2015 11:17 PM, Alexandre Torres Porres wrote:
So, what could we do?
in any case make a bug-report at sourceforge, so the information can be collected in a central place. usually, this makes it to not miss an issue (e.g. a bug report is only closed once it is resolved; not because i 'accidentally' marked my email as "read" after reading it). btw, all bug-reports that are opened on sf, will be automatically forwarded to the (dev) mailinglist, so people get aware of it promptly.
gfardsm IOhannes
Great, I'll try to remember all bugs I found and test the object for even more issues that there may be and then report them.
But I'd still like to know if anyone can fix this. I'm not sure how the authorship works in this particular example. I know it's an "extra" feature in vanilla, not maintained by miller, and it has a different license than Pd's.
Well, maybe I could generalize this issue to any other objects and libraries, because I see many of them marked as being maintained by some people, but they don't really seem to be so in the real world. Another example is that I pointed a bug about [partconv~] to the author/maintainer and he said he was aware of it but "didn't have time to work on it"... so, can they all be fixed and maintained by anyone? should we revise the externals and libraries to see if we see new maintainers or mark them as unmaintained?
I ask this because I'm realy considering facing the challenge of learning more about programming and helping out.
cheers
2015-06-07 18:26 GMT-03:00 IOhannes m zmölnig zmoelnig@iem.at:
On 06/07/2015 11:17 PM, Alexandre Torres Porres wrote:
So, what could we do?
in any case make a bug-report at sourceforge, so the information can be collected in a central place. usually, this makes it to not miss an issue (e.g. a bug report is only closed once it is resolved; not because i 'accidentally' marked my email as "read" after reading it). btw, all bug-reports that are opened on sf, will be automatically forwarded to the (dev) mailinglist, so people get aware of it promptly.
gfardsm IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
one issue that stands out in the case of expr is that its official manual and code distribution is hosted in sharok's website, so I guess he needs to be involved.
2015-06-07 18:40 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Great, I'll try to remember all bugs I found and test the object for even more issues that there may be and then report them.
But I'd still like to know if anyone can fix this. I'm not sure how the authorship works in this particular example. I know it's an "extra" feature in vanilla, not maintained by miller, and it has a different license than Pd's.
Well, maybe I could generalize this issue to any other objects and libraries, because I see many of them marked as being maintained by some people, but they don't really seem to be so in the real world. Another example is that I pointed a bug about [partconv~] to the author/maintainer and he said he was aware of it but "didn't have time to work on it"... so, can they all be fixed and maintained by anyone? should we revise the externals and libraries to see if we see new maintainers or mark them as unmaintained?
I ask this because I'm realy considering facing the challenge of learning more about programming and helping out.
cheers
2015-06-07 18:26 GMT-03:00 IOhannes m zmölnig zmoelnig@iem.at:
On 06/07/2015 11:17 PM, Alexandre Torres Porres wrote:
So, what could we do?
in any case make a bug-report at sourceforge, so the information can be collected in a central place. usually, this makes it to not miss an issue (e.g. a bug report is only closed once it is resolved; not because i 'accidentally' marked my email as "read" after reading it). btw, all bug-reports that are opened on sf, will be automatically forwarded to the (dev) mailinglist, so people get aware of it promptly.
gfardsm IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Alexandre,
Thanks for your investigations and bug reports - that is important work.
On 08/06/15 05:40, Alexandre Torres Porres wrote:
But I'd still like to know if anyone can fix this. I'm not sure how the authorship works in this particular example. I know it's an "extra" feature in vanilla, not maintained by miller, and it has a different license than Pd's.
The license is LGPL so it is compatible.
The last bugfix in expr~ was made by Miller on Sun Oct 12, 2014 and specifically references a Source Forge ticket somebody filed, so I don't think "not maintained by miller" is accurate.
As IOhannes said, a helpful thing would be filing these issues in the tracker at Source Forge and that will hopefully result in the bug getting fixed.
Even more helpful would be if you forked the Pd git repository, fixed the bug, and then sent a patch to Miller. :)
git://git.code.sf.net/p/pure-data/pure-data
Well, maybe I could generalize this issue to any other objects and libraries, because I see many of them marked as being maintained by some people, but they don't really seem to be so in the real world. Another example is that I pointed a bug about [partconv~] to the author/maintainer and he said he was aware of it but "didn't have time to work on it"... so, can they all be fixed and maintained by anyone? should we revise the externals and libraries to see if we see new maintainers or mark them as unmaintained?
Anybody is free to update the code. At the moment there is some friction because you need to have access to the SVN repository on Source Forge. I hope it will become easier to just externals fork code, modify it, host it wherever you like as mentioned in a different thread.
This would make it easier when an external like [partconv~] is abandoned
of the external with your fix.
Cheers,
Chris.
Thanks for your investigations and bug reports - that is important work.
I'm more than glab to be able to help this way, unfortuntely I can't do more and fix the code myself. Not yet at least :)
cheers
2015-06-07 23:07 GMT-03:00 Chris McCormick chris@mccormick.cx:
Hi Alexandre,
Thanks for your investigations and bug reports - that is important work.
On 08/06/15 05:40, Alexandre Torres Porres wrote:
But I'd still like to know if anyone can fix this. I'm not sure how the authorship works in this particular example. I know it's an "extra" feature in vanilla, not maintained by miller, and it has a different license than Pd's.
The license is LGPL so it is compatible.
The last bugfix in expr~ was made by Miller on Sun Oct 12, 2014 and specifically references a Source Forge ticket somebody filed, so I don't think "not maintained by miller" is accurate.
As IOhannes said, a helpful thing would be filing these issues in the tracker at Source Forge and that will hopefully result in the bug getting fixed.
Even more helpful would be if you forked the Pd git repository, fixed the bug, and then sent a patch to Miller. :)
git://git.code.sf.net/p/pure-data/pure-data
Well, maybe I could generalize this issue to any other objects and libraries, because I see many of them marked as being maintained by some people, but they don't really seem to be so in the real world. Another example is that I pointed a bug about [partconv~] to the author/maintainer and he said he was aware of it but "didn't have time to work on it"... so, can they all be fixed and maintained by anyone? should we revise the externals and libraries to see if we see new maintainers or mark them as unmaintained?
Anybody is free to update the code. At the moment there is some friction because you need to have access to the SVN repository on Source Forge. I hope it will become easier to just externals fork code, modify it, host it wherever you like as mentioned in a different thread.
This would make it easier when an external like [partconv~] is abandoned
- you could fork it, change it, build and upload new binaries for users
of the external with your fix.
Cheers,
Chris.
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres porres@gmail.com wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned on
the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
documentation as "copysign") and it seems to not be working.
You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says it
takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
supposed to be, but it seems the second argument doesn't affect it at all.
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres <porres@gmail.com
wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Hey, i've been meaning to ask you about plans to make [fexpr~] available for Max. I've been recently teaching peopl about max as well, and I use [fexpr~] a lot. I always assumed max had the same objects, but was surprised to learn it doesn't have an [expr~] object, just an [expr] which seems to ba based on this work. Not that I actually care much about Max, cause I actually like to promote Pd to Max users, but I'd just like to know about the plans really, if they actually exist or are just unlikely.
thanks
2015-06-08 3:45 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation, it
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above. But
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned on
the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in "1".
You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says it
takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says it
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Thank Alexandre for that detailed list. It is very helpful. I will address them in the next couple of weeks, and now that Miller has suggested a path forward for committing the changes, hopefully the fixes show up in the official releases soon.
As for Max/MSP versions, yes I have had plans for a while, and it is on my list to be done this summer, if something else does not take over my allocated time.
cheers, Shahrokh
On Sun, Jun 7, 2015 at 11:45 PM, Alexandre Torres Porres porres@gmail.com wrote:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation, it
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above. But
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned on
the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in "1".
You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says it
takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says it
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Hi, I got more stuff !!! Not really about the functions in expr, though. The thing is that expr has a hard time managing symbols and numbers in pd.
*ISSUE 1* - Problems with "$1", "$2", etc...
You can load arguments in expr with no problems IF it is actually being loaded into an abstraction that is receiving arguments. But when it is not receiving arguments you need to be careful on where it is placed, it needs to be placed by itself with spaces before and after.
For example, if you have [expr $1+1] in an abstraction that is receiving one argument it's ok. But if that's not the case, it won't load the object. The only way you can load the object with no argument being passed to it is like [expr $1 + 1], then $1 will receive a value of "0" like it should, and everything is fine.
Another example, if you have an "if" expression, such as [expr if($1 == 1, x, y)] - there's no deal if it's not getting an argument. But if you have it as [expr if( $1 == 1, x, y)] is fine!
I can't think of any good reason why it works when arguments are passed, but if fails when there are no arguments and they're getting values of "0". If it works one way it also should work the other way. So it's a bug for me...
*ISSUE 2 *- Problems with $0
expr can read tables from the patches, and also variables in the [value] object. But when these elements are being used with the local variable "$0" we have issues.
Influenced by the 13.locality example in Pd, I'm used to create local variables such as "$0-x". But in expr this won't load as a symbol, $0 will become the patch code number "-" will define subtraction and "x" will be considered the variable. I guess it'd make sense if if it worked considering "$0-x" as a symbol (thus, a variable) but I understand expr is actually doing what makes sense to it. I also think it may be a pain trying to make this work. I'm actually fine with it if it turns out to be too troublesome, but it'd be nice to mention this in the documentation or help file.
But if we need to do this in some other way, we also have a hard time dealing with it. If you try "$0x", "$0.x" or "$0_x" it won't load! Now, I assume this problem might be closely related to the first issue I mentioned here with "$1". So it might be fixable in a similar fashion.
Continuing, the only way it works is if you put "$0" after a symbol, such as "x$0" or "x_$0". I can't think of a reason why this works and not the other, so looks like a bug for me too.
But then, is there any problem if you have to do it only like this? Actually, there is! All is fine in the case of [value], it'll load [v x$0] or whatever. All is also fine if you are using a table object, such as [table x$0] or [table x_$0]. The problem emerges when you are using an array not loaded as an object. So, if you're using a table that you need for display, it's quite a headache.
This is because "array" has issues of his own. If you have an array named "x$0" it won't read in an object like [tabread x$0]! Maybe this is a parallel issue that should be looked into. I guess they way Pd handles $0 in messages is tricky, but it is the opposite issue of expr. The array will work fine with $0 before symbols, but won't work well if it's afterwards. So an array named "x$0" won't work...
Well, it does work if you set it as "$0-x" for example. But I've already mentioned how it won't load in [expr]...
So, basically, if you want to do this, you need a somewhat complicated workaround. Since expr will only load something like "x_$0", you need to create an array and replace $0 by the actual number of that patch. Further workarounds may allow you to automatically rename that array when you load the patch, but it's not easy.
I know arrays are not making it easy, and maybe they could collaborate - but it'd be just fine if expr allowed something like "$0_x" like all other objects do! That'd be great.
*ISSUE 3 *- Problems with exponential numbers
Pd will automatically convert "0.00001" to "1e-05". This will work in every object in Pd, but not expr! Because of this, we need workarounds such as putting it in parenthesis, like [expr (0.00001)], or use the pow function in expr, like [expr pow(10, -5)]. But since the behaviour in expr is different than everything else, I consider it a bug that may be worked out.
Looking forward for the fixes. Please tell me if you think you can work this all out.
Thanks
2015-06-08 12:32 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Thank Alexandre for that detailed list. It is very helpful. I will address them in the next couple of weeks, and now that Miller has suggested a path forward for committing the changes, hopefully the fixes show up in the official releases soon.
As for Max/MSP versions, yes I have had plans for a while, and it is on my list to be done this summer, if something else does not take over my allocated time.
cheers, Shahrokh
On Sun, Jun 7, 2015 at 11:45 PM, Alexandre Torres Porres <porres@gmail.com
wrote:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation, it
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above. But
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned on
the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in
"1". You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says it
takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says it
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
thought I'd send a patch with the last issues I brought up. Find it attached, it sumarizes well the issues.
I thought of an easier workaround for "$0" and arrays, just send the name via [symbol $0-x]. I included that in my patch.
I thought of another good reason to use an array instead of in a [table] object. You can store values in an array, save it in the patch. Somehow this is not possible with [table], so you always need to set it and fill it when you load the patch.
One last thing, I guess it'd be good to make a more detailed and extensive help file for expr. It'd make cristal clear how to use all the functions with the correct syntax and there'd be no need for checking the documentation website. For instance, it isn't clear anywhere in the documentation or help file what is the syntax for "sum"/"size", for instance.
The help file could also show possible issues and workarounds like I'm raising up here.
cheers
2015-06-09 3:18 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Hi, I got more stuff !!! Not really about the functions in expr, though. The thing is that expr has a hard time managing symbols and numbers in pd.
*ISSUE 1* - Problems with "$1", "$2", etc...
You can load arguments in expr with no problems IF it is actually being loaded into an abstraction that is receiving arguments. But when it is not receiving arguments you need to be careful on where it is placed, it needs to be placed by itself with spaces before and after.
For example, if you have [expr $1+1] in an abstraction that is receiving one argument it's ok. But if that's not the case, it won't load the object. The only way you can load the object with no argument being passed to it is like [expr $1 + 1], then $1 will receive a value of "0" like it should, and everything is fine.
Another example, if you have an "if" expression, such as [expr if($1 == 1, x, y)] - there's no deal if it's not getting an argument. But if you have it as [expr if( $1 == 1, x, y)] is fine!
I can't think of any good reason why it works when arguments are passed, but if fails when there are no arguments and they're getting values of "0". If it works one way it also should work the other way. So it's a bug for me...
*ISSUE 2 *- Problems with $0
expr can read tables from the patches, and also variables in the [value] object. But when these elements are being used with the local variable "$0" we have issues.
Influenced by the 13.locality example in Pd, I'm used to create local variables such as "$0-x". But in expr this won't load as a symbol, $0 will become the patch code number "-" will define subtraction and "x" will be considered the variable. I guess it'd make sense if if it worked considering "$0-x" as a symbol (thus, a variable) but I understand expr is actually doing what makes sense to it. I also think it may be a pain trying to make this work. I'm actually fine with it if it turns out to be too troublesome, but it'd be nice to mention this in the documentation or help file.
But if we need to do this in some other way, we also have a hard time dealing with it. If you try "$0x", "$0.x" or "$0_x" it won't load! Now, I assume this problem might be closely related to the first issue I mentioned here with "$1". So it might be fixable in a similar fashion.
Continuing, the only way it works is if you put "$0" after a symbol, such as "x$0" or "x_$0". I can't think of a reason why this works and not the other, so looks like a bug for me too.
But then, is there any problem if you have to do it only like this? Actually, there is! All is fine in the case of [value], it'll load [v x$0] or whatever. All is also fine if you are using a table object, such as [table x$0] or [table x_$0]. The problem emerges when you are using an array not loaded as an object. So, if you're using a table that you need for display, it's quite a headache.
This is because "array" has issues of his own. If you have an array named "x$0" it won't read in an object like [tabread x$0]! Maybe this is a parallel issue that should be looked into. I guess they way Pd handles $0 in messages is tricky, but it is the opposite issue of expr. The array will work fine with $0 before symbols, but won't work well if it's afterwards. So an array named "x$0" won't work...
Well, it does work if you set it as "$0-x" for example. But I've already mentioned how it won't load in [expr]...
So, basically, if you want to do this, you need a somewhat complicated workaround. Since expr will only load something like "x_$0", you need to create an array and replace $0 by the actual number of that patch. Further workarounds may allow you to automatically rename that array when you load the patch, but it's not easy.
I know arrays are not making it easy, and maybe they could collaborate - but it'd be just fine if expr allowed something like "$0_x" like all other objects do! That'd be great.
*ISSUE 3 *- Problems with exponential numbers
Pd will automatically convert "0.00001" to "1e-05". This will work in every object in Pd, but not expr! Because of this, we need workarounds such as putting it in parenthesis, like [expr (0.00001)], or use the pow function in expr, like [expr pow(10, -5)]. But since the behaviour in expr is different than everything else, I consider it a bug that may be worked out.
Looking forward for the fixes. Please tell me if you think you can work this all out.
Thanks
2015-06-08 12:32 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Thank Alexandre for that detailed list. It is very helpful. I will address them in the next couple of weeks, and now that Miller has suggested a path forward for committing the changes, hopefully the fixes show up in the official releases soon.
As for Max/MSP versions, yes I have had plans for a while, and it is on my list to be done this summer, if something else does not take over my allocated time.
cheers, Shahrokh
On Sun, Jun 7, 2015 at 11:45 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation, it
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above. But
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned
on the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in
"1". You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says
it takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says it
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
oops, found another issue - it won't if you try to load the name of a table as an argument inside expr, something like [expr $2 [ $1 ]] won't load. This seems to be related to what I've been already mentioning... workaround would be [expr $s1 [ $1 ]] and then send table name via [symbol $2] as illustrated by attached image.
cheers
2015-06-09 3:47 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
thought I'd send a patch with the last issues I brought up. Find it attached, it sumarizes well the issues.
I thought of an easier workaround for "$0" and arrays, just send the name via [symbol $0-x]. I included that in my patch.
I thought of another good reason to use an array instead of in a [table] object. You can store values in an array, save it in the patch. Somehow this is not possible with [table], so you always need to set it and fill it when you load the patch.
One last thing, I guess it'd be good to make a more detailed and extensive help file for expr. It'd make cristal clear how to use all the functions with the correct syntax and there'd be no need for checking the documentation website. For instance, it isn't clear anywhere in the documentation or help file what is the syntax for "sum"/"size", for instance.
The help file could also show possible issues and workarounds like I'm raising up here.
cheers
2015-06-09 3:18 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Hi, I got more stuff !!! Not really about the functions in expr, though. The thing is that expr has a hard time managing symbols and numbers in pd.
*ISSUE 1* - Problems with "$1", "$2", etc...
You can load arguments in expr with no problems IF it is actually being loaded into an abstraction that is receiving arguments. But when it is not receiving arguments you need to be careful on where it is placed, it needs to be placed by itself with spaces before and after.
For example, if you have [expr $1+1] in an abstraction that is receiving one argument it's ok. But if that's not the case, it won't load the object. The only way you can load the object with no argument being passed to it is like [expr $1 + 1], then $1 will receive a value of "0" like it should, and everything is fine.
Another example, if you have an "if" expression, such as [expr if($1 == 1, x, y)] - there's no deal if it's not getting an argument. But if you have it as [expr if( $1 == 1, x, y)] is fine!
I can't think of any good reason why it works when arguments are passed, but if fails when there are no arguments and they're getting values of "0". If it works one way it also should work the other way. So it's a bug for me...
*ISSUE 2 *- Problems with $0
expr can read tables from the patches, and also variables in the [value] object. But when these elements are being used with the local variable "$0" we have issues.
Influenced by the 13.locality example in Pd, I'm used to create local variables such as "$0-x". But in expr this won't load as a symbol, $0 will become the patch code number "-" will define subtraction and "x" will be considered the variable. I guess it'd make sense if if it worked considering "$0-x" as a symbol (thus, a variable) but I understand expr is actually doing what makes sense to it. I also think it may be a pain trying to make this work. I'm actually fine with it if it turns out to be too troublesome, but it'd be nice to mention this in the documentation or help file.
But if we need to do this in some other way, we also have a hard time dealing with it. If you try "$0x", "$0.x" or "$0_x" it won't load! Now, I assume this problem might be closely related to the first issue I mentioned here with "$1". So it might be fixable in a similar fashion.
Continuing, the only way it works is if you put "$0" after a symbol, such as "x$0" or "x_$0". I can't think of a reason why this works and not the other, so looks like a bug for me too.
But then, is there any problem if you have to do it only like this? Actually, there is! All is fine in the case of [value], it'll load [v x$0] or whatever. All is also fine if you are using a table object, such as [table x$0] or [table x_$0]. The problem emerges when you are using an array not loaded as an object. So, if you're using a table that you need for display, it's quite a headache.
This is because "array" has issues of his own. If you have an array named "x$0" it won't read in an object like [tabread x$0]! Maybe this is a parallel issue that should be looked into. I guess they way Pd handles $0 in messages is tricky, but it is the opposite issue of expr. The array will work fine with $0 before symbols, but won't work well if it's afterwards. So an array named "x$0" won't work...
Well, it does work if you set it as "$0-x" for example. But I've already mentioned how it won't load in [expr]...
So, basically, if you want to do this, you need a somewhat complicated workaround. Since expr will only load something like "x_$0", you need to create an array and replace $0 by the actual number of that patch. Further workarounds may allow you to automatically rename that array when you load the patch, but it's not easy.
I know arrays are not making it easy, and maybe they could collaborate - but it'd be just fine if expr allowed something like "$0_x" like all other objects do! That'd be great.
*ISSUE 3 *- Problems with exponential numbers
Pd will automatically convert "0.00001" to "1e-05". This will work in every object in Pd, but not expr! Because of this, we need workarounds such as putting it in parenthesis, like [expr (0.00001)], or use the pow function in expr, like [expr pow(10, -5)]. But since the behaviour in expr is different than everything else, I consider it a bug that may be worked out.
Looking forward for the fixes. Please tell me if you think you can work this all out.
Thanks
2015-06-08 12:32 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Thank Alexandre for that detailed list. It is very helpful. I will address them in the next couple of weeks, and now that Miller has suggested a path forward for committing the changes, hopefully the fixes show up in the official releases soon.
As for Max/MSP versions, yes I have had plans for a while, and it is on my list to be done this summer, if something else does not take over my allocated time.
cheers, Shahrokh
On Sun, Jun 7, 2015 at 11:45 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation,
it points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above.
But it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned
on the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in
"1". You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says
it takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says
it was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Dear Alexandre,
This is great and I appreciate all your work you have done on it. Once I start working on it , I will do my best to address all of them in some form or another if it is possible to solve them in expr.
cheers, Shahrokh
On Mon, Jun 8, 2015 at 11:18 PM, Alexandre Torres Porres porres@gmail.com wrote:
Hi, I got more stuff !!! Not really about the functions in expr, though. The thing is that expr has a hard time managing symbols and numbers in pd.
*ISSUE 1* - Problems with "$1", "$2", etc...
You can load arguments in expr with no problems IF it is actually being loaded into an abstraction that is receiving arguments. But when it is not receiving arguments you need to be careful on where it is placed, it needs to be placed by itself with spaces before and after.
For example, if you have [expr $1+1] in an abstraction that is receiving one argument it's ok. But if that's not the case, it won't load the object. The only way you can load the object with no argument being passed to it is like [expr $1 + 1], then $1 will receive a value of "0" like it should, and everything is fine.
Another example, if you have an "if" expression, such as [expr if($1 == 1, x, y)] - there's no deal if it's not getting an argument. But if you have it as [expr if( $1 == 1, x, y)] is fine!
I can't think of any good reason why it works when arguments are passed, but if fails when there are no arguments and they're getting values of "0". If it works one way it also should work the other way. So it's a bug for me...
*ISSUE 2 *- Problems with $0
expr can read tables from the patches, and also variables in the [value] object. But when these elements are being used with the local variable "$0" we have issues.
Influenced by the 13.locality example in Pd, I'm used to create local variables such as "$0-x". But in expr this won't load as a symbol, $0 will become the patch code number "-" will define subtraction and "x" will be considered the variable. I guess it'd make sense if if it worked considering "$0-x" as a symbol (thus, a variable) but I understand expr is actually doing what makes sense to it. I also think it may be a pain trying to make this work. I'm actually fine with it if it turns out to be too troublesome, but it'd be nice to mention this in the documentation or help file.
But if we need to do this in some other way, we also have a hard time dealing with it. If you try "$0x", "$0.x" or "$0_x" it won't load! Now, I assume this problem might be closely related to the first issue I mentioned here with "$1". So it might be fixable in a similar fashion.
Continuing, the only way it works is if you put "$0" after a symbol, such as "x$0" or "x_$0". I can't think of a reason why this works and not the other, so looks like a bug for me too.
But then, is there any problem if you have to do it only like this? Actually, there is! All is fine in the case of [value], it'll load [v x$0] or whatever. All is also fine if you are using a table object, such as [table x$0] or [table x_$0]. The problem emerges when you are using an array not loaded as an object. So, if you're using a table that you need for display, it's quite a headache.
This is because "array" has issues of his own. If you have an array named "x$0" it won't read in an object like [tabread x$0]! Maybe this is a parallel issue that should be looked into. I guess they way Pd handles $0 in messages is tricky, but it is the opposite issue of expr. The array will work fine with $0 before symbols, but won't work well if it's afterwards. So an array named "x$0" won't work...
Well, it does work if you set it as "$0-x" for example. But I've already mentioned how it won't load in [expr]...
So, basically, if you want to do this, you need a somewhat complicated workaround. Since expr will only load something like "x_$0", you need to create an array and replace $0 by the actual number of that patch. Further workarounds may allow you to automatically rename that array when you load the patch, but it's not easy.
I know arrays are not making it easy, and maybe they could collaborate - but it'd be just fine if expr allowed something like "$0_x" like all other objects do! That'd be great.
*ISSUE 3 *- Problems with exponential numbers
Pd will automatically convert "0.00001" to "1e-05". This will work in every object in Pd, but not expr! Because of this, we need workarounds such as putting it in parenthesis, like [expr (0.00001)], or use the pow function in expr, like [expr pow(10, -5)]. But since the behaviour in expr is different than everything else, I consider it a bug that may be worked out.
Looking forward for the fixes. Please tell me if you think you can work this all out.
Thanks
2015-06-08 12:32 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Thank Alexandre for that detailed list. It is very helpful. I will address them in the next couple of weeks, and now that Miller has suggested a path forward for committing the changes, hopefully the fixes show up in the official releases soon.
As for Max/MSP versions, yes I have had plans for a while, and it is on my list to be done this summer, if something else does not take over my allocated time.
cheers, Shahrokh
On Sun, Jun 7, 2015 at 11:45 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
Hello, great to hear from you. Yes, I got that fix, but I never compiled it and was just hoping someday it'd show up as an update, and I'm just worried it never came to be. Sorry to put you on the spot. I'm still learning about the bug reports work and get dealt with in Pd, people in the list were explaining to me today in fact. But since everyone is gathered here, instead of me making a bug report, I'll just post everything I found wrong or funny. I spent a great deal of time testing, here we go:
- the help file of [expr] gives the wrong link to expr documentation, it
points to http://www.crca.ucsd.edu/~yadegari/expr.html where it should point to the new link http://yadegari.org/expr/expr.html
- The random function is not listed in the documentation link above. But
it's great and I always use it. It has a bug in Pd extended 0.42 where [expr random(1000, 100001)] will eventually give negative numbers. But, somehow, this seems to be fixed in vanilla 0.46-6.
the "if" function is mentioned twice in the documentation
The function "Sum" is not working yet.
In the code we see other functions for tables that are not mentioned
on the documentation link They are: "avg", "Avg" and "Store" - but none of which seem to be working as well!
- there's this "copysig" issue (which is written wrong int the
documentation as "copysign") and it seems to not be working.
- expr will consider integers as integers, so [expr 5 / 4] results in
"1". You can do something like [expr 5./ 4] for it to work, or use the float function like this: [expr float(5) / 4]. Now, this may not be a bug or wrong, but if you use [expr float(1.4)] it'll return you "1" instead of "1.4", and I guess it should be "1.4" anyway...
[expr imodf($f1)] and [expr ldexp($f1)] are not loading
[expr drem($f1)] loads with one argument, but the documentation says
it takes two arguments. Even though it loads, it doesn't seem to be working, it sends lots of errors, such as "error: expr: FUNC_EVAL(1291): bad right type 0 /// expr: bang: unrecognized result 0 /// error: expr: FUNC_EVAL(1291): bad right type 3
- One's comlpement will load like this [expr $f1 ~ $f2]. Not sure what
it's supposed to be, but it seems the second argument doesn't affect it at all.
- "floor" and "ceil" will load with two arguments, documentation says it
was only one! Not sure what they're supposed to be, but it doesn't seem right cause it always returns the 1st argument in both of them.
"fmod", wrong number of arguments in the documentation, it takes two!
In the documentation, you have "
atan() 1 inverse hyperbolic tangent" but I belive it should be "atan*h*"
- Code says
The following are done but not popular enough in math libss
to be included yet
hypoth - Euclidean distance function
trunc
round
nearbyint -
So, maybe they are popular enough nowadays? Maybe they're ready to be included?
Well, that's what I found so far. I'm no mathematician, so I can't find anything else I guess. I could test other functions but I wouldn't know if they are correct.
Anyway, sorry I can't help more getting into the code issues. I'm at a point now that I wish I know more about programming so I can help Pd development.
Thanks
2015-06-08 3:08 GMT-03:00 Shahrokh Yadegari sdy@ucsd.edu:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres < porres@gmail.com> wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Hi Shahrokh et all -
I think the simplest way (for submitters and for me) is for you to clone the git repo:
git clone git://git.code.sf.net/p/pure-data/pure-data
then edit files as desired,
git commit
git log
(this gives something like:
commit 90608feff2e7b24c1b0d37e38ba196500b6641ab Author: Miller Puckette msp@ucsd.edu Date: Tue May 26 13:26:06 2015 -0700
fix bug allowing /dev/midi and /dev/midi1 to falsely match
commit 6daab96dacead99f37e2245ce797377fcf6410a7 Author: Miller Puckette msp@ucsd.edu Date: Sun May 24 19:10:49 2015 -0700
) and then...
git format-patch [-o /tmp] ^6daab96da 90608feff
then add a patch to the SF patch tracker:
http://sourceforge.net/p/pure-data/patches/
attaching the git-generated patch file. Then pop me a personal e-mail to remind me to look at the patch tracker - some weeks I'm good about that and some other weeks I forget. :).
(I do this now to try to maintain coherence between the "released" (0.46) and "bleeding edge" (0.47) branches. The one bother I've noticed is that, if I commit something, discover a bug, and make another commit to fix that, it appears as two files in the git diff - I can't find any way to erase the intervening commit. I'm learning that 'git commit --amend' sometimes helps me avoid this problem.)
cheers Miller
On Sun, Jun 07, 2015 at 11:08:14PM -0700, Shahrokh Yadegari wrote:
Hi Alexandre,
This seems to be a bug. I am not sure why I missed the 'n' on the name either. As it seems that this function has never worked, we should fix the name as well. The solution is simple as follows:
extra/expr~/vexp_fun.c
188c188
< {"copysign", ex_copysign, 2},
{"copysig", ex_copysign, 1},
I checked the mailing list (I am sorry that I am not a regular reader) and I see some concerns about the maintenance of the code. I am happy to fix the problems and I thought I sent you a fix for the last problem you had found in 2009. Can somebody point me to a document or a webpage that explains what the best way is to introduce new changes to the pd source base. Miller, should I pass the fixes to you, or is there another repository?
In the meanwhile, if there are other bugs in expr that anybody else knows, please send them to me and I will fix them as soon as I can.
best, Shahrokh
On Sun, Jun 7, 2015 at 12:57 PM, Alexandre Torres Porres porres@gmail.com wrote:
hi there, I was checking the source of expr (find it attached) and saw this "copysign" function that I needed for a formula, but I can't get it to work/load.
I'm trying something like [expr copysign($f1)] and it's not happening. The expr manual page in http://yadegari.org/expr/expr.html tells about this function as well, here it is:
copysign() 1 copy sign of a number(added in version 0.4)
So it seems I'm supposedly doing the right thing... is it a bug? I'm on extended 0.42 and it says that it's expr version 0.4 when it loads.
cheers
-- Shahrokh Yadegari Professor of Composition and Sound Design, Theatre and Dance Department University of California, San Diego Director, Initiative for Digital Exploration of Arts and Science, (IDEAS) California Institute for Telecommunications and Information Technologies (Calit2) Email: sdy@ucsd.edu Web: http://yadegari.org Tel: (858) 822-4113 Fax: (858) 534-1080
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 08/06/15 22:48, Miller Puckette wrote:
The one bother I've noticed is that, if I commit something, discover a bug, and make another commit to fix that, it appears as two files in the git diff - I can't find any way to erase the intervening commit. I'm learning that 'git commit --amend' sometimes helps me avoid this problem.)
On command that is pretty mindblowing (and sounds like it would work
well for your situation) is git rebase --interactive
- it lets you
time travel to re-write/re-organise your commit history, squash commits
together, change commits, etc.
I know that Hans used this extensively when developing on Pd-extended because he showed me his workflow once when I was staying with him. At the time I was completely bamboozled but have subsequently come to appreciate his wisdom.
Basically you can say "take me back to commit X and let me do-over each commit from that point forward", optionally letting you keep things as they are in later commits, change things, delete commits. If only life and pd-mailing-list had such a feature!
https://help.github.com/articles/using-git-rebase/
Cheers,
Chris.
On 2015-06-09 05:49, Chris McCormick wrote:
On 08/06/15 22:48, Miller Puckette wrote:
The one bother I've noticed is that, if I commit something, discover a bug, and make another commit to fix that, it appears as two files in the git diff - I can't find any way to erase the intervening commit. I'm learning that 'git commit --amend' sometimes helps me avoid this problem.)
On command that is pretty mindblowing (and sounds like it would work well for your situation) is
git rebase --interactive
- it lets you time travel to re-write/re-organise your commit history, squash commits together, change commits, etc.
in my personal workflow i found this rather unsatisfactory, as i prefer to push sooner rather than later. once a commit is pushed to a remote server (or more general: once the commit has made it to multiple repositories), rewriting history becomes a pain quickly. it's doable, but it complicates things a lot, and i don't fully understand why people are so concerned with having a clean commit history¹.
matters are different, if you submit patches to an upstream (e.g. when I submit a patch to miller) who needs to review the patch (and probably has better use of time than reviewing known-buggy patches that are fixed-in-the-next-commit anyhow).
gfsdmr IOhannes