I'm wondering if there's an object that can find in an array which is the closest value in the array ro an input value.
Say I have an array/list of *1.1* , *2.2* , *3.3*, then I give as the input the number "3" and the object outputs *3.3*
I've done this as a patch already, but I wonder if theres any solution that's "ready made".
thanks
There's the "nearest" method for tabletool if you can deal with an external rather than an abstraction.
On Friday, March 6, 2015, Alexandre Torres Porres porres@gmail.com wrote:
I'm wondering if there's an object that can find in an array which is the closest value in the array ro an input value.
Say I have an array/list of *1.1* , *2.2* , *3.3*, then I give as the input the number "3" and the object outputs *3.3*
I've done this as a patch already, but I wonder if theres any solution that's "ready made".
thanks
Alternatively, if it's more convenient to put the values in a "text" object, you can "text search" for the nearest value.
cheers Miller
On Fri, Mar 06, 2015 at 11:44:57AM -0300, Alexandre Torres Porres wrote:
I'm wondering if there's an object that can find in an array which is the closest value in the array ro an input value.
Say I have an array/list of *1.1* , *2.2* , *3.3*, then I give as the input the number "3" and the object outputs *3.3*
I've done this as a patch already, but I wonder if theres any solution that's "ready made".
thanks
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Here's an abstraction I made a while ago. It's was aimed mainly at finding the closest note in a musical scale, but it's probably easy to make it more general. it uses some objects from list-abs gr, Tim
2015-03-06 17:21 GMT+01:00 Miller Puckette msp@ucsd.edu:
Alternatively, if it's more convenient to put the values in a "text" object, you can "text search" for the nearest value.
cheers Miller
On Fri, Mar 06, 2015 at 11:44:57AM -0300, Alexandre Torres Porres wrote:
I'm wondering if there's an object that can find in an array which is the closest value in the array ro an input value.
Say I have an array/list of *1.1* , *2.2* , *3.3*, then I give as the
input
the number "3" and the object outputs *3.3*
I've done this as a patch already, but I wonder if theres any solution that's "ready made".
thanks
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list