I tried to make DLLs of nrepeat and nnrepeat, but it seems I'm too ignoramus to find out how to proceed, I've entered those lines in the msys shell
gcc -c nrepeat.c -o nrepeat.o
ld -export_dynamic -shared -I../../pd/src/ -o nrepeat.dll nrepeat.o ../../pd/bin/pd.dll
the external is built without error, but couldn't be created:
\extra\nnrepeat.dll: couldn't load nnrepeat 1
the verbose option gives messages I've pain to interpret.
I've also tried to write a Makefile, it's attached, it does the same thing
Claude Heiland-Allen a écrit :
Hi everyone,
I've been playing around with recursion in Gem, and thought I'd document my experiences.
You can download the patches here (Gzip'd Tar):
https://devel.goto10.org/dl.php?repname=maximus&path=%2Ftutorials%2Fgem-...
You will also need a couple of externals that you can download here (Gzip'd Tar, C source code only):
https://devel.goto10.org/dl.php?repname=maximus&path=%2Fclodlib%2F&r...
These externals are necessary because I haven't figured out a nice way to handle recursive re-entrancy in a Pd patch. If I do I'll update the tutorial with the dependancy removed.
Screenshots are here, in case you're not near a computer with Pd+Gem:
http://www.blurty.com/users/claudiusmaximus/day/2007/07/18#407
Please let me know if you find it useful, or if you don't. Thanks for your attention,
Claude
# clodlib -- miscellaneous objects for Pd # Copyright (C) 2007 Claude Heiland-Allen claudiusmaximus@goto10.org # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
CFLAGS = --verbose -O2 -export_dynamic -shared -I../../pd/src/ PDDLL = ../../pd/bin/pd.dll
#
all: nrepeat.dll nnrepeat.dll
clean: rm -f nrepeat.dll nnrepeat.dll #
nrepeat.dll: nrepeat.c Makefile gcc -c nrepeat.c -o nrepeat.o && ld $(CFLAGS) -o nrepeat.dll nrepeat.o $(PDDLL)
nnrepeat.dll: nnrepeat.c Makefile gcc -c nnrepeat.c -o nnrepeat.o && ld $(CFLAGS) -o nnrepeat.dll nnrepeat.o $(PDDLL)
# EOF
Patrice Colet wrote:
I tried to make DLLs of nrepeat and nnrepeat, but it seems I'm too ignoramus to find out how to proceed, I've entered those lines in the msys shell
i haven't had a look at the tutorial files, but i was wondering why you couldn't build [nrepeat] (i haen't seen [nnrepeat] on the website, so i don't know what it does) with [repeat] or with the [s]/[r] idiom claude has proposed.
see attached patch for a solution using zexy's [repeat].
mfgasdr IOhannes
#N canvas 328 242 450 300 10; #X obj 84 52 inlet; #X obj 84 75 t a b; #X obj 84 103 repeat $1; #X obj 84 144 t a b; #X obj 114 164 i; #X obj 144 204 + 1; #X obj 114 183 t f f; #X obj 114 232 outlet counter; #X obj 84 251 outlet count; #X msg 132 144 0; #X obj 142 52 inlet repititions; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 1 1 9 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 4 0; #X connect 4 0 6 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 5 0; #X connect 9 0 4 1; #X connect 10 0 2 1;
Well, thanks, it's not even ignorance it's blindness, the solution is so simple that I didn't figure it out, you save me hours of tries with several compilers.
PS: nmake15 used with mingw gcc just gave me dll that doesn't load too, so the problem rather come from mingw/gcc or ld.
IOhannes m zmoelnig a écrit :
Patrice Colet wrote:
I tried to make DLLs of nrepeat and nnrepeat, but it seems I'm too ignoramus to find out how to proceed, I've entered those lines in the msys shell
i haven't had a look at the tutorial files, but i was wondering why you couldn't build [nrepeat] (i haen't seen [nnrepeat] on the website, so i don't know what it does) with [repeat] or with the [s]/[r] idiom claude has proposed.
see attached patch for a solution using zexy's [repeat].
mfgasdr IOhannes
#N canvas 328 242 450 300 10; #X obj 84 52 inlet; #X obj 84 75 t a b; #X obj 84 103 repeat $1; #X obj 84 144 t a b; #X obj 114 164 i; #X obj 144 204 + 1; #X obj 114 183 t f f; #X obj 114 232 outlet counter; #X obj 84 251 outlet count; #X msg 132 144 0; #X obj 142 52 inlet repititions; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 1 1 9 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 4 0; #X connect 4 0 6 0; #X connect 5 0 4 1; #X connect 6 0 7 0; #X connect 6 1 5 0; #X connect 9 0 4 1; #X connect 10 0 2 1;
IOhannes m zmoelnig wrote:
i haven't had a look at the tutorial files, but i was wondering why you couldn't build [nrepeat] (i haen't seen [nnrepeat] on the website, so i don't know what it does) with [repeat] or with the [s]/[r] idiom claude has proposed.
see attached patch for a solution using zexy's [repeat].
Yes, that is what I tried too. But it doesn't work -- it fails with re-entrancy bugs when recursion is used.
See attached test patch.
With max-depth 3, repetitions 2:
My [nrepeat] external outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 3 1 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1
Your [nrepeat-abs] abstraction outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 3 2 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1
With max-depth 3, repetitions 3:
My [nrepeat] external outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 1 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 2 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2
Your [nrepeat-abs] abstraction outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 3 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 3 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2
mfgasdr IOhannes
Thanks,
Claude
#N canvas 0 0 481 517 10; #X obj 71 95 r $0-recurse; #X obj 71 380 s $0-recurse; #X obj 108 260 t b a b; #X obj 192 280 v $0-depth; #X obj 192 300 - 1; #X obj 192 320 max 0; #X obj 130 340 spigot; #X obj 192 340 v $0-depth; #X obj 166 160 t b f; #X obj 166 183 v $0-depth; #X obj 166 208 pack f f; #X obj 165 239 print nrepeat; #X obj 108 280 v $0-depth; #X obj 108 320 v $0-depth; #X obj 108 300 + 1; #X obj 108 50 t a b; #X msg 108 21 nrepeat test; #X obj 285 108 v $0-depth; #X floatatom 262 77 5 0 0 2 max-depth - -; #X floatatom 261 38 5 0 0 2 repetitions - -; #X obj 246 108 f 3; #X obj 108 135 nrepeat 2; #X connect 0 0 21 0; #X connect 2 0 12 0; #X connect 2 1 6 0; #X connect 2 2 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 6 1; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 8 0 9 0; #X connect 8 1 10 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 12 0 14 0; #X connect 14 0 13 0; #X connect 15 0 21 0; #X connect 15 1 20 0; #X connect 16 0 15 0; #X connect 18 0 20 1; #X connect 19 0 21 1; #X connect 20 0 17 0; #X connect 21 0 2 0; #X connect 21 1 8 0;