[PD] list operation

Jack jack at rybn.org
Wed Apr 28 03:13:08 CEST 2010


True, so now it should be OK (patch attached).
I didn't think of this eventuality.
++

Jack



Le mardi 27 avril 2010 à 20:50 -0400, Matt Barber a écrit :
> One thing to watch out for;  if you get two items in the list that are
> equally as far as the test value, mine outputs one list with the value
> replacement at each appropriate index, while Jack's outputs several
> lists with the value replacement at only one index, but each
> replacement sequentially, if that makes any sense.
> 
> So if the test value is 2.02, and the input list is <1 0 3 2 4 3 3 2 0
> 4>, mine will output:
> 
> <1 0 3 2.02 4 3 3 2.02 0 4> as one list, while Jack's gives two lists:
> 
> <1 0 3 2.02 4 3 3 2 0 4>
> <1 0 3 2 4 3 3 2.02 0 4>
> 
> Matt
> 
> On Tue, Apr 27, 2010 at 8:16 PM, Jack <jack at rybn.org> wrote:
> > An alternative. Also full pure-pd.
> > ++
> >
> > Jack
> >
> >
> >
> > Le mardi 27 avril 2010 à 18:49 -0400, Matt Barber a écrit :
> >> Try the attached (threw together using list-abs) -- right inlet is the
> >> value (12 in your example) and left inlet is the list of floats; I
> >> think this follows established list-abs syntax.
> >>
> >> It's possible that I overlooked a list-abs that already does this, and
> >> there is probably a step or two you could skip.
> >>
> >> You might get poor results if the list is a bang or contains symbols.
> >>
> >> Matt
> >>
> >>
> >> > Hello everyone,
> >> >
> >> > I would like to compare all the values in a list with a value of input and
> >> > then decide which is the closest value and replace that value closer to the
> >> > amount of input.
> >> >
> >> > For example, I have a list <2, 10, 35> and have an input value of <12> I
> >> > would like the list as output <2, 12, 35>. I'm almost getting, but the patch
> >> > is so ugly that I will not show here, i'm sure there is a more elegant
> >> > solution. Does anyone have an idea?
> >> > tnx ;)
> >> > -------------- next part --------------
> >> > An HTML attachment was scrubbed...
> >> > URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100427/ac720c09/attachment-0001.htm>
> >> _______________________________________________
> >> Pd-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> >
> >

-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-replace-closest.pd
Type: text/x-puredata
Size: 1279 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100428/f44ff7d7/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-replace-closest-help.pd
Type: text/x-puredata-help
Size: 710 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100428/f44ff7d7/attachment-0001.bin>


More information about the Pd-list mailing list