I had to hack a couple of other's pd source code for it to work on my project. Here is Gunter's shell with a pd-darwin makefile - it has both outlets unlike the wonk version. Also, Johannes' makesymbol from zexy - all I did was add a 1, but it can handle symbols of more than 80 characters.
Best, Ed
-> -> --> ---> -----> --------> -------------> r3search + praktik EK5perimenz
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
/******************************************************
******************************************************/
/* (l) 1210:forum::für::umläute:1999
"makesymbol" is something between "symbol" and "makefilename", thus storing and creating (formatted) symbols...
*/
#include "zexy.h"
#include <string.h> #include <stdio.h>
#define MAXSTRINGARGS 10 #define MAXSTRINGLENG 180
/* ----------------------- makesymbol --------------------- */
static t_class *makesymbol_class;
typedef struct _makesymbol { t_object x_obj; t_symbol *x_sym;
char* mask;
char* buf;
} t_makesymbol;
static void reset_mask(t_makesymbol *x, t_symbol *s) { if (*s->s_name) { x->mask = s->s_name; x->x_sym = s; } else { x->mask = "%s%s%s%s%s%s%s%s%s%s"; x->x_sym = gensym(""); } }
t_symbol* list2symbol(char *masque, int argc, t_atom *argv) { typedef char cstring[MAXSTRINGLENG];
cstring buf[MAXSTRINGARGS];
cstring buffer;
int i;
for(i=0; i<MAXSTRINGARGS; i++)*buf[i]=0;
for (i=0; i<argc; i++) {
atom_string(argv+i, buf[i], MAXSTRINGLENG);
}
sprintf(buffer,
masque,
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9]);
return (gensym(buffer));
}
static void makesymbol_list(t_makesymbol *x, t_symbol *s, int argc, t_atom *argv) { x->x_sym = list2symbol(x->mask, argc, argv); outlet_symbol(x->x_obj.ob_outlet, x->x_sym); }
static void makesymbol_bang(t_makesymbol *x) { outlet_symbol(x->x_obj.ob_outlet, x->x_sym); }
static void *makesymbol_new(t_symbol *s, int argc, t_atom *argv) { t_makesymbol *x = (t_makesymbol *)pd_new(makesymbol_class);
x->buf = (char *)getbytes(MAXSTRINGLENG * sizeof(char));
x->mask = x->buf;
if (argc) {
atom_string(argv, x->buf, MAXSTRINGLENG);
x->x_sym = gensym(x->buf);
} else {
x->mask = "%s%s%s%s%s%s%s%s%s%s";
x->x_sym = gensym("");
}
outlet_new(&x->x_obj, &s_symbol);
inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("sym1"));
return (x);
}
static void makesymbol_free(t_makesymbol *x) { freebytes(x->buf, MAXSTRINGLENG*sizeof(char)); }
static void helper(t_makesymbol *x) { post("\n%c makesymbol :: create a formatted symbol", HEARTSYMBOL); post("<list of anything>\t: glue up to 10 list-elements to 1 formatted symbol\n" "'bang'\t\t\t: re-output\n" "'help'\t\t\t: view this" "\ninlet2 : <format-string>: new format-string (symbol !)" "\noutlet : <symbol>\t: formatted concatenation"); post("\ncreation:"makesymbol [<format-string>]": C-style format-string (%s only)", "%s");
post("\n\nmasq = %s", x->mask); }
void makesymbol_setup(void) { makesymbol_class = class_new(gensym("makesymbol"), (t_newmethod)makesymbol_new, (t_method)makesymbol_free, sizeof(t_makesymbol), 0, A_GIMME, 0);
class_addlist(makesymbol_class, makesymbol_list);
class_addbang(makesymbol_class, makesymbol_bang);
class_addmethod(makesymbol_class, (t_method)reset_mask, gensym("sym1"), A_SYMBOL, 0);
class_addmethod(makesymbol_class, (t_method)helper, gensym("help"), 0);
class_sethelpsymbol(makesymbol_class, gensym("zexy/makesymbol"));
zexy_register("makesymbol"); }
void z_makesymbol_setup(void) { makesymbol_setup(); }
Hi Ed,
Thanks a lot for trying this on OSX. It seems that the only thing you had to do in shell was to change the way m_pd.h got included.
In fact, with the build system(s) on CVS it should handle this correctly, without source code changes. But then I don't know if shell is included in the OSX build. Might be worth to check out.
Cheers,
Guenter
On Fri, 4 Nov 2005, Ed Kelly wrote:
I had to hack a couple of other's pd source code for it to work on my project. Here is Gunter's shell with a pd-darwin makefile - it has both outlets unlike the wonk version. Also, Johannes' makesymbol from zexy - all I did was add a 1, but it can handle symbols of more than 80 characters.
Best, Ed
-> -> --> ---> -----> --------> -------------> r3search + praktik EK5perimenz
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
[shell] is already included in the Pd-extended.app build. Try
Pd-0.38.4-extendedRC2.app. And it has two outlets.
But there is one problem on OSX. Sometimes when I am using [shell],
everytime I run a command thru [shell] it launches the OSX Crash
Reporter. Right now, its working fine so I can't send a crash report.
Arg.
.hc
On Nov 4, 2005, at 11:04 AM, günter geiger wrote:
Hi Ed,
Thanks a lot for trying this on OSX. It seems that the only thing you had to do in shell was to change the way m_pd.h got included.
In fact, with the build system(s) on CVS it should handle this
correctly, without source code changes. But then I don't know if shell is
included in the OSX build. Might be worth to check out.Cheers,
Guenter
On Fri, 4 Nov 2005, Ed Kelly wrote:
I had to hack a couple of other's pd source code for it to work on my project. Here is Gunter's shell with a pd-darwin makefile - it has both outlets unlike the wonk version. Also, Johannes' makesymbol from zexy - all I did was add a 1, but it can handle symbols of more than 80 characters.
Best, Ed
-> -> --> ---> -----> --------> -------------> r3search + praktik EK5perimenz
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
News is what people want to keep hidden and everything else is
publicity.
- Bill Moyers
Hey Hans, Guenter, !ohannes, list
But there is one problem on OSX. Sometimes when I am using [shell],
everytime I run a command thru [shell] it launches the OSX Crash
Reporter. Right now, its working fine so I can't send a crash report.
Well I have had a different problem where even though I am using the right outlet I get shell: old process still running in the PD window. I need to trigger another shell action by that, and so only half my shell commands are working. It's un-kludge-able! I tried introducing delays into the system, but to no avail.
I am using 10.3.9 and Hans (I think) 10.4, so maybe we have different bugs?
Best, Ed
Hi Ed,
Thanks a lot for trying this on OSX. It seems that
the only thing
you had to do in shell was to change the way
m_pd.h got included.
In fact, with the build system(s) on CVS it should
handle this
correctly, without source code changes. But then I don't know
if shell is
included in the OSX build. Might be worth to check out.
Cheers,
Guenter
On Fri, 4 Nov 2005, Ed Kelly wrote:
I had to hack a couple of other's pd source code
for
it to work on my project. Here is Gunter's shell
with
a pd-darwin makefile - it has both outlets unlike
the
wonk version. Also, Johannes' makesymbol from
zexy -
all I did was add a 1, but it can handle symbols
of
more than 80 characters.
Best, Ed
-> -> --> ---> -----> --------> -------------> r3search + praktik EK5perimenz
How much free photo storage do you get? Store
your holiday
snaps for FREE with Yahoo! Photos
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
News is what people want to keep hidden and everything else is
publicity.- Bill Moyers
-> -> --> ---> -----> --------> -------------> r3search + praktik EK5perimenz
___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com