Hi list,
I've been meaning to make this extern for a long time, and today was the day. It's a table manipulation tool that covers the top items on my table wish-list for now. I'm sure there are plenty more things to add. There is a lot of redundant functionality with list-abs and some with zexy (like table dumping). Here's a link where you can download the extern & source, and a list of functions. It's hot off the press and not tested, so if anyone has time to check it, let me know of bugs and I'll correct them. I hope this ends up being useful for someone besides me...
http://williambrent.conflations.com/pages/research.html#tabletool
Looks like a super useful library. My question to you is why did you
decide to make it a single object with messages for the actions?
IMHO, it should be a library of objects. The library would be called
'tabletool', then instead of messages, they functions would be
objects. Having all the answers to the messages come out the signal
outlet would make it hard to parse the data. They could be something
like the math objects but for tables.
I am thinking something like:
[bang( | [tabletool/mean table-1] |
[bang( | [tabletool/min table-1] |
[10( | [tabletool/equals table-1] |
[0.5( | [tabletool/nearest table-1] |
.hc
On May 13, 2010, at 6:27 PM, William Brent wrote:
Hi list,
I've been meaning to make this extern for a long time, and today was the day. It's a table manipulation tool that covers the top items on my table wish-list for now. I'm sure there are plenty more things to add. There is a lot of redundant functionality with list-abs and some with zexy (like table dumping). Here's a link where you can download the extern & source, and a list of functions. It's hot off the press and not tested, so if anyone has time to check it, let me know of bugs and I'll correct them. I hope this ends up being useful for someone besides me...
http://williambrent.conflations.com/pages/research.html#tabletool
- dumping a table to a list
- reporting the length of a table
- offsetting (adding a constant to all values)
- scaling (multiplying all values by a scalar)
- curve smoothing
- shifting values forward or back by index
- shuffling values randomly
- sorting values low to high
- reversing
- inverting
- normalizing to a specified range
- normalizing so values sum to 1.0
- copying a source table to a target table
- copying a specified range of a source table to a target table
- lacing alternating values from two tables into one table
- table sum
- table mean
- table arithmetic mean
- table geometric mean
- table integration
- table differentiation
- counting occurrences of a value
- index (or multiple indices) of a particular value
-- William Brent www.williambrent.com
“Great minds flock together” Conflations: conversational idiom for the 21st century
www.conflations.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only incidentally
for machines to execute.
Thanks for looking. The multiple object library vs. single multi-function object question is a good one. Personally, it just seems more tidy to me this way, and I don't believe there's any downside to having all the functions packed into one extern. All the memory is allocated per function, so if you only use the sum function, (I think) it shouldn't be significantly different than a separate extern for summing.
There is definitely something more Pd-ish about the multiple objects though. I'm open to changing it... For now I'll start using it and see if I ever have a desire to make it the other way.
On Fri, May 14, 2010 at 8:50 AM, Hans-Christoph Steiner hans@at.or.at wrote:
Looks like a super useful library. My question to you is why did you decide to make it a single object with messages for the actions? IMHO, it should be a library of objects. The library would be called 'tabletool', then instead of messages, they functions would be objects. Having all the answers to the messages come out the signal outlet would make it hard to parse the data. They could be something like the math objects but for tables.
I am thinking something like:
[bang( | [tabletool/mean table-1] |
[bang( | [tabletool/min table-1] |
[10( | [tabletool/equals table-1] |
[0.5( | [tabletool/nearest table-1] |
.hc
On May 13, 2010, at 6:27 PM, William Brent wrote:
Hi list,
I've been meaning to make this extern for a long time, and today was the day. It's a table manipulation tool that covers the top items on my table wish-list for now. I'm sure there are plenty more things to add. There is a lot of redundant functionality with list-abs and some with zexy (like table dumping). Here's a link where you can download the extern & source, and a list of functions. It's hot off the press and not tested, so if anyone has time to check it, let me know of bugs and I'll correct them. I hope this ends up being useful for someone besides me...
http://williambrent.conflations.com/pages/research.html#tabletool
- dumping a table to a list
- reporting the length of a table
- offsetting (adding a constant to all values)
- scaling (multiplying all values by a scalar)
- curve smoothing
- shifting values forward or back by index
- shuffling values randomly
- sorting values low to high
- reversing
- inverting
- normalizing to a specified range
- normalizing so values sum to 1.0
- copying a source table to a target table
- copying a specified range of a source table to a target table
- lacing alternating values from two tables into one table
- table sum
- table mean
- table arithmetic mean
- table geometric mean
- table integration
- table differentiation
- counting occurrences of a value
- index (or multiple indices) of a particular value
-- William Brent www.williambrent.com
“Great minds flock together” Conflations: conversational idiom for the 21st century
www.conflations.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only incidentally for machines to execute. - from Structure and Interpretation of Computer Programs
In this particular setup, I see confusion from not knowing what the
result is a response to. There results are output from the same
outlet and are not labeled in anyway. So if you mistakenly send a
"sum" when you want to get only "mean", you would only get a strange
value and no sign that its a different calculation.
.hc
On May 14, 2010, at 12:17 PM, William Brent wrote:
Thanks for looking. The multiple object library vs. single multi-function object question is a good one. Personally, it just seems more tidy to me this way, and I don't believe there's any downside to having all the functions packed into one extern. All the memory is allocated per function, so if you only use the sum function, (I think) it shouldn't be significantly different than a separate extern for summing.
There is definitely something more Pd-ish about the multiple objects though. I'm open to changing it... For now I'll start using it and see if I ever have a desire to make it the other way.
On Fri, May 14, 2010 at 8:50 AM, Hans-Christoph Steiner
hans@at.or.at wrote:Looks like a super useful library. My question to you is why did
you decide to make it a single object with messages for the actions? IMHO, it
should be a library of objects. The library would be called 'tabletool',
then instead of messages, they functions would be objects. Having all the answers to the messages come out the signal outlet would make it
hard to parse the data. They could be something like the math objects but
for tables.I am thinking something like:
[bang( | [tabletool/mean table-1] |
[bang( | [tabletool/min table-1] |
[10( | [tabletool/equals table-1] |
[0.5( | [tabletool/nearest table-1] |
.hc
On May 13, 2010, at 6:27 PM, William Brent wrote:
Hi list,
I've been meaning to make this extern for a long time, and today was the day. It's a table manipulation tool that covers the top items
on my table wish-list for now. I'm sure there are plenty more things
to add. There is a lot of redundant functionality with list-abs and
some with zexy (like table dumping). Here's a link where you can download the extern & source, and a list of functions. It's hot off the press and not tested, so if anyone has time to check it, let me know of
bugs and I'll correct them. I hope this ends up being useful for someone besides me...http://williambrent.conflations.com/pages/research.html#tabletool
- dumping a table to a list
- reporting the length of a table
- offsetting (adding a constant to all values)
- scaling (multiplying all values by a scalar)
- curve smoothing
- shifting values forward or back by index
- shuffling values randomly
- sorting values low to high
- reversing
- inverting
- normalizing to a specified range
- normalizing so values sum to 1.0
- copying a source table to a target table
- copying a specified range of a source table to a target table
- lacing alternating values from two tables into one table
- table sum
- table mean
- table arithmetic mean
- table geometric mean
- table integration
- table differentiation
- counting occurrences of a value
- index (or multiple indices) of a particular value
-- William Brent www.williambrent.com
“Great minds flock together” Conflations: conversational idiom for the 21st century
www.conflations.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only
incidentally for machines to execute.
- from Structure and Interpretation of Computer Programs
-- William Brent www.williambrent.com
“Great minds flock together” Conflations: conversational idiom for the 21st century
www.conflations.com
"A cellphone to me is just an opportunity to be irritated wherever you
are." - Linus Torvalds
On Fri, 14 May 2010, Hans-Christoph Steiner wrote:
In this particular setup, I see confusion from not knowing what the result is a response to. There results are output from the same outlet and are not labeled in anyway. So if you mistakenly send a "sum" when you want to get only "mean", you would only get a strange value and no sign that its a different calculation.
If you have a [sum] class and a [mean] class that both have a single outlet, and you send a bang to an objectbox in which you mistakenly typed [sum] instead of [mean], you get a value that is just as strange, and not anymore of a sign that it's a different calculation.
The thing is, if you bang a messagebox connected to [tabletool], you have to know your own patch just as much as if you write [tabletool/whatever] as a single box.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Fri, 14 May 2010, William Brent wrote:
Thanks for looking. The multiple object library vs. single multi-function object question is a good one. Personally, it just seems more tidy to me this way,
What's more tidy about it ?
That said, I did combine a lot of math operators together in the [#] objectclass, such that +,-,*,/ and more, are just arguments to [#], like [# +], [# -], [# *], [# /]. however I also used separate classes for different things. The classification criteria were :
the basic computation should be the combination of one number with another number to give another number.
the input should be two grids, the output should be a grid of the same size as the left inlet's grid, and the basic computation will combine together the nth element of the left grid with the nth element of the right grid to produce the nth element of the output grid. (if the right-inlet grid is too small, then we loop through its data as many times as necessary)
Any other kind of computation is to be put in a different objectclass. Some of them also have an argument of the same kind as [#], such that you have [#fold +] vs [#fold *] vs [#fold &] and so on, while you also have [#draw_image +], [#draw_polygon +], [#outer +], and nearly all imaginable variations on it : if [# ^] exists and [#draw_polygon] takes any $1 that [#] can take, then [#draw_polygon ^] exists.
There is definitely something more Pd-ish about the multiple objects though.
It depends. functionality such as "sinesum" is built into Pd as a method instead of a class.
The fact is, a class-centric design is preferred for its ease of use, while a method-centric design is preferred for its ease of use, but it's not the same ease of use. There is no way to design things, that has all advantages at once.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
What's more tidy about it ?
You're right - not much. If you wanted the mean, sum, and length of a table, it would be 3 message boxes and one [tabletool]. Otherwise it would be 3 bangs and 3 instances of [tabltool/whatever]. Not a big difference. I guess in this case I just lean toward the method-centric side as you point out. And your point about "sinesum" is exactly where my leaning comes from. You can send "sinesum" "write" "read" "const" "resize" to a table, so there's already a history of methods there.
On Fri, 14 May 2010, William Brent wrote:
What's more tidy about it ?
You're right - not much.
That question is a question, not an affirmation.
You can send "sinesum" "write" "read" "const" "resize" to a table, so there's already a history of methods there.
Just because there is a precedent, doesn't mean that the precedent is good. I don't think that a precedent is automatically a worthwhile justification in designing things. But if you talking about whether there is a precedent in Pd (or whether something is "Pd-like"), then I can find a precedent like that.
Now if you want to know what model I would favour, I tend to prefer having anonymous arrays flying around in messages as if they were lists or floats, and then have many classes rather than many methods, but use methods to configure the objects in order to maximise their flexibility, and remove unnecessary distinctions.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
What's more tidy about it ?
You're right - not much.
That question is a question, not an affirmation.
I guess when you asked, I just realized there wasn't much difference. :)
The classes for functionality/methods for config logic makes sense to me too. I'll keep thinking about this as I use it in its current state...