preferably without using externals, can anyone tell me how to do this:
input: 0, 3, 5, 10
output: 1, 2, 3, 4
input: 10, 5, 3, 0
output: 4, 3, 2, 1
input: 10, 3, 0, 5
output: 4, 2, 1, 3
even with externals is ok i guess.
i have spent about 4 hours on this, and i am starting to tear my hair out.
blimey.
aaargghhh. i still have no idea how to compile externals from source, so i have only got the older version of [sort] ...however, the newer one with the indices is EXACTLY what i need.
does anyone have the [sort] object as a file with a .pd_darwin extension?
alos, how do i go about learning how to compile from source? i have found bits and pieces by searching the net, but it's all pretty hard for me to understand.
There is no generic way to compile source code. Sometimes the compiler is invoked directly, but usually there is some scripting system such as make or scons.
Very common (on unixes):
./configure (builds the correct Makefile for your system) make (runs the relevant build commands in the Makefile) make install (places the compiled files in the correct directories; usually you must be root to do this)
for this you will need the make utility and a compiler installed.
Also becoming more popular is scons:
scons scons install (usually as root)
for this you will need Python and a compiler installed.
An easy way to install _all_ the externals from the CVS is:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pure-data co - P externals
cd externals/build scons sudo scons install
To checkout an individual library or external,simply:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pure-data co - P externals/external_or_library_name
cd externals/externals_or_library_name
Then read the README or install instructions. For zexy on *n*x it is
cd src autoconf (for this you will need the autoconf utility installed) ./configure make sudo make install
If none of this works for you let me know, let me know and I'll send you the binary this afternoon.
Gosh! Did I just write a mini how-to?
Jamie
On Fri, 2005-10-21 at 17:50 +0900, hard off wrote:
aaargghhh. i still have no idea how to compile externals from source, so i have only got the older version of [sort] ...however, the newer one with the indices is EXACTLY what i need.
does anyone have the [sort] object as a file with a .pd_darwin extension?
alos, how do i go about learning how to compile from source? i have found bits and pieces by searching the net, but it's all pretty hard for me to understand.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Oct 21, 2005, at 5:47 AM, Jamie Bullock wrote:
Very common (on unixes):
./configure (builds the correct Makefile for your system) make (runs the relevant build commands in the Makefile) make install (places the compiled files in the correct directories; usually you must be root to do this)
Um. What if there is no configure and worse, no configure.ac (which you use autoconf with ??)
There is no generic way to compile source code.
For *.pd_darwin ??
For this instance, I would suggest the following Makefile:
NAME=sort CSYM=sort
current: pd_darwin
pd_darwin: $(NAME).pd_darwin
.SUFFIXES: .pd_darwin
DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes
-Wno-unused -Wno-parentheses -Wno-switch
.c.pd_darwin: #./tk2c.bash < $*.tk >$*.tk2c cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o rm -f $*.o ../$*.pd_darwin ln -s $*/$*.pd_darwin ..
clean: rm -f *.o *.pd_* so_locations
Easy as that ?? I've used this Makefile for everything from the IOhannes tutorials to recently the iemmatrix.pd_darwin from CVS. Quite generic indeed.
-D5
ok, yeah that's the one i found.
quick question:
where it says:
(NAME)
and then (DARWINCFLAGS) (LINUXINCLUDE)
do i have to put in a name, or do i just apply the makefile exactly as you pasted it?
On Oct 21, 2005, at 9:49 AM, hard off wrote:
do i have to put in a name, or do i just apply the makefile exactly as you pasted it?
The Makefile I posted will work if it's in the same directory as sort.c and you're building an external called [sort].
It would be different for say csoundapi~ which it would be
NAME=csoundapi~ CSYM=csoundapi_tilde
where you reference differently in the source code itself.
-D5
Has anyone gotten the pdp_opengl lib to work with the proprietary nvidia graphics drivers?
Everything works fine for me using the generic nv driver plus
the standard linux software opengl support.
But when I switch to the nvidia drivers, windows are drawn but nothing appears in them. No errors are thrown to the console. If I try to use 3dp_snap image ==> pdp_glx, pd segfaults.
I'd love to get this working with the nvidia drivers -- they improve opengl performance (according to glxgears) significantly.
Is there any hope here?
--rob
i had a problem with these drivers too. may be completely unrelated without knowing much about your specific problems i can let you know that i changed the depth from 16 bits to 24 in my xorg.conf and it fired up nicely. i still don't know why this helped me, it was a conclusion from a long series of 'trails and errors'.
t
On 10/22/05, rob switzer rswitzer@721.com wrote:
Has anyone gotten the pdp_opengl lib to work with the proprietary nvidia graphics drivers?
Everything works fine for me using the generic nv driver plus the standard linux software opengl support.
But when I switch to the nvidia drivers, windows are drawn but nothing appears in them. No errors are thrown to the console. If I try to use 3dp_snap image ==> pdp_glx, pd segfaults.
I'd love to get this working with the nvidia drivers -- they improve opengl performance (according to glxgears) significantly.
Is there any hope here?
--rob
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hi rob
nvidia prop driver and 3dp works fine&fast for me so there is hope :) is it just crashing when you do 3dp_snap image? and black pdp window without it?
p
Quoting rob switzer rswitzer@721.com:
Has anyone gotten the pdp_opengl lib to work with the proprietary nvidia graphics drivers?
Everything works fine for me using the generic nv driver plus the standard linux software opengl support.
But when I switch to the nvidia drivers, windows are drawn but nothing appears in them. No errors are thrown to the console. If I try to use 3dp_snap image ==> pdp_glx, pd segfaults.
I'd love to get this working with the nvidia drivers -- they improve opengl performance (according to glxgears) significantly.
Is there any hope here?
--rob
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
This message was sent using IMP, the Internet Messaging Program.
On Sun, 2005-10-23 at 18:02 +0200, moghamir@fadaiat.net wrote:
hi rob
nvidia prop driver and 3dp works fine&fast for me so there is hope :)
great!
is it just crashing when you do 3dp_snap image? and black pdp window without it?
yes. with primary display resolution set to 1152x864, 3dp_snap causes a crash. with primary display resolution set to 1024x768, pdp windows are still black, but no crash takes place.
I'd love to see your xorg.conf. could you send me a copy?
thx
--rob
p
Quoting rob switzer rswitzer@721.com:
Has anyone gotten the pdp_opengl lib to work with the proprietary nvidia graphics drivers?
Everything works fine for me using the generic nv driver plus the standard linux software opengl support.
But when I switch to the nvidia drivers, windows are drawn but nothing appears in them. No errors are thrown to the console. If I try to use 3dp_snap image ==> pdp_glx, pd segfaults.
I'd love to get this working with the nvidia drivers -- they improve opengl performance (according to glxgears) significantly.
Is there any hope here?
--rob
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
This message was sent using IMP, the Internet Messaging Program.
I *downgraded* my nvidia drivers from version 1.0-7667 to version 1.0-6629, and all is well.
Thanks to everyone who sent me xorg.conf files and other suggestions.
--rob
On Sun, 2005-10-23 at 12:33 -0400, rob switzer wrote:
On Sun, 2005-10-23 at 18:02 +0200, moghamir@fadaiat.net wrote:
hi rob
nvidia prop driver and 3dp works fine&fast for me so there is hope :)
great!
is it just crashing when you do 3dp_snap image? and black pdp window without it?
yes. with primary display resolution set to 1152x864, 3dp_snap causes a crash. with primary display resolution set to 1024x768, pdp windows are still black, but no crash takes place.
I'd love to see your xorg.conf. could you send me a copy?
thx
--rob
p
Quoting rob switzer rswitzer@721.com:
Has anyone gotten the pdp_opengl lib to work with the proprietary nvidia graphics drivers?
Everything works fine for me using the generic nv driver plus the standard linux software opengl support.
But when I switch to the nvidia drivers, windows are drawn but nothing appears in them. No errors are thrown to the console. If I try to use 3dp_snap image ==> pdp_glx, pd segfaults.
I'd love to get this working with the nvidia drivers -- they improve opengl performance (according to glxgears) significantly.
Is there any hope here?
--rob
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
This message was sent using IMP, the Internet Messaging Program.
Hi all,
i just installed the Pd version 0.38.4-extended-RC2
i wanna try with GEM and taste some grafics ideas for my music,
where can i download a compiled GEM?
I puted in my extras folder one gen_darwin but it doesnt work...
thank you.
Ps: where can i find a good tutorial for GEM?
Hi,
As far I as know, GEM is already included in Hans' app that you are
running.
The binary should be in the extra folder.
There are good help files included as well in
doc/GEM
also you may want to look at:
http://taproot.dyndns.org/~cgc/tutorial_gem/index.html
and do some googling for more.
Best, p
On Oct 23, 2005, at 1:28 PM, josue moreno wrote:
Hi all,
i just installed the Pd version 0.38.4-extended-RC2
i wanna try with GEM and taste some grafics ideas for my music,
where can i download a compiled GEM?
I puted in my extras folder one gen_darwin but it doesnt work...
thank you.
Ps: where can i find a good tutorial for GEM?
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
And maybe www.ekran.org/pd
b.
Hi,
As far I as know, GEM is already included in Hans' app that you are running. The binary should be in the extra folder. There are good help files included as well in doc/GEM
also you may want to look at:
http://taproot.dyndns.org/~cgc/tutorial_gem/index.html
and do some googling for more.
Best, p
On Oct 23, 2005, at 1:28 PM, josue moreno wrote:
Hi all,
i just installed the Pd version 0.38.4-extended-RC2
i wanna try with GEM and taste some grafics ideas for my music,
where can i download a compiled GEM?
I puted in my extras folder one gen_darwin but it doesnt work...
thank you.
Ps: where can i find a good tutorial for GEM?
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
As far I as know, GEM is already included in Hans' app that you are
running. The binary should be in the extra folder. There are good help files included as well in doc/GEM
ok, i have Gem_darwin in my extra folder, but i havent any doc/GEM and when i type gemwin or another gem object like square or so, it said: couldnt create
dont know what is happening, im in a Mac OS X 10.3.9 G4 with Hans compiled 0.38 extended
the tutorials are good but i cant use any gem object, it said that i have to type some directory in somewhere....
can anybody explain it to me like a really beginer? sorry and thanks
Hi,
start PD. go to PD Preferences Menu and choose Startup... make sure the GEM is there. if not, type it into one of the boxes. click on save all settings and OK, close PD and restart. Watch the Pd window at start up, you should see something like this: GEM: Graphics Environment for Multimedia GEM: ver: 0.90 GEM: compiled: Apr 13 2005 GEM: maintained by IOhannes m zmoelnig GEM: Authors : Mark Danks (original version on irix/windows) GEM: Chris Clepper (macOS-X) GEM: Daniel Heckenberg (windows) GEM: James Tittle (macOS-X) GEM: IOhannes m zmoelnig (linux/windows)
"Show package contents" goto Contents/Resources/doc and you will find the Gem folder.
Best, p
On Oct 23, 2005, at 3:05 PM, josue moreno wrote:
As far I as know, GEM is already included in Hans' app that you are
running. The binary should be in the extra folder. There are good help files included as well in doc/GEM
ok, i have Gem_darwin in my extra folder, but i havent any doc/GEM
and when i type gemwin or another gem object like square or so, it
said: couldnt createdont know what is happening, im in a Mac OS X 10.3.9 G4 with Hans
compiled 0.38 extendedthe tutorials are good but i cant use any gem object, it said that
i have to type some directory in somewhere....can anybody explain it to me like a really beginer? sorry and thanks
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
I have often had the problem that Hans' application does not load the Gem, zexy and OSC libraries auomatically. So I have found that inserting a Gem object often does the trick. the object is not found, but in the process of looking for it, Pd loads the Gem library.
this isn't a problem with the PixelTango installation, for some reason that I do not understand. They appear pretty much identical, from their structure....
cheers,
tim
On Oct 23, 2005, at 9:05 PM, josue moreno wrote:
As far I as know, GEM is already included in Hans' app that you are
running. The binary should be in the extra folder. There are good help files included as well in doc/GEM
ok, i have Gem_darwin in my extra folder, but i havent any doc/GEM and when i type gemwin or another gem object like square or so, it said: couldnt create
dont know what is happening, im in a Mac OS X 10.3.9 G4 with Hans compiled 0.38 extended
the tutorials are good but i cant use any gem object, it said that i have to type some directory in somewhere....
can anybody explain it to me like a really beginer? sorry and thanks
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
----- Tim Boykett TIME'S UP::Research Department \ / Industriezeile 33b A-4020 Linz Austria X +43-732-787804(ph) +43-732-7878043(fx) / \ tim@timesup.org http://www.timesup.org
Yea!, thats the solution!!!
now it works!
cheers guys you are great!
day 5 wrote:
On Oct 21, 2005, at 5:47 AM, Jamie Bullock wrote:
Very common (on unixes):
./configure (builds the correct Makefile for your system) make (runs the relevant build commands in the Makefile) make install (places the compiled files in the correct directories; usually you must be root to do this)
Um. What if there is no configure and worse, no configure.ac (which you use autoconf with ??)
then look out for configure.in. else, you obviously cannot use the autotools.
There is no generic way to compile source code.
For *.pd_darwin ??
what does this question mean ? in which respect is the compilation process into pd_darwin different from the one i use to build dll's ???
tutorials to recently the iemmatrix.pd_darwin from CVS. Quite generic indeed.
what is wrong with the autoconf-build in iemmatrix ? i use it for compiling binaries for w32, linux and osX and it works fine.
i use autoconf for compiling both zexy and Gem under osX and linux too.
as for not knowing how to build a special external, i would strongly suggest reading files like README.txt, README.build, INSTALL.txt and so on. most of the times, you can find a lot of valuable information in there.
mfg.asd.r IOhannes
On Oct 21, 2005, at 10:45 AM, IOhannes m zmoelnig wrote:
what is wrong with the autoconf-build in iemmatrix ? i use it for compiling binaries for w32, linux and osX and it works fine.
From CVS on Tuesday of this week it had an error trying to instantiate a strip command from the commandline after compiling the object files into the .pd_darwin extension.
i use autoconf for compiling both zexy and Gem under osX and linux too.
Yes this worked, it was only at the end of the process it errored out. It was fixed just by running another shell script that did not use the strip command.
-d5
day 5 wrote:
On Oct 21, 2005, at 10:45 AM, IOhannes m zmoelnig wrote:
what is wrong with the autoconf-build in iemmatrix ? i use it for compiling binaries for w32, linux and osX and it works fine.
From CVS on Tuesday of this week it had an error trying to instantiate a strip command from the commandline after compiling the object files into the .pd_darwin extension.
hmm, i _think_ i have fixed this some days ago, but i thought it would have been about a week ago, so the tuesday CVS checkout should have been fine. did you re-run configure after your checkout ?
mfg.a.dsr IOhannes
On Fri, 2005-10-21 at 08:45 -0400, day 5 wrote:
On Oct 21, 2005, at 5:47 AM, Jamie Bullock wrote:
Very common (on unixes):
./configure (builds the correct Makefile for your system) make (runs the relevant build commands in the Makefile) make install (places the compiled files in the correct directories; usually you must be root to do this)
Um. What if there is no configure and worse, no configure.ac (which you use autoconf with ??)
Well, that reminds me; I forgot to add that in cases where a Makefile is included, but no configure script, it is usually necessary to 'personalise' the Makefile manually. As IOhannes infers, there is usually an INSTALL.txt, README, or other useful instructions. If there is insufficient documentation provided to enable someone to work out the compile process, I think there are grounds to ask the developer for guidance.
<snip> > > > Easy as that ?? I've used this Makefile for everything from the > IOhannes tutorials to recently the iemmatrix.pd_darwin from CVS. Quite > generic indeed. >
Yes, this is a fine solution. However, I think that ad hoc solutions like this should be avoided, because by not using the developer's own build system, you are working around possible errors. Errors, which should they exist are better reported and fixed than avoided.
Jamie
Jamie Bullock wrote:
Well, that reminds me; I forgot to add that in cases where a Makefile is included, but no configure script, it is usually necessary to 'personalise' the Makefile manually. As IOhannes infers, there is usually an INSTALL.txt, README, or other useful instructions. If there is insufficient documentation provided to enable someone to work out the compile process, I think there are grounds to ask the developer for guidance.
i totally agree. while i have written that normally there are README, INSTALL.txt and the like around, it is a sad fact, that often they are missing.
Yes, this is a fine solution. However, I think that ad hoc solutions like this should be avoided, because by not using the developer's own build system, you are working around possible errors. Errors, which should they exist are better reported and fixed than avoided.
i totally agree too (although i am not that innocent in that respect, like when it comes to the unfixed configure in Gem (fixed in CVS but not in the last release)
mfg.adsr IOhannes
On Fri, 21 Oct 2005, hard off wrote:
preferably without using externals, can anyone tell me how to do this:
If it's going to be for any possible list length, good luck without externals. Else, with -lib gridflow:
| [#grade] | [# + 1] | [#export_list] |
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju Freelance Digital Arts Engineer, Montréal QC Canada
Forgot all that. You don't need externals. PD already does exactly this.
What you're doing is mapping one set of numbers to another:
0 -> 1 3 -> 2 5 -> 3 10 -> 4
The left-hand column is a table index, the right hand column is the value at that index. Try setting up a table with a message like [my-tab 0 1 1 1 2 2 3 3 3 3 3 4( -- then tabread the values of that table with the index 1 through 4. You'll get exactly the result you're looking for.
Alternatively, you could do this:
| [sel 0 3 5 10] | | | | [1( [2( [3( [4(
Hope this helps!
David
homepage: http://www.davidgolightly.net
From: Mathieu Bouchard matju@artengine.ca To: hard off hard.off@gmail.com CC: pd list pd-list@iem.at Subject: Re: [PD] ordered numbers Date: Fri, 21 Oct 2005 05:24:26 -0400 (EDT)
On Fri, 21 Oct 2005, hard off wrote:
preferably without using externals, can anyone tell me how to do this:
If it's going to be for any possible list length, good luck without externals. Else, with -lib gridflow:
| [#grade] | [# + 1] | [#export_list] |
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju Freelance Digital Arts Engineer, Montréal QC Canada
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
david golightly wrote:
Forgot all that. You don't need externals. PD already does exactly this. What you're doing is mapping one set of numbers to another:
0 -> 1 3 -> 2 5 -> 3 10 -> 4
....
well, the subject of the mail was about "ordered" numbers, so i thought about sorting arbitrary numbers, not a fixed set. if you have a fixed set of numbers and want to do a mapping between those, your solution is surely the preferred way to go.
mfg.asdr IOhannes
yeah , they're changing all the time.
but i will always have only for numbers. going to the beach today, and i'll see how i go with compiling the new zexy lib tonight. thanks for everyone's advice on the makefiles, etc. still a bit cloudy, but hopefully i'll fiigure it out.
hard off wrote:
yeah , they're changing all the time.
but i will always have only for numbers. going to the beach today,
if you have a constant list length you can do it with abstractions. attached is an example for 4-element lists (but you can modify it to work with longer lists)
pd>=0.39 needed for the wonderful [list] object. (although it can be built without it it was far more fun to do it with it)
the indices are 0..(n-1) to be compatible with zexy's [sort].
mfga.sdr. IOhannes
#N canvas 238 433 420 362 10; #X obj 151 234 sort4; #X obj 181 265 print index; #X obj 151 291 print sorted; #X obj 151 174 pack 0 0 0 0; #X obj 151 200 t l l; #X obj 205 219 print unsorted; #X obj 230 145 random 100; #X obj 203 125 random 100; #X obj 151 145 random 100; #X obj 177 105 random 100; #X obj 151 78 t b b b b; #X msg 151 56 bang; #X connect 0 0 2 0; #X connect 0 1 1 0; #X connect 3 0 4 0; #X connect 4 0 0 0; #X connect 4 1 5 0; #X connect 6 0 3 3; #X connect 7 0 3 2; #X connect 8 0 3 0; #X connect 9 0 3 1; #X connect 10 0 8 0; #X connect 10 1 9 0; #X connect 10 2 7 0; #X connect 10 3 6 0; #X connect 11 0 10 0;
#N canvas 327 273 358 459 10; #X obj 55 109 inlet; #X obj 55 375 outlet; #X obj 55 132 unpack 0 0 0 0; #X obj 55 352 pack 0 0 0 0; #X obj 205 375 outlet; #X obj 205 352 pack 0 0 0 0; #X obj 55 313 unpack; #X obj 105 313 unpack; #X obj 155 313 unpack; #X obj 205 313 unpack; #X obj 55 205 sort_header; #X msg 55 156 $1 0; #X msg 127 177 $1 1; #X msg 145 156 $1 2; #X msg 217 177 $1 3; #X obj 145 205 sort_header; #X obj 127 231 sort_header; #X obj 55 255 sort_header; #X obj 145 257 sort_header; #X obj 127 285 sort_header; #X connect 0 0 2 0; #X connect 2 0 11 0; #X connect 2 1 12 0; #X connect 2 2 13 0; #X connect 2 3 14 0; #X connect 3 0 1 0; #X connect 5 0 4 0; #X connect 6 0 3 0; #X connect 6 1 5 0; #X connect 7 0 3 1; #X connect 7 1 5 1; #X connect 8 0 3 2; #X connect 8 1 5 2; #X connect 9 0 3 3; #X connect 9 1 5 3; #X connect 10 0 17 0; #X connect 10 1 16 0; #X connect 11 0 10 0; #X connect 12 0 10 1; #X connect 13 0 15 0; #X connect 14 0 15 1; #X connect 15 0 16 1; #X connect 15 1 18 1; #X connect 16 0 17 1; #X connect 16 1 18 0; #X connect 17 0 6 0; #X connect 17 1 19 0; #X connect 18 0 19 1; #X connect 18 1 9 0; #X connect 19 0 7 0; #X connect 19 1 8 0;
#N canvas 0 0 484 376 10; #X obj 131 85 inlet; #X obj 131 326 outlet; #X obj 276 326 outlet; #X obj 131 137 t f l; #X obj 221 85 inlet; #X obj 221 137 t f l; #X obj 131 177 >; #X obj 131 207 select 0 1; #X obj 131 239 t b b; #X obj 131 261 list; #X obj 166 261 list; #X obj 241 233 t b b; #X obj 241 255 list; #X obj 276 255 list; #X text 36 17 outputs the 2 incoming lists based on the "head"s (1st element) of the lists. the list with the greater head is output on the right side , the one with the lesser head goes to the left side. ; #X connect 0 0 3 0; #X connect 3 0 6 0; #X connect 3 1 9 1; #X connect 3 1 13 1; #X connect 4 0 5 0; #X connect 5 0 6 1; #X connect 5 1 10 1; #X connect 5 1 12 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 1 11 0; #X connect 8 0 9 0; #X connect 8 1 10 0; #X connect 9 0 1 0; #X connect 10 0 2 0; #X connect 11 0 12 0; #X connect 11 1 13 0; #X connect 12 0 1 0; #X connect 13 0 2 0;
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
well, the subject of the mail was about "ordered" numbers, so i thought about sorting arbitrary numbers, not a fixed set. if you have a fixed set of numbers and want to do a mapping between those, your solution is surely the preferred way to go.
However if you use the old zexy sort, you can get at the indices using the table-map approach as well. If you have four numbers in a vector x, that is x[0],x[1],x[2],x[3], and if you then sort this, you are in fact looking for the position, that each element in the sorted list, had in the unsorted input vector x.
A very simple approach would be to store vector x into a table, then for each element of the result list, look for the position of this element by walking through [table x], compare every x[i] for equality with the current output element, and store its "i"ndex.
Attached patch illustrates this. It's a bit complicated, uses [list] again but only to do what [drip] does. For simplicity table length is assumend to be 4, however with resizing tables etc. it could be made to work for a changing number of input floats as well.
Known bug: It fails, if the same input number occurs twice or more.
Frank Barknecht _ ______footils.org_ __goto10.org__