[PD] object to find closest value in an array

tim vets timvets at gmail.com
Fri Mar 6 17:55:40 CET 2015


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 at 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 at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150306/a34d3a57/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-closestmatch.zip
Type: application/zip
Size: 1282 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150306/a34d3a57/attachment.zip>


More information about the Pd-list mailing list