aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--k_cext.c25
-rw-r--r--k_cext.h10
2 files changed, 34 insertions, 1 deletions
diff --git a/k_cext.c b/k_cext.c
index b2fdcee..a960302 100644
--- a/k_cext.c
+++ b/k_cext.c
@@ -353,3 +353,28 @@ int k_cext_setvalue(char c[],float f)
}
return value_setfloat(gensym(c),f);
}
+
+void k_cext_sendfloat (char c[],float f)
+{
+ static t_symbol *k_cext_internal_symbol=NULL;
+ while ( isspace(c[0]) )
+ {
+ c++;
+ }
+ if(k_cext_internal_symbol==NULL) k_cext_internal_symbol=gensym(c);
+ if(k_cext_internal_symbol->s_thing)
+ pd_float(k_cext_internal_symbol->s_thing, f);
+}
+
+void k_cext_sendsymbol (char c[],char s[])
+{
+ static t_symbol *k_cext_internal_symbol=NULL;
+ while ( isspace(c[0]) )
+ {
+ c++;
+ }
+ if(k_cext_internal_symbol==NULL)
+ k_cext_internal_symbol=gensym(c);
+ if(k_cext_internal_symbol->s_thing)
+ pd_symbol(k_cext_internal_symbol->s_thing, gensym(s));
+}
diff --git a/k_cext.h b/k_cext.h
index d5cfe9f..0dea39f 100644
--- a/k_cext.h
+++ b/k_cext.h
@@ -77,9 +77,11 @@ K_EXTERN void k_sys_makecompilestring(char *to,char *name,char *funcname);
K_EXTERN void k_sys_deletefile(char *name);
K_EXTERN void k_sys_init(void);
-/* TB value accessing functions*/
+/* TB value accessing / send functions */
K_EXTERN t_float k_cext_getvalue(char c[]);
K_EXTERN int k_cext_setvalue(char c[],float f);
+K_EXTERN void k_cext_sendfloat (char c[],float f);
+K_EXTERN void k_cext_sendsymbol (char c[],char s[]);
#define V(a) (x->values[a])
@@ -121,6 +123,12 @@ int k_cext_setvalue(char c[],float f);
#define VALUE(char) k_cext_getvalue(char)
#define SETVALUE(char,float) k_cext_setvalue(char,float)
+/* TB: send float and symbol functions */
+void k_cext_sendfloat (char c[],float f);
+void k_cext_sendsymbol (char c[],char s[]);
+#define SENDFLOAT(char,float) k_cext_sendfloat(char,float)
+#define SENDSYMBOL(char1,char2) k_cext_sendsymbol(char1,char2)
+
#define IF if(
#define FOR for(