pd-hcs_0.1/0000755000076500007650000000000011466076240011276 5ustar hanshanspd-hcs_0.1/uname-help.pd0000644000076500007650000000070710755130521013653 0ustar hanshans#N canvas 293 112 750 380 10; #X obj 109 114 uname; #X msg 109 77 bang; #X obj 106 175 unpack symbol symbol symbol symbol symbol; #X symbolatom 389 203 0 0 0 0 - - -; #X symbolatom 107 319 0 0 0 0 - - -; #X symbolatom 176 296 0 0 0 0 - - -; #X symbolatom 247 275 0 0 0 0 - - -; #X symbolatom 316 229 0 0 0 0 - - -; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 4 0; #X connect 2 1 5 0; #X connect 2 2 6 0; #X connect 2 3 7 0; #X connect 2 4 3 0; pd-hcs_0.1/helppath.c0000644000076500007650000000751411213554662013255 0ustar hanshans/* * This object outputs the global search path for finding objects using a * similar interface as [textfile]. * * Copyright (c) 2007 Free Software Foundation * * 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 3 * of the License, or (at your option) any later version. * * See file LICENSE for further informations on licensing terms. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "m_pd.h" #include "s_stuff.h" #include /* #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif */ static char *version = "$Revision: 1.1 $"; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *helppath_class; typedef struct _helppath { t_object x_obj; t_namelist *x_top; t_namelist *x_current; t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_helppath; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void helppath_output(t_helppath* x) { DEBUG(post("helppath_output");); /* TODO: think about using x->x_current->nl_next so that if [helppath] is at * the end of its list, and another element gets added to the global * helppath, [helppath] will output the new element on the next bang. */ if(x->x_current) { outlet_symbol( x->x_data_outlet, gensym(x->x_current->nl_string) ); x->x_current = x->x_current->nl_next; } else { outlet_bang(x->x_status_outlet); } } static void helppath_reset(t_helppath* x) { DEBUG(post("helppath_reset");); x->x_current = x->x_top = sys_helppath; } static void helppath_add(t_helppath* x, t_symbol *s) { DEBUG(post("helppath_add");); } static void *helppath_new() { DEBUG(post("helppath_new");); t_helppath *x = (t_helppath *)pd_new(helppath_class); x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol); x->x_status_outlet = outlet_new(&x->x_obj, 0); helppath_reset(x); return (x); } void helppath_free() { // TODO: look into freeing the namelist } void helppath_setup(void) { DEBUG(post("helppath_setup");); helppath_class = class_new(gensym("helppath"), (t_newmethod)helppath_new, 0, sizeof(t_helppath), 0, 0); /* add inlet datatype methods */ class_addbang(helppath_class,(t_method) helppath_output); /* add inlet message methods */ class_addmethod(helppath_class,(t_method) helppath_reset, gensym("reset"), 0); class_addmethod(helppath_class,(t_method) helppath_add,gensym("add"), A_DEFSYMBOL, 0); post("[helppath] %s", version); post("\tcompiled on "__DATE__" at "__TIME__ " "); post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION); } pd-hcs_0.1/screensize.c0000644000076500007650000000274711213554662013625 0ustar hanshans/* this object just asks Tcl for the screen resolution and outputs it */ #include #include static t_class *screensize_class; typedef struct _screensize { t_object x_obj; t_symbol *receive_symbol; t_outlet *width_outlet; t_outlet *height_outlet; } t_screensize; static void screensize_bang(t_screensize *x) { sys_vgui("pd [concat %s screensize [winfo screenwidth .] [winfo screenheight .] \\;]\n", x->receive_symbol->s_name); } static void screensize_callback(t_screensize *x, t_float width, t_float height) { outlet_float(x->height_outlet, height); outlet_float(x->width_outlet, width); } static void *screensize_new(void) { char buf[MAXPDSTRING]; t_screensize *x = (t_screensize *)pd_new(screensize_class); sprintf(buf, "#%lx", (t_int)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); x->width_outlet = outlet_new(&x->x_obj, 0); x->height_outlet = outlet_new(&x->x_obj, 0); return(x); } static void screensize_free(t_screensize *x) { pd_unbind(&x->x_obj.ob_pd, x->receive_symbol); } void screensize_setup(void) { screensize_class = class_new(gensym("screensize"), (t_newmethod)screensize_new, (t_method)screensize_free, sizeof(t_screensize), 0, 0); class_addbang(screensize_class, (t_method)screensize_bang); class_addmethod(screensize_class, (t_method)screensize_callback, gensym("screensize"), A_DEFFLOAT, A_DEFFLOAT, 0); } pd-hcs_0.1/ISOdate.pd0000644000076500007650000000070711030703002013073 0ustar hanshans#N canvas 619 362 462 310 10; #X obj 93 84 zexy/date -----------; #X obj 93 31 inlet; #X obj 93 58 bang; #X obj 93 229 outlet; #X obj 93 175 pack float symbol symbol; #X obj 93 202 zexy/makesymbol %s-%s-%s; #X obj 118 129 makefilename %02d; #X obj 247 129 makefilename %02d; #X connect 0 0 4 0; #X connect 0 1 6 0; #X connect 0 2 7 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 4 0 5 0; #X connect 5 0 3 0; #X connect 6 0 4 1; #X connect 7 0 4 2; pd-hcs_0.1/setenv.c0000644000076500007650000001106011213554662012743 0ustar hanshans/* sets an environment variable */ /* */ /* Copyright (c) 2008 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include "m_pd.h" #include "s_stuff.h" #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *setenv_class; typedef struct _setenv { t_object x_obj; t_symbol* x_variable_name; t_int x_overwrite; t_outlet* x_data_outlet; } t_setenv; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void setenv_output(t_setenv* x) { DEBUG(post("setenv_output");); char *envvar_value; if(x->x_variable_name != &s_) { envvar_value = getenv(x->x_variable_name->s_name); if(envvar_value) outlet_symbol(x->x_data_outlet, gensym(envvar_value)); else pd_error(x, "[setenv]: The environment variable %s is not defined.", x->x_variable_name->s_name); } else pd_error(x, "[setenv]: no environment variable name is set."); } static void setenv_symbol(t_setenv* x, t_symbol *s) { DEBUG(post("setenv_output");); #ifdef _WIN32 SetEnvironmentVariable(x->x_variable_name->s_name, s->s_name); #else if(x->x_overwrite == 0) post("[setenv]: not in overwrite mode."); setenv(x->x_variable_name->s_name, s->s_name, x->x_overwrite); #endif setenv_output(x); } static void setenv_anything(t_setenv* x, t_symbol* s, int argc, t_atom* argv) { t_binbuf *argument_binbuf = binbuf_new(); char *argument_buffer; int buffer_length; if(s != &s_list) { t_atom selector; SETSYMBOL(&selector, s); binbuf_add(argument_binbuf, 1, &selector); } binbuf_add(argument_binbuf, argc, argv); binbuf_gettext(argument_binbuf, &argument_buffer, &buffer_length); binbuf_free(argument_binbuf); argument_buffer[buffer_length] = 0; setenv_symbol(x, gensym(argument_buffer)); } static void *setenv_new(t_symbol* s, t_float f) { DEBUG(post("setenv_new");); t_setenv *x = (t_setenv *)pd_new(setenv_class); symbolinlet_new(&x->x_obj, &x->x_variable_name); x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol); x->x_overwrite = (t_int) f; x->x_variable_name = s; return (x); } void setenv_setup(void) { DEBUG(post("setenv_setup");); setenv_class = class_new(gensym("setenv"), (t_newmethod)setenv_new, 0, sizeof(t_setenv), 0, A_DEFSYMBOL, A_DEFFLOAT, 0); /* add inlet datatype methods */ class_addbang(setenv_class, (t_method)setenv_output); class_addsymbol(setenv_class, (t_method)setenv_symbol); class_addanything(setenv_class, (t_method)setenv_anything); } pd-hcs_0.1/mouse_region-help.pd0000644000076500007650000000121310755130521015232 0ustar hanshans#N canvas 227 186 598 404 10; #X obj 33 173 pointer_position; #X obj 33 145 tgl 15 1 empty empty empty 0 -6 0 10 -262144 -1 -1 1 1; #X msg 52 144 bang; #X obj 342 136 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 48 84 keyup; #X obj 48 105 select 32; #X text 124 41 give mouse coordinates only after clicking and dragging in a region.; #X obj 145 295 unpack float float; #X floatatom 144 325 5 0 0 0 - - -; #X floatatom 252 326 5 0 0 0 - - -; #X obj 146 248 mouse_region 342 443 137 194; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 4 0 5 0; #X connect 5 0 2 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 10 0 7 0; pd-hcs_0.1/tcl_version-help.pd0000644000076500007650000000060310755130521015070 0ustar hanshans#N canvas 951 522 454 304 10; #X obj 127 117 tcl_version; #X msg 127 70 bang; #X obj 127 157 unpack float float float; #X floatatom 126 186 5 0 0 3 major - -; #X floatatom 195 185 5 0 0 3 minor - -; #X floatatom 267 186 5 0 0 3 bugfix - -; #X text 53 21 get the current Tcl/Tk version:; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 2 2 5 0; pd-hcs_0.1/unsetenv-help.pd0000644000076500007650000000066711061343022014413 0ustar hanshans#N canvas 315 28 551 341 10; #X obj 261 152 setenv; #X msg 261 54 bang; #X symbolatom 260 199 0 0 0 0 - - -; #X msg 59 51 bang; #X msg 294 120 symbol SHELL; #X msg 381 120 symbol PATH; #X msg 461 120 symbol HOME; #X obj 59 134 unsetenv HOME; #X msg 134 107 symbol SHELL; #X text 107 51 bang unsets; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 3 0 7 0; #X connect 4 0 0 1; #X connect 5 0 0 1; #X connect 6 0 0 1; #X connect 8 0 7 1; pd-hcs_0.1/pwm~.pd0000644000076500007650000000116011213554662012621 0ustar hanshans#N canvas 511 200 493 443 10; #X obj 29 49 inlet; #X obj 113 405 outlet~; #X obj 113 198 phasor~; #X obj 280 43 inlet; #X obj 31 94 t b f; #X msg 31 114 1; #X obj 45 135 -; #X text 77 113 invert so 1 = full power; #X obj 280 75 purepd/float_argument \$1 60; #X obj 113 172 sig~; #X obj 326 43 loadbang; #X text 43 11 after an idea from Roman Haefeli and Martin Peach; #X obj 113 226 expr~ $v1 > $v2; #X connect 0 0 4 0; #X connect 2 0 12 0; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 4 1 6 1; #X connect 5 0 6 0; #X connect 6 0 12 1; #X connect 8 0 9 0; #X connect 9 0 2 0; #X connect 10 0 8 0; #X connect 12 0 1 0; pd-hcs_0.1/mouse_region.pd0000644000076500007650000001117410755130521014313 0ustar hanshans#N canvas 138 197 732 550 10; #N canvas 224 109 399 332 constrain 0; #X obj 15 12 inlet; #X obj 112 254 outlet; #X obj 15 52 unpack float float float float; #X obj 45 116 receive \$0-xmin; #X obj 75 137 receive \$0-xmax; #X obj 15 137 moses; #X obj 45 157 moses; #X obj 112 225 pack float float; #X obj 200 137 moses; #X obj 230 157 moses; #X obj 260 137 receive \$0-ymax; #X obj 230 116 receive \$0-ymin; #X connect 0 0 2 0; #X connect 2 0 5 0; #X connect 2 1 8 0; #X connect 3 0 5 1; #X connect 4 0 6 1; #X connect 5 1 6 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 8 1 9 0; #X connect 9 0 7 1; #X connect 10 0 9 1; #X connect 11 0 8 1; #X restore 100 461 pd constrain mouse messages; #N canvas 0 22 470 320 set 0; #X obj 75 26 inlet; #X obj 108 115 send \$0-xmax; #X obj 19 115 send \$0-xmin; #X obj 200 114 send \$0-ymin; #X obj 291 114 send \$0-ymax; #X obj 74 52 unpack float float float float; #X connect 0 0 5 0; #X connect 5 0 2 0; #X connect 5 1 1 0; #X connect 5 2 3 0; #X connect 5 3 4 0; #X restore 93 437 pd set xmin xmax ymin ymax; #X text 173 396 xmin xmax ymin ymax; #X msg 84 410 273 103 473 303; #X obj 83 15 inlet xmin; #X obj 234 14 inlet xmax; #X obj 385 14 inlet ymin; #X obj 536 14 inlet ymax; #X obj 448 436 outlet events; #X obj 83 83 unpack float float float float; #X obj 83 137 purepd/float_argument \$1; #X obj 234 137 purepd/float_argument \$2; #X obj 398 83 loadbang; #X obj 83 58 route list; #X obj 385 137 purepd/float_argument \$3; #X obj 536 137 purepd/float_argument \$4; #N canvas 0 22 601 552 constrain 0; #X obj 10 24 inlet data; #X obj 101 24 inlet xmin; #X obj 182 24 inlet xmax; #X obj 293 24 inlet ymin; #X obj 404 24 inlet ymax; #X obj 91 343 outlet; #X obj 61 110 unpack float float float float; #X obj 61 155 moses; #X obj 91 175 moses; #X obj 91 293 pack float float; #X obj 194 155 moses; #X obj 224 175 moses; #X obj 251 198 bang; #X obj 251 220 float; #X obj 191 198 bang; #X obj 191 220 float; #X obj 118 198 bang; #X obj 118 220 float; #X obj 51 198 bang; #X obj 51 220 float; #X connect 0 0 6 0; #X connect 1 0 7 1; #X connect 1 0 19 1; #X connect 2 0 8 1; #X connect 2 0 17 1; #X connect 3 0 10 1; #X connect 3 0 15 1; #X connect 4 0 11 1; #X connect 4 0 13 1; #X connect 6 0 7 0; #X connect 6 1 10 0; #X connect 7 0 18 0; #X connect 7 1 8 0; #X connect 8 0 9 0; #X connect 8 1 16 0; #X connect 9 0 5 0; #X connect 10 0 14 0; #X connect 10 1 11 0; #X connect 11 0 9 1; #X connect 11 1 12 0; #X connect 12 0 13 0; #X connect 13 0 9 1; #X connect 14 0 15 0; #X connect 15 0 9 1; #X connect 16 0 17 0; #X connect 17 0 9 0; #X connect 18 0 19 0; #X connect 19 0 9 0; #X restore 448 383 pd constrain mouse messages; #N canvas 0 22 351 249 get 0; #X obj 139 110 outlet; #X msg 89 54 capture 1; #X obj 89 33 loadbang; #X obj 89 75 toxy/tot .top; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 2 0 0; #X restore 35 222 pd get events; #X obj 86 275 bang; #X obj 37 332 spigot; #N canvas 95 390 538 391 constrain 0; #X obj 113 352 outlet; #X obj 10 24 inlet data; #X obj 101 24 inlet xmin; #X obj 182 24 inlet xmax; #X obj 293 24 inlet ymin; #X obj 404 24 inlet ymax; #X obj 61 110 unpack float float float float; #X obj 61 155 moses; #X obj 91 175 moses; #X obj 214 155 moses; #X obj 244 175 moses; #X obj 204 212 bang; #X obj 113 330 &&; #X obj 238 212 bang; #X msg 238 235 1; #X msg 204 235 0; #X obj 58 212 bang; #X obj 92 212 bang; #X msg 92 235 1; #X msg 58 235 0; #X connect 1 0 6 0; #X connect 2 0 7 1; #X connect 3 0 8 1; #X connect 4 0 9 1; #X connect 5 0 10 1; #X connect 6 0 7 0; #X connect 6 1 9 0; #X connect 7 0 16 0; #X connect 7 1 8 0; #X connect 8 0 17 0; #X connect 8 1 16 0; #X connect 9 0 11 0; #X connect 9 1 10 0; #X connect 10 0 13 0; #X connect 10 1 11 0; #X connect 11 0 15 0; #X connect 12 0 0 0; #X connect 13 0 14 0; #X connect 14 0 12 1; #X connect 15 0 12 1; #X connect 16 0 19 0; #X connect 17 0 18 0; #X connect 18 0 12 0; #X connect 19 0 12 0; #X restore 137 290 pd constrain mousedown; #X obj 35 253 route motion mouseup mouse; #X msg 86 296 0; #X connect 3 0 1 0; #X connect 4 0 13 0; #X connect 5 0 11 0; #X connect 6 0 14 0; #X connect 7 0 15 0; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 9 2 14 0; #X connect 9 3 15 0; #X connect 10 0 16 1; #X connect 10 0 20 1; #X connect 11 0 16 2; #X connect 11 0 20 2; #X connect 12 0 11 0; #X connect 12 0 10 0; #X connect 12 0 14 0; #X connect 12 0 15 0; #X connect 13 0 9 0; #X connect 13 1 10 0; #X connect 14 0 16 3; #X connect 14 0 20 3; #X connect 15 0 16 4; #X connect 15 0 20 4; #X connect 16 0 8 0; #X connect 17 0 21 0; #X connect 18 0 22 0; #X connect 19 0 16 0; #X connect 20 0 19 1; #X connect 21 0 19 0; #X connect 21 1 18 0; #X connect 21 2 20 0; #X connect 22 0 19 1; pd-hcs_0.1/autoscale.pd0000644000076500007650000000421310755130521013574 0ustar hanshans#N canvas 206 226 773 542 10; #X obj 45 30 inlet; #X obj 175 453 outlet; #X obj 235 268 f; #X text 262 268 min; #X text 360 269 max; #X obj 454 167 f \$1; #X obj 652 167 f \$2; #X obj 235 245 moses 0; #X obj 320 245 moses 0; #X obj 175 102 trigger float float float bang bang; #X obj 175 390 expr (($f1 - $f2) * (($f5 - $f4) / ($f3 - $f2))) + $f4 ; #X obj 326 205 oneshot; #X obj 364 226 f; #X obj 320 178 t f b f; #X obj 241 205 oneshot; #X obj 279 226 f; #X obj 235 178 t f b f; #X obj 384 269 + 1e-09; #X obj 478 213 ==; #X obj 478 233 sel 1; #X obj 545 77 loadbang; #X obj 478 299 print [autoscale]; #X floatatom 472 189 5 0 0 0 - - -; #X obj 545 100 t b b; #X obj 454 329 expr if ($f1 == $f2 \, 0 \, $f1) \; if ($f1 == $f2 \, 127 \, $f2); #X msg 478 278 using default range (0-127); #X obj 478 256 oneshot; #X text 2 476 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 219 491 released under the GNU GPL; #X text 417 475 $Revision: 1.5 $$Date: 2004-11-28 20:50:14 $; #X text 417 488 $Author: eighthave $; #X obj 45 62 route reset; #X obj 45 81 bang; #X msg 45 129 0; #X msg 114 102 clear; #X text 172 47 these [oneshot] bits are just here to get the max/min tracking started; #X text 8 3 [autoscale]; #X connect 0 0 31 0; #X connect 2 0 7 1; #X connect 2 0 10 1; #X connect 5 0 18 0; #X connect 5 0 22 0; #X connect 5 0 24 0; #X connect 6 0 18 1; #X connect 6 0 24 1; #X connect 7 0 2 0; #X connect 8 1 17 0; #X connect 9 0 10 0; #X connect 9 1 16 0; #X connect 9 2 13 0; #X connect 9 3 5 0; #X connect 9 4 6 0; #X connect 10 0 1 0; #X connect 11 0 12 0; #X connect 12 0 8 1; #X connect 13 0 8 0; #X connect 13 1 11 0; #X connect 13 2 12 1; #X connect 14 0 15 0; #X connect 15 0 7 1; #X connect 16 0 7 0; #X connect 16 1 14 0; #X connect 16 2 15 1; #X connect 17 0 8 1; #X connect 17 0 10 2; #X connect 18 0 19 0; #X connect 19 0 26 0; #X connect 20 0 23 0; #X connect 23 0 5 0; #X connect 23 1 6 0; #X connect 24 0 10 3; #X connect 24 1 10 4; #X connect 25 0 21 0; #X connect 26 0 25 0; #X connect 31 0 32 0; #X connect 31 1 9 0; #X connect 32 0 33 0; #X connect 32 0 34 0; #X connect 33 0 2 0; #X connect 33 0 12 0; #X connect 34 0 14 0; #X connect 34 0 11 0; pd-hcs_0.1/pwm~-help.pd0000644000076500007650000000172111213554662013552 0ustar hanshans#N canvas 138 51 523 408 10; #N canvas 0 22 450 300 (subpatch) 0; #X array \$0-pwm~ 100 float 0; #X coords 0 1.1 100 -0.1 200 100 1; #X restore 58 236 graph; #X obj 83 144 r metro; #X text 355 21 <-- Click to start; #X text 194 193 <-- graph the output; #X text 302 287 see also:; #X obj 311 20 tgl 25 0 empty empty start 0 -6 1 9 -24198 -1 -1 0 1 ; #X msg 311 48 \; pd dsp \$1 \; metro \$1; #X obj 376 287 pwm; #X obj 71 66 hsl 128 15 0 1 0 1 empty empty pulse_width -2 -6 1 12 -225280 -1 -1 10700 0; #X floatatom 80 88 5 0 0 0 - - -; #X text 139 112 argument = pwm rate in Hz; #X obj 67 112 pwm~ 2000; #X obj 83 169 metro 238.3; #X obj 82 372 pddp/pddplink http://en.wikipedia.org/wiki/Pulse-width_modulation ; #X text 22 351 for more info:; #X text 16 11 pulse width modulation at audio rate; #X obj 67 193 tabwrite~ \$0-pwm~; #X connect 1 0 12 0; #X connect 1 0 12 0; #X connect 5 0 6 0; #X connect 8 0 9 0; #X connect 8 0 11 0; #X connect 11 0 16 0; #X connect 12 0 16 0; pd-hcs_0.1/split_path.c0000644000076500007650000000357411213554662013621 0ustar hanshans/* (C) Guenter Geiger */ /* I started with stripdir.c and turned it into split_path.c */ #include #include #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif static char *version = "$Revision: 1.1 $"; t_int split_path_instance_count; /* ------------------------ split_path ----------------------------- */ static t_class *split_path_class; typedef struct _split_path { t_object x_obj; t_outlet *x_path_outlet; t_outlet *x_filename_outlet; } t_split_path; void split_path_symbol(t_split_path *x, t_symbol *s) { int length = strlen(s->s_name); char path_buffer[MAXPATHLEN] = ""; while (length--) if (*(s->s_name + length) == '/') break; if (length < MAXPATHLEN) outlet_symbol(x->x_filename_outlet,gensym(s->s_name + length + 1)); else error("[split_path] filename name too long. The limit is %d characters",MAXPATHLEN); while (length > 0) { length--; if(*(s->s_name + length) != '/') break; } if (length < MAXPATHLEN) { strncpy(path_buffer, s->s_name, length + 1); outlet_symbol(x->x_path_outlet,gensym(path_buffer)); } else { error("[split_path] path name too long. The limit is %d characters",MAXPATHLEN); } } static void *split_path_new() { t_split_path *x = (t_split_path *)pd_new(split_path_class); x->x_path_outlet = (t_outlet *)outlet_new(&x->x_obj, &s_symbol); x->x_filename_outlet = (t_outlet *)outlet_new(&x->x_obj, &s_symbol); if(!split_path_instance_count) { post("[split_path] %s",version); post("\twritten by Hans-Christoph Steiner "); } split_path_instance_count++; return (x); } void split_path_setup(void) { split_path_class = class_new(gensym("split_path"), (t_newmethod)split_path_new, 0, sizeof(t_split_path), 0,0); class_addsymbol(split_path_class,split_path_symbol); } pd-hcs_0.1/cursor.c0000644000076500007650000002367511464025210012761 0ustar hanshans/* TODO add reset method for cursor icons, this should probably be done in pd.tk, or cursor reset method could be done in help patch */ #include #include #include #include #include "g_canvas.h" #define POLLTIME 10 static t_symbol *button_symbol; static t_symbol *mousewheel_symbol; static t_symbol *motion_symbol; static t_symbol *x_symbol; static t_symbol *y_symbol; static t_symbol *cursor_receive_symbol; t_int cursor_instances_polling; static t_class *cursor_class; typedef struct _cursor { t_object x_obj; t_int am_polling; t_symbol *receive_symbol; t_canvas *parent_canvas; t_outlet *data_outlet; // t_outlet *status_outlet; // not used (yet?) } t_cursor; static void create_namespace(void) { sys_gui("if { [namespace exists ::hcs_cursor_class]} {\n"); sys_gui(" puts stderr {WARNING: ::hcs_cursor_class namespace exists!}\n"); sys_gui("} else {\n"); sys_gui(" namespace eval ::hcs_cursor_class {\n"); sys_gui(" variable continue_pollmotion 0\n"); sys_gui(" variable last_x 0\n"); sys_gui(" variable last_y 0\n"); sys_gui(" }\n"); sys_gui("}\n"); } static void create_proc_test(void) { sys_gui ("if {[info commands ::hcs_cursor_class::proc_test] eq {::hcs_cursor_class::proc_test}} {"); sys_gui(" puts stderr {WARNING: ::hcs_cursor_class::proc_test exists!}\n"); sys_gui("} else {\n"); sys_gui(" proc ::hcs_cursor_class::proc_test {proc_name} {\n"); sys_gui(" if {[info commands ::hcs_cursor_class::$proc_name] eq $proc_name} {\n"); sys_gui(" puts stderr {WARNING: ::hcs_cursor_class::$proc_name exists!}\n"); sys_gui(" return 1\n"); sys_gui(" } else {\n"); sys_gui(" return 0\n"); sys_gui(" }\n"); sys_gui(" }\n"); sys_gui("}\n"); } /* in Pd 0.43, the internal proc changed from 'pd' to 'pdsend' */ static void create_legacy_pd (void) { post("creating legacy 'pdsend' using legacy 'pd' proc"); sys_gui("if {[info commands pdsend] ne {pdsend}} {\n"); sys_gui(" proc pdsend {message} {pd $message}\n"); sys_gui("}\n"); } /* idea from #tcl for a Tcl unbind */ static void create_unbind (void) { sys_gui("if { ! [::hcs_cursor_class::proc_test unbind]} {"); sys_gui(" proc ::hcs_cursor_class::unbind {tag event script} {\n"); sys_gui(" set bind {}\n"); sys_gui(" foreach x [split [bind $tag $event] \"\n\"] {\n"); sys_gui(" if {$x != $script} {\n"); sys_gui(" lappend bind $x\n"); sys_gui(" }\n"); sys_gui(" }\n"); sys_gui(" bind $tag $event {}\n"); sys_gui(" foreach x $bind {bind $tag $event $x}\n"); sys_gui(" }\n"); sys_gui("}\n"); } static void create_button_proc(void) { sys_gui ("if { ! [::hcs_cursor_class::proc_test button]} {"); sys_gui (" proc ::hcs_cursor_class::button {button state} {\n"); sys_vgui(" pd [concat %s button $button $state \\;]\n", cursor_receive_symbol->s_name); sys_gui (" }\n"); sys_gui ("}\n"); } static void create_mousewheel_proc(void) { sys_gui ("if { ! [::hcs_cursor_class::proc_test mousewheel]} {"); sys_gui (" proc ::hcs_cursor_class::mousewheel {delta} {\n"); sys_vgui(" pd [concat %s mousewheel $delta \\;]\n", cursor_receive_symbol->s_name); sys_gui (" }\n"); sys_gui ("}\n"); } static void create_motion_proc(void) { sys_gui("if { ![::hcs_cursor_class::proc_test motion]} {\n"); sys_gui (" proc ::hcs_cursor_class::motion {x y} {\n"); sys_gui (" if { $x != $::hcs_cursor_class::last_x \\\n"); sys_gui (" || $y != $::hcs_cursor_class::last_y} {\n"); sys_vgui(" pd [concat %s motion $x $y \\;]\n", cursor_receive_symbol->s_name); sys_gui (" set ::hcs_cursor_class::last_x $x\n"); sys_gui (" set ::hcs_cursor_class::last_y $y\n"); sys_gui (" }\n"); sys_gui (" }\n"); sys_gui ("}\n"); } static void create_pollmotion_proc(void) { sys_gui ("if { ![::hcs_cursor_class::proc_test pollmotion]} {\n"); sys_gui (" proc ::hcs_cursor_class::pollmotion {} {\n"); sys_vgui(" ::hcs_cursor_class::motion [winfo pointerx .] [winfo pointery .]\n"); sys_gui (" if {$::hcs_cursor_class::continue_pollmotion != 0} { \n"); sys_gui (" after 10 ::hcs_cursor_class::pollmotion\n"); sys_gui (" }\n"); sys_gui (" }\n"); sys_gui ("}\n"); } static void cursor_setmethod(t_cursor *x, t_symbol *s, int argc, t_atom *argv) { sys_vgui("set cursor_%s \"%s\"\n", s->s_name, atom_getsymbol(argv)->s_name); canvas_setcursor(x->parent_canvas, 0); /* hack to refresh the cursor */ } static void cursor_bang(t_cursor *x) { sys_vgui("pd [concat %s motion [winfo pointerxy .] \\;]\n", x->receive_symbol->s_name); } static void cursor_float(t_cursor *x, t_float f) { /* "bind all only gives data when over windows, so its commented * out. See the cursor_bang function to see the pointer x,y data getting */ if(f == 0) { if (x->am_polling) { x->am_polling = 0; cursor_instances_polling--; /* if no more objects are listening, stop sending the events */ if (cursor_instances_polling == 0) { sys_gui("set ::hcs_cursor_class::continue_pollmotion 0 \n"); sys_gui("::hcs_cursor_class::unbind all {::hcs_cursor_class::button %b 1}\n"); sys_gui("::hcs_cursor_class::unbind all {::hcs_cursor_class::button %b 0}\n"); sys_gui("::hcs_cursor_class::unbind all {::hcs_cursor_class::mousewheel %D}\n"); } pd_unbind(&x->x_obj.ob_pd, cursor_receive_symbol); } } else { if ( ! x->am_polling) { x->am_polling = 1; pd_bind(&x->x_obj.ob_pd, cursor_receive_symbol); cursor_instances_polling++; /* if this is the first instance to start, set up Tcl binding and polling */ if (cursor_instances_polling == 1) { sys_gui("set ::hcs_cursor_class::continue_pollmotion 1 \n"); sys_gui("::hcs_cursor_class::pollmotion \n"); sys_gui("bind all {+::hcs_cursor_class::button %b 1}\n"); sys_gui("bind all {+::hcs_cursor_class::button %b 0}\n"); sys_gui("bind all {+::hcs_cursor_class::mousewheel %D}\n"); } } } } static void cursor_button_callback(t_cursor *x, t_float button, t_float state) { t_atom output_atoms[2]; SETFLOAT(output_atoms, button); SETFLOAT(output_atoms + 1, state); outlet_anything(x->data_outlet, button_symbol, 2, output_atoms); } static void cursor_motion_callback(t_cursor *x, t_float x_position, t_float y_position) { t_atom output_atoms[2]; SETSYMBOL(output_atoms, x_symbol); SETFLOAT(output_atoms + 1, x_position); outlet_anything(x->data_outlet, motion_symbol, 2, output_atoms); SETSYMBOL(output_atoms, y_symbol); SETFLOAT(output_atoms + 1, y_position); outlet_anything(x->data_outlet, motion_symbol, 2, output_atoms); } static void cursor_mousewheel_callback(t_cursor *x, t_float f) { t_atom output_atom; SETFLOAT(&output_atom, f); outlet_anything(x->data_outlet, mousewheel_symbol, 1, &output_atom); } static void cursor_free(t_cursor *x) { cursor_float(x, 0); pd_unbind(&x->x_obj.ob_pd, x->receive_symbol); } static void *cursor_new(void) { char buf[MAXPDSTRING]; t_cursor *x = (t_cursor *)pd_new(cursor_class); x->parent_canvas = canvas_getcurrent(); sprintf(buf, "#%lx", (t_int)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); x->data_outlet = outlet_new(&x->x_obj, 0); //x->status_outlet = outlet_new(&x->x_obj, 0); x->am_polling = 0; return(x); } void cursor_setup(void) { cursor_class = class_new(gensym("cursor"), (t_newmethod)cursor_new, (t_method)cursor_free, sizeof(t_cursor), 0, 0); class_addbang(cursor_class, (t_method)cursor_bang); class_addfloat(cursor_class, (t_method)cursor_float); button_symbol = gensym("button"); mousewheel_symbol = gensym("mousewheel"); motion_symbol = gensym("motion"); x_symbol = gensym("x"); y_symbol = gensym("y"); //status_symbol = gensym("status"); cursor_receive_symbol = gensym("#hcs_cursor_class_receive"); class_addmethod(cursor_class, (t_method)cursor_button_callback, button_symbol, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(cursor_class, (t_method)cursor_motion_callback, motion_symbol, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(cursor_class, (t_method)cursor_mousewheel_callback, mousewheel_symbol, A_DEFFLOAT, 0); /* methods for setting the cursor icon */ class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("runmode_nothing"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("runmode_clickme"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("runmode_thicken"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("runmode_addpoint"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("editmode_nothing"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("editmode_connect"), A_GIMME, 0); class_addmethod(cursor_class, (t_method)cursor_setmethod, gensym("editmode_disconnect"), A_GIMME, 0); create_namespace(); create_proc_test(); /* TODO figure this out once 0.43 is released */ /* if(PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43) create_legacy_pd();*/ create_unbind(); create_motion_proc(); create_pollmotion_proc(); create_mousewheel_proc(); create_button_proc(); } pd-hcs_0.1/passwd.c0000644000076500007650000001373411213554662012752 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* converts a UID number to a user name symbol */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #ifndef _WIN32 // this doesn't work on Windows (yet?) #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #include #else #include #include #endif #include static char *version = "$Revision: 1.3 $"; t_int passwd_instance_count; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *passwd_class; typedef struct _passwd { t_object x_obj; t_float x_uid; t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_passwd; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void passwd_output(t_passwd *x) { DEBUG(post("passwd_output");); struct passwd *passwd_pointer; t_atom output_data[6]; #ifdef _WIN32 /* TODO: implement for Windows! */ #else if( x->x_uid < 0 ) { post("[passwd]: ignoring bad username or UID less than zero"); outlet_bang(x->x_status_outlet); } else { passwd_pointer = getpwuid((uid_t)x->x_uid); if( passwd_pointer != NULL ) { SETSYMBOL(output_data, gensym(passwd_pointer->pw_passwd)); SETFLOAT(output_data + 1, passwd_pointer->pw_uid); SETFLOAT(output_data + 2, passwd_pointer->pw_gid); SETSYMBOL(output_data + 3, gensym(passwd_pointer->pw_gecos)); SETSYMBOL(output_data + 4, gensym(passwd_pointer->pw_dir)); SETSYMBOL(output_data + 5, gensym(passwd_pointer->pw_shell)); outlet_anything(x->x_data_outlet, gensym(passwd_pointer->pw_name), 6, output_data); } else { outlet_bang(x->x_status_outlet); } } #endif /* _WIN32 */ } static t_float get_uid_from_arguments(int argc, t_atom *argv) { t_symbol *first_argument; t_float uid = -1; struct passwd *passwd_pointer; if(argc == 0) return(0); if(argc != 1) post("[passwd]: too many arguments (%d), ignoring all but the first", argc); first_argument = atom_getsymbolarg(0,argc,argv); if(first_argument == &s_) { // single float arg means UID # uid = atom_getfloatarg(0,argc,argv); if( uid < 0 ) { error("[passwd]: UID less than zero not allowed (%d)", uid); return(-1); } } else { // single symbol arg means username passwd_pointer = getpwnam(first_argument->s_name); if( passwd_pointer != NULL ) return((t_float) passwd_pointer->pw_uid); else return(-1); } return(-1); } static void passwd_set(t_passwd *x, t_symbol *s, int argc, t_atom *argv) { /* get rid of the unused variable warning with the if() statement */ if( strcmp(s->s_name, "set") == 0 ) x->x_uid = get_uid_from_arguments(argc, argv); } static void passwd_float(t_passwd *x, t_float f) { x->x_uid = f; passwd_output(x); } static void passwd_symbol(t_passwd *x, t_symbol *s) { t_atom argv[1]; SETSYMBOL(argv, s); passwd_set(x, gensym("set"), 1, argv); passwd_output(x); } static void *passwd_new(t_symbol *s, int argc, t_atom *argv) { DEBUG(post("passwd_new");); t_passwd *x = (t_passwd *)pd_new(passwd_class); if(!passwd_instance_count) { post("[passwd] %s",version); post("\twritten by Hans-Christoph Steiner "); post("\tcompiled on "__DATE__" at "__TIME__ " "); } passwd_instance_count++; floatinlet_new(&x->x_obj, &x->x_uid); x->x_data_outlet = outlet_new(&x->x_obj, 0); x->x_status_outlet = outlet_new(&x->x_obj, 0); passwd_set(x, gensym("set"), argc, argv); return (x); } void passwd_free(void) { #ifdef _WIN32 #else endpwent(); #endif /* _WIN32 */ } void passwd_setup(void) { DEBUG(post("passwd_setup");); passwd_class = class_new(gensym("passwd"), (t_newmethod)passwd_new, 0, sizeof(t_passwd), 0, A_GIMME, 0); /* add inlet datatype methods */ class_addbang(passwd_class, (t_method) passwd_output); class_addfloat(passwd_class, (t_method) passwd_float); class_addsymbol(passwd_class, (t_method) passwd_symbol); /* add inlet message methods */ class_addmethod(passwd_class, (t_method) passwd_set, gensym("set"), A_GIMME, 0); } #endif /* NOT _WIN32 */ pd-hcs_0.1/pi-help.pd0000644000076500007650000000044611061343022013147 0ustar hanshans#N canvas 65 227 466 251 10; #X obj 5 2 cnv 15 450 20 empty empty pi 2 11 1 18 -233017 -66577 0; #X msg 422 3 pddp; #X obj 142 149 pi; #X floatatom 143 192 11 0 0 0 - - -; #X msg 142 106 bang; #X text 32 51 The value of pi as accurate as Pd can manage:; #X connect 2 0 3 0; #X connect 4 0 2 0; pd-hcs_0.1/window_name.c0000644000076500007650000000346611464025233013754 0ustar hanshans#include #include #include #include "g_canvas.h" #define DEBUG(x) static t_class *window_name_class; static t_canvas *canvas; typedef struct _window_name { t_object x_obj; t_atom x_atom; t_symbol *x_window_name; t_symbol *x_remote_name; } t_window_name; static void window_name_bang(t_window_name *x) { if (x->x_atom.a_type == A_SYMBOL) { canvas=(t_canvas *)pd_findbyclass(x->x_remote_name, canvas_class); char buf[MAXPDSTRING]; snprintf(buf, MAXPDSTRING, ".x%lx", (long unsigned int)canvas); x->x_window_name = gensym(buf); } outlet_symbol(x->x_obj.ob_outlet,x->x_window_name); } static void *window_name_new(t_symbol *s, int argc, t_atom *argv) { t_atom a; if (argc == 0) { argc = 1; SETFLOAT(&a, 0); argv = &a; } t_window_name *x = (t_window_name *)pd_new(window_name_class); x->x_atom = *argv; if (argv->a_type == A_FLOAT) { // thx to IOhannes's iemguts: t_glist *glist=(t_glist *)canvas_getcurrent(); canvas=(t_canvas *)glist_getcanvas(glist); int depth=(int)atom_getint(&x->x_atom); if(depth<0)depth=0; while(depth && canvas) { canvas=canvas->gl_owner; depth--; } char buf[MAXPDSTRING]; snprintf(buf, MAXPDSTRING, ".x%lx", (long unsigned int)canvas); x->x_window_name = gensym(buf); } else { x->x_remote_name = (t_symbol *)atom_getsymbol(&x->x_atom); } outlet_new(&x->x_obj, &s_symbol); return(x); } void window_name_setup(void) { window_name_class = class_new(gensym("window_name"), (t_newmethod)window_name_new, NULL, sizeof(t_window_name), 0, A_GIMME, 0); class_addbang(window_name_class, (t_method)window_name_bang); } pd-hcs_0.1/ascii2int-help.pd0000644000076500007650000000123711213554662014440 0ustar hanshans#N canvas 438 263 461 272 10; #X floatatom 253 143 5 0 0 0 - - -; #X obj 241 191 ascii2int; #X msg 305 168 bang; #X msg 192 168 bang; #X text 20 169 output current value -2; #X text 343 168 <-- reset; #X floatatom 241 220 0 0 0 0 - - -; #X obj 241 117 int; #X text 38 28 convert a stream of ASCII digits to a single int value ; #X msg 242 63 49 52 57 32; #X msg 138 63 53 56 49 50 1; #X obj 241 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 241 95 zexy/drip 500; #X connect 1 0 6 0; #X connect 2 0 1 1; #X connect 3 0 1 0; #X connect 6 0 11 0; #X connect 7 0 0 0; #X connect 7 0 1 0; #X connect 9 0 12 0; #X connect 10 0 12 0; #X connect 12 0 7 0; pd-hcs_0.1/ifeel.c0000644000076500007650000001755011213554662012535 0ustar hanshans/* * ifeel mouse object for Miller Puckette's Pure Data * copyright 2003 Hans-Christoph Steiner * 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 3 * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * based on ifeel_send.c from the linux iFeel driver: * http://sourceforge.net/projects/tactile * * there is a difference in the naming schemes of the ifeel driver and this * object. The ifeel driver uses strength, delay, and count. This object * uses strength, interval, and count. * * strength - the strength of the pulse (I am searching for a better word) * delay/interval - the interval in between each pulse * count - the total number of pulses to do */ #include "m_pd.h" #include #include #include #include #include #include #include #include #ifndef NT #include #endif #include "ifeel.h" #define DEBUG(x) /*#define DEBUG(x) x */ #define IFEEL_DEVICE "/dev/input/ifeel0" static t_class *ifeel_class; typedef struct _ifeel { t_object x_obj; int x_fd; struct ifeel_command x_ifeel_command; } t_ifeel; /****************************************************************************** support functions ******************************************************************************/ void ifeel_playcommand(t_ifeel *x) { /* const struct timespec *requested_time; */ /* struct timespec *remaining; */ #ifdef __linux__ if (ioctl(x->x_fd, USB_IFEEL_BUZZ_IOCTL, &x->x_ifeel_command) < 0) { post("x->x_fd: %d",x->x_fd); post("strength: %d interval: %d count: %d", x->x_ifeel_command.strength,x->x_ifeel_command.delay,x->x_ifeel_command.count); post("ERROR %s", strerror(errno)); close(x->x_fd); } #endif /* __linux__ */ DEBUG( post("strength: %d interval: %d count: %d", x->x_ifeel_command.strength,x->x_ifeel_command.delay,x->x_ifeel_command.count); post("");); } /****************************************************************************** input/control functions ******************************************************************************/ void ifeel_start(t_ifeel *x) { DEBUG(post("ifeel_start");) /* * since ifeel_stop sets everything to zero, we need to * read the inlets again to get current values */ ifeel_playcommand(x); } void ifeel_stop(t_ifeel *x) { DEBUG(post("ifeel_stop");); struct ifeel_command temp_ifeel_command; /* store previous command for restoring after stop */ temp_ifeel_command.strength = x->x_ifeel_command.strength; temp_ifeel_command.delay = x->x_ifeel_command.delay; temp_ifeel_command.count = x->x_ifeel_command.count; /* * there is no 'stop' ioctl, so set everything to zero * to achieve the same effect */ x->x_ifeel_command.strength = 0; x->x_ifeel_command.delay = 0; x->x_ifeel_command.count = 0; ifeel_playcommand(x); /* restore previous command so the start msg will work */ x->x_ifeel_command.strength = temp_ifeel_command.strength; x->x_ifeel_command.delay = temp_ifeel_command.delay; x->x_ifeel_command.count = temp_ifeel_command.count; } void ifeel_strength(t_ifeel *x, t_floatarg strength) { DEBUG(post("ifeel_strength");); /* * make sure its in the proper range * this object takes floats 0-1 * the ifeel driver takes ints 0-255 */ strength = strength * 255; strength = (strength > 255 ? 255 : strength); strength = (strength < 0 ? 0 : strength); x->x_ifeel_command.strength = (unsigned int)strength; } void ifeel_interval(t_ifeel *x, t_floatarg interval) { DEBUG(post("ifeel_interval");); interval = (interval < 0 ? 0 : interval); x->x_ifeel_command.delay = (unsigned int)interval; } void ifeel_count(t_ifeel *x, t_floatarg count ) { DEBUG(post("ifeel_count");); count = (count < 0 ? 0 : count); x->x_ifeel_command.count = (unsigned int)count; } void ifeel_command(t_ifeel *x, t_floatarg interval, t_floatarg count, t_floatarg strength) { DEBUG(post("ifeel_command");); ifeel_strength(x,strength); ifeel_interval(x,interval); ifeel_count(x,count); ifeel_playcommand(x); } static int ifeel_open(t_ifeel *x) { return 1; } /****************************************************************************** init/free functions ******************************************************************************/ void ifeel_free(t_ifeel *x) { DEBUG(post("ifeel_free");); /* stop effect */ ifeel_stop(x); /* close device */ close(x->x_fd); } void *ifeel_new(t_symbol *device, t_floatarg strength, t_floatarg interval, t_floatarg count) { DEBUG(post("ifeel_new");); t_ifeel *x = (t_ifeel *)pd_new(ifeel_class); post("iFeel mouse, by Hans-Christoph Steiner "); post(""); post ("WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING"); post ("This object is under development! The interface could change at anytime!"); post ("As I write cross-platform versions, the interface might have to change."); post ("WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING"); post(""); #ifndef __linux__ post(" !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!"); post(" This is a dummy, since this object only works with a Linux kernel!"); post(" !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!"); #endif /* * init to zero so I can use the ifeel_* methods to set the * struct with the argument values */ x->x_ifeel_command.strength = 0; x->x_ifeel_command.delay = 0; x->x_ifeel_command.count = 0; inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("interval")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("count")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("strength")); if (device != &s_) { post("Using %s",device->s_name); /* x->x_fd = open(IFEEL_DEVICE, O_RDWR); */ if ((x->x_fd = open((char *) device->s_name, O_RDWR | O_NONBLOCK, 0)) <= 0) { printf("ERROR %s\n", strerror(errno)); return 0; } /* ifeel_strength(x,strength); */ /* ifeel_interval(x,interval); */ /* ifeel_count(x,count); */ } else { post("ifeel: You need to set an ifeel device (i.e /dev/input/ifeel0)"); } return (void*)x; } void ifeel_setup(void) { DEBUG(post("ifeel_setup");); ifeel_class = class_new(gensym("ifeel"), (t_newmethod)ifeel_new, (t_method)ifeel_free, sizeof(t_ifeel), CLASS_DEFAULT, A_DEFSYMBOL, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addbang(ifeel_class,ifeel_start); class_addmethod(ifeel_class, (t_method)ifeel_start,gensym("start"),0); class_addmethod(ifeel_class, (t_method)ifeel_stop,gensym("stop"),0); class_addmethod(ifeel_class, (t_method)ifeel_command,gensym("command"), A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); class_addmethod(ifeel_class, (t_method)ifeel_strength,gensym("strength"),A_DEFFLOAT,0); class_addmethod(ifeel_class, (t_method)ifeel_interval,gensym("interval"),A_DEFFLOAT,0); class_addmethod(ifeel_class, (t_method)ifeel_count,gensym("count"),A_DEFFLOAT,0); } pd-hcs_0.1/examples/0000755000076500007650000000000011466076240013114 5ustar hanshanspd-hcs_0.1/examples/move_pd_window.pd0000644000076500007650000000212511463432273016460 0ustar hanshans#N canvas 532 145 637 496 10; #X declare -path ..; #X symbolatom 247 208 0 0 0 0 - - -; #X obj 232 155 pack 0 0; #X text 72 -108 move the Pd window around; #X text 29 337 You can do lots of things using Tcl/Tk commands:; #X obj 328 338 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/wm.htm ; #X obj 246 130 trigger bang float; #X obj 53 -76 unauthorized/grid pdwin 200 0 800 150 0 600 0 4 5 10 10 65 -53; #X obj 232 186 zexy/makesymbol +%s+%s; #X obj 246 109 -; #X msg 246 86 600 \$1; #X text 412 234 "." means the Pd window; #X obj 232 259 pack symbol symbol; #X msg 232 281 wm geometry \$2 \$1; #X obj 337 238 symbol; #X msg 395 206 .; #X obj 395 182 loadbang; #X obj 471 205 hcs/window_name; #X obj 231 308 hcs/sys_gui; #X msg 471 181 bang; #X text 503 178 current window; #X connect 1 0 7 0; #X connect 5 0 1 0; #X connect 5 1 1 1; #X connect 6 0 1 0; #X connect 6 1 9 0; #X connect 7 0 0 0; #X connect 7 0 11 0; #X connect 8 0 5 0; #X connect 9 0 8 0; #X connect 11 0 12 0; #X connect 12 0 17 0; #X connect 13 0 11 1; #X connect 14 0 13 0; #X connect 15 0 14 0; #X connect 16 0 13 0; #X connect 18 0 16 0; pd-hcs_0.1/examples/changing_the_colors.pd0000644000076500007650000000450111463432273017437 0ustar hanshans#N canvas 231 465 735 462 10; #X declare -path ..; #X obj 133 416 hcs/sys_gui; #X msg 39 15 set canvas_fill green; #N canvas 0 22 492 479 default 0; #X obj 84 23 inlet; #X obj 74 366 outlet; #X obj 83 80 bang; #X msg 74 119 set canvas_fill "white" \, set text_color "#000" \, set select_color "#00f" \, set dash_outline "#f00" \, set dash_fill "#f7f7f7" \, set box_outline "#ccc" \, set graph_outline "#777" \, set atom_box_fill "#eee" \, set msg_box_fill "#f8f8f6" \, set obj_box_fill "#f6f8f8" \, set signal_cord_highlight "#58a" \, set signal_cord "#558" \, set signal_nlet $signal_cord \, set msg_cord_highlight "#474" \, set msg_cord "#565" \, set msg_nlet "white" \, set mixed_nlet "#88aaff"; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X restore 271 387 pd default color scheme; #X msg 271 365 bang; #X msg 47 35 set text_color grey50; #X msg 67 76 set dash_color orange; #X msg 57 55 set select_color magenta; #X msg 79 95 set dash_fill green; #X msg 87 115 set box_outline yellow; #X msg 97 135 set graph_outline green; #X msg 107 155 set atom_box_fill green; #X text 268 47 changes don't always take effect immediately \, open a new window to see the changes.; #X msg 119 175 set msg_box_fill green; #X msg 127 195 set obj_box_fill grey50; #X msg 137 215 set signal_cord_highlight magenta; #X msg 159 255 set signal_nlet green; #X msg 167 275 set msg_cord_highlight yellow; #X msg 177 295 set msg_cord green; #X msg 187 315 set msg_cord_nlet green; #X msg 197 335 set mixed_nlet green; #X text 297 115 you can use X11 color names or web colors; #X obj 325 144 pddp/pddplink http://en.wikipedia.org/wiki/X11_color_names ; #X obj 326 164 pddp/pddplink http://en.wikipedia.org/wiki/Web_colors ; #X obj 362 225 pddp/pddplink http://wiki.tcl.tk/1424; #X text 352 185 more on using color with Tcl/Tk:; #X obj 362 207 pddp/pddplink http://wiki.tcl.tk/3538 -text color values available for syntactic use in Tcl scripts; #X msg 147 236 set signal_cord #ffbb00; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 2 0; #X connect 4 0 0 0; #X connect 5 0 0 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X connect 9 0 0 0; #X connect 10 0 0 0; #X connect 12 0 0 0; #X connect 13 0 0 0; #X connect 14 0 0 0; #X connect 15 0 0 0; #X connect 16 0 0 0; #X connect 17 0 0 0; #X connect 18 0 0 0; #X connect 19 0 0 0; #X connect 26 0 0 0; pd-hcs_0.1/examples/cursor.gif0000644000076500007650000002670511466067565015144 0ustar hanshansGIF87aØäñÿÿÿÙÙÙ,ØäþŒ©Ëí£œ´Ú‹³Þ¼û†"”扦êʶî Ç®!×öçs ÷þЂĢ5<*—º$ó ÝE§T$¯Š:³\ã¶ þ}ÃdܸŒŽÓlÖº ?½ãñ9½m¿§óú2¿öØ%8˜UhX…˜8µÈåøÈ)©DYéu…‰v$ð¹ò)P§  ×É$º:Ê– uŠZ¶šR+;x‹7» öª*JšÆzBŒ«g||ÇìÊ 7 ÚêÌfœ¼»ÌL÷ ¼ý‹]ÍÜ, M~ǽN;->®þÝE^®ÜǾGߦÏÉ_ïš9pºæ{×ÎÂ} ŒwhÑ$ž“ǰºþy øKˆ,â¿^#!b´H¦ÙÇŒ ½<é`kY¢)·%I,êvÚè‰ãšÀ’7Ãå„ç“ Ð¤0–Ú¨Y3æ°•™*•iõˆÓ"Kt%³•k¥°YS-++Ú g× QëÖGÛµsÑÖ-{7k^«{™öMú×gàƒIîuxSbL‹ÇÂÛ„ßÑ“©TÎ!è² Í†¶Nã,©qhɞʀ®‘¹´àÇA=Òe ùÆ›Ó.h+±Ýô1îP€aSn¡Ò«ðÏ8?»ÖâHpãïb'$Ùè)]Ò'/7Qûóã¶œo§È9su¯Å‹­¼>Ü<öõ¶„{¤ê&ùfî(¶ºŸÝ¨{iÈþëíÏŸß~®íÄl§ßt € ˜]}Þ7àƒRÌg!~żw ƒ~8a…v(CXJ¸¡…õQ¨b\°hŠžÈiªÇ!{GÁˆ¢ŽéåÄヱØBj7jG^Š;’Hß4†ØdnOl·"qD’ç{ÈçC-1®¸!F×\0Ôyg™="¹^šÄ…ɤ â•)MqV²àåšI¶‰çtð­ Ú#22h"…ZC9Ûu-ú¤D&i‹Šyè ™²iê1B¨¢ŽJj©¦žŠjªª®Êj«®¾ k¬²ÎJk­¢6: —¸©ë®€öê«YÀ›±E|Zþ•±c*ËÖ°Ê"ë³b8k,´IkµÄZ«¶%j,·Hy+¸¾Š ¹?™»+º6©‹»¸*&‡á¤]½KÜ«ïU‰üyˆ¼:T*U5Zö»¯À›!\ã¿ Oªp T ]?ƒ1 Îé™nJ=R¬HÆ/Øcϸ/øp&SieÇ'£œò²îDkÉ_%rmßyš³ÄÇ“èšÇ‹º˜v»a¹#¶»b½3ö;£µ¿ànÝÃÿzü…É#¿<óÍ û¼œÁ3n³/°å×§Î2o)Nù½Tš}‰(Ç¿Œ¡ñF(Ýœ/¥Œo~æÀmÌü᫦ÂBÛK¾Æ¬_¾)ýO.ïÓÙ,óìy—±ÓLª„3×áKÝ Dö¤3Á½Çl jQ˜Aòí‰C•)S¾î×7µEèË XؾûeiI&T!}ÈÁbpl% ”ˆô$©â‡?Ôœ9Kcvr˜¸¤&1­YMlÚj›Üì¦7¿ ÎpŠsœä,§9ωÎWaÚÌ%¡Üi(xvFžg[gñ fÍ{F°ö¤'§ü)LjêÓ‚ý,(?šO€*.¡e(BþªÐdAcžÙ¨§Ýd·6¤Åsk%HGû·Ñs„È7G5Œf´zÌ|—Á>ª˜V¯e$¨F¤Ù:É4¦ÿ$x´qÒÙ$¨Óœ¨LWÖS·!’¨üêQgš8‰òt§3Rž˜ Ì‹ÒÍe´ˆÓJ5šÔ”’‘ø,Ý3÷i±'rµl*ýêóWØYFC¤œêžÊÖ×¹QVë^§@Kšº”hx]Þ½™Ç¿†n¤m¨Ç~ª&¬roªauÍì½ÃZG°iIÍúµÓO³—•l±<[Øä ´’a™\‡·ÚÎ:´—U,êb+ÄÙ6ö¡ÃÄíùxûËTد‚·¡#†þËÇßÈV9á*æúòÆÜÚÄÓ Úq][Óôý”˜Ò³Ù ×€žì.¯;ËòR§åj#GUV¹‡µtj–b¥58GvƒÐ„µ`ØHWªÕ>—\Z%ÙËI’¿7Œ#|›CpÀV«£»È;–1ˆúHÚpÆ 5ŽuÃ4 ‚Ø{ZÕd8Mu„Ù97î(ÃV$£÷´˜_úŒ…¿H£—Æ8†P‰ÁØ_w‰Ç8”e-cøàèîˆHN.*·hÜ.±”®$î™49_Û¸À\¶¡•;èÀ(G Ág¾ {éf_sÌ©D3aQ6˱½¥§i·þ ¢~ê¬Èd¡³®ü¹©†ÎkuÛg>7”®´¥/éLkzӜÉ)éÌF³ÏómÀ+êP—zÔ¢…-«_[;S‡LÕÍ“5tQ½jZöն圭 ½[HOZ×,•óyU·‘V'&k}leµæÜÖLÁumvÙô¨ìk/šÑÐÞ*ZÁJKc[wq¡Øö ,ÌÆDÓiÛÙ¤’ümgÓÜîDwY%Ál:g¶ik“Mï­±{²øN!¬aÁ2=û¬ ìõ[Ÿ]ìr³›_sKòÂ+‡]kÏ•%Ó8`?í[wûг&lÃ=ë]‚\Ü4]í-m2å°j²Óí5þX<1"+ε D˜—œ¤O±YõKê½ÆËÕh\….ò‰}ÎÈfö`ýóSŸß;âà©PÀ'ÂôxÓ–åJÆÚË«ýóØ‘Œ_':Ä/úöœë|â½CnÚ«÷Z«\¯4G¸tÎ×¼ïºê¡<0jkxxý:§ÃƵމ=Z^÷r‹‡„ä%›—û¾òΔßÝçªÝGo\½›w|0?_>õ›ñ~'.c#ºÀžˆ…z^Ã7­G]9Öd]ÏcH‹_8Ñ<įJB®æÖ¹ŠC;ë;?óE.8æKn±ß8cÞ$Vú{Vºz²Hfê›÷‹^¾£ô$•YÐÿ½r™Gè|>þ_Ü{¹ï•¶|êdÖ9ßü>°c_^¹oÿ·fûehâ= ¢EB–sÉ•IÔÖt'ln4•w~œ—r’@h,gˆ{˜kíôi#H‚%h‚'ˆ‚)¨‚+È‚ €·%yW÷x¦§Z1ˆz0ø‚¾fƒ[—j4y9Hy;(v=‚3X„ƒçƒ®„†Ó”„€uD«/EU>%xr÷Yò6bwmWhvSÇN#ç…×Da—$5†Šâu 5v`†JåW\¨†iX>Ì'‡ëPxI‡uoTtô’Zs8Vúvx7'ˆ—Xz(sw¸Qh†¶_„¨ˆGTämÛ…†U(wfbuWþl˜xç†üÂqž(z؆thI‘µ‰ShrløˆšHrÏ—‰Èg‰Vuµ¨SRÕURDwá†íæS|¨‹TèŠ/sG…È6‹ñt船ˆˆ]h‡ŸH.<'$Å'ƒî†‰]uˆÈ¨x»´FÖȃ­8ŒÓFve‚­U|½ø^Åh…Ùˆ„GXƒK˜ŒBȉDl÷hŠù(ø¸§‰R)îè}‰ôÓ¨Pœ±=”eè5ŽPEÒè-ƒöŒ'·ˆì¸‹7yuJÇr ¦~ f%ûÕ^·qbæ'%€ ØLëe€~Â5 v3è1a‰)uÇAÌH€ª÷}~;™}NrE R“Åå“Aþ^tH"5‹”>V†x”€6–!=I;ÿÖ!·hy­`Ö‘µw“@BW1æ^[Bnd²ØpPÆEÁ÷bö‘¿7”ViG8yA¡ ‚C‰È1å±çEEg¥’Ôt' ãö¨`Iãa9J°ä—•È+ñðImÇö¨˜Ù‰¿Hu—iR´è„ðøƒOˆƒ"Ø‚§‰š©©š«Éš­éš*(Ý›êÒ„+é™Fx›ï˜›ñHš:8›ù›I¥ØÅ©™ÇyŽ»9𢩄½9ˆÇÝ…B‘€x„mÑI’å1„Sj÷2V]õ¸™¿¸)’‰‹ ¡ŽØøáé þ|Šò‹9i }QY¼·'ÜÙrŸ‰žéÙmö©|–Ÿözb( Ä— C4e ÉRúŠóIŸÁè Ø‰ŸYsŠl)— Z‘z^£¡)ÅŸbé9j3çžk¶Ÿ`(aé¡÷‰Š ¢7˜¡u2£÷Y¢&ŠŽøqˆ·¢¼÷Ÿäéty†=ê£xSœ©ŒãŽþ¡KÁ)‰œù†‰(ZzÌ©¤ì™¥Vz¥Í©¥¥¦¾éœL8œ¬ˆ›™™œjª|kâ¢ÀT*f ©“‡¤Ì¸#:~¸÷¥÷wµ×¥é] 6ê§äe§ic~(•¢ا ©®—¤MS§ý—!*þ”j©2–2wÁ—hÆfFÚŸsJ 覦tHé¸3ÃW€ªŠyÚž2 — ¨e©ú˜Z%W´©šÇªP¸Dlthª“fÙ"Ì!FA ¬º7§Õ”Q%EÑ÷Hbp­W)!;Ò>Ûç–æX‘DFD…º{Oñ­Ò'’WfF¦/ãåATƈк®f3êzKìú¬‚ãWyÚ©Ló©0J‰ÚõÕ’¯zg›š«ï× ýò ÁQ°¥”^‹Ù¾7ªµê€ ›]n¦#Iz½Ê¦º¹Ky¦â·¦ê¹ž¾H ÜynC  ijœ!+j¯é²/ ³1+³3K³5Ke:R*-µylÊ ¦>»¥@þ+¦BK¦c„:Ë,<›|È©²L˱+Û´,+µQKµ±—‡Z}”¸£€SQ9jµ1*‰Ù‡*§µ 9¡èµú¶Ï¯þÚŒêF`:‹º§l²µmC¢>©CÖžXk i˶6'·?Š‘wºcñ·¶a;aƒëL~ø «˜Ú¸(K¤l¥B;·wgò¸æ…«’;´ :¥q·UY:…ë·Û’¹@깊º­;D4¶/a¶ˆq3™¸5Wº€ U.)ªYyn‹–]È`¹»>¤h¨J¯†K]î'º®K·¾:幊Cø ú5²„½2 ¸À¹¤^’½º½m:¾²I²„*¬·[¾þ4:©EK´G»¤Óë´¼i´fŠ´Ïò±)û´ó»œïk¿ŠK§Ù5¼Ä+¿©ç;âȤæ^5z¶YÀ“»¨Ì«•´»Ê3–,©ܨ뛵l¼Rfe–)¤® “t"q]ö»B%v„’·Ê•šSìЯÕX¹;“Û¯ Ù~l7®fÔfLf›a[ªJÙÃ5¼ Eà—ÂË ÄÚ”?™c¶K]óZD-f®.Ö³SŠ—_âÄmÛÀì‹Å„TÃ¥q—ÄÆKœ-Ç g°8°_`^ÅÄ£{•e\qT±AŒ¥–šf˜'2:”’&ü˜ kÀÂã ¤´´Ê½¸ã¥ùC¹YŒ \¥P{¼x‘þ¿G*Éô Q6«É›ÌÉìÉŸ Ê­r¿ÕRÉo;µû{ʘ¼±ª|Éý»Ê®ÜÊ?ûʲËA;˶\ËŸ›Ëî{˺̿Ëɦ¼{ aÕ›¼Ï©µL§ñ©Á<™HêÁÖ+¢¤äÌ€v»‘û¼º;u×þÞ ß ~×òý¿êM›ÞÜ îàŽÊyÕV…½ÐWÙ™­×ëEÈN7ÜÑ ÜÔ[»¥mRþ¬ÑÔãlËhÕ‘ ¥¾7ÖîœÚîÛ'¾ÏÉ=Òò0ãÀ¨žT‡;Îã«­}8m7„9ä4^Ÿ_MªÈä´­}#®Ù/·âIíT˜ˆ Úà³Y3.ŠŽëåèÒ@®vfŽåò3æm¾0|â?ºÖ\>ÓfícÎäG¯O~(u®æ æáÝãWÎÔ›—ëáGþäP>Óƒ~þÝ·äpî]“ä»”~¸ˆ»Ûß én剴çi´7Þâg®¨Q ‡>êmØèŽîQ˜>2rÚ™'ã®Ç*žæ,Þ°þ¶¨ê¼n.Õ ^Ðl¾èø+àí"ìÒáÄ~àÍá>ß½íb-®aζ®í¼‹Ä*Ùqa"¨Jå¶ÎíúÙ'¶½—‘ÞàîÐ 2[þÚ«Òt=àÈÆgZêK—+î}ô€‰ŽÈò®˜«G{õjçŽï¬¹)©ëÍÅpœâÍ‹”b,CÀJ•ˆ©¼Åkðs©«žéØÇeØê®3â±èøðíx=á çíó‡^_%þêFN’º“èøSã‘ïõ,-ëD^ùì}Bù”%åœ?ú1\5™Z›ßÞ¬ïµ~ù¦ûãàâæŽê&ïã¡ÒµӮϒ ØÒ+ûsnËoû9>¹ÂoõÝUüÇþø¾OnÀÿåÒˆoÃûŒº¥o—Ûoê•nýÀ\2þª?‹¹>ì©Ò??ùá¿q¥•ý~ÑöR½È_þ–oüz÷ÇïÖâäoø‰Oð1u¹EZ”“ÆjÖéuïh³‹<ÑT•ÌÕ}aªéžmíÛŸ0'q?áЂ!‘ˆ`’™[6 "IÊxV±©k–»ÙvÁ“o˜¼—цsº¼f‡Ýïn\ž¥×«w›ÔásõVø'þþ’ñß3¨:9È%+)# §,ós"C4OF‡NiT0+Jû¢XeaQWý&£¦8g‡\) o¡€ SA‰¥twqs•[C_ isŸ—›c³e7kOŠ=­¨˜I?¹‰À}`uËO©þ¥÷(Í·Ùú Èí…Ôëwq²$‚`3l &¤ñOÒ9õ)̶ÏÛ † –ík‘c'vU\|¸É!¾†ãÉ«‘±¤ÆŽc¹„1†È–ù^~×Oå±{#sRÜéká¼U½°•Z©?£)˜E]ún”0’o<…Õš.Ie©Eë4~¼z|‰4]ÙF€Ü¾ÅbÓ'\¹J‰Ååò! Ý»ßôþàl¬Ó½ à ü‰_Æ^?î)yÎË—1gÖ¼™sgÏŸA‡=štiÓ§Q§V½šukׯaÇ–=›vmÛ·qçÖ½›woß”Á8.&òðÂ7@žÜLqæ/–?Wâ\zþHêÕQDÇ®½:wéÞŸƒg.>9yãæ‡£®ž2{ÉîÃg,ÿ/ý»öåâ«¿EøËaƒ½Šˆj¾¼n¥ÑÏ+#ƒ‡´©, ##©þ,G:ŒaB¾ ›¬ -ÔðªÿBœf)9ÜÛ¡KZܣļ$ ˆÃ»¹¦]СSÔpD™ˆq’qä1)¡hÌ,!+´KÅp~¸ôÐB/þ=²Ò&Ñ,¤S'ÔMK|ÕO 1ÍU45ðL4m°U ¢ÉWZ1=ÕÀ_MiØ7#ÕÐß$ÖÔUCX]a½Ì0¥å[<¥ÑXn±kÌZ¨¨5¬TCË0UU'-×DfC•·-{ïÅW]}Yå×Ósåõë ¸ÞºdÅë¦hüí·áj†x˜@YÚh„k¸\ƒÚ:·;×*Yká*Ý 8v–²“yœµPb9+t×ò±)mØ’hdtÂr¼´Vœ‰«]“©J,›û”²gMš)^FMB4'˜ÎrZÇ«­>ùg;r´gNÂéªÝÜÙ–TÉ´Ú]`£~«Šþ»¦úë¸Ç%® *³~†gpÅ6¨aG­[âwõYcrõôûè¦L¾ùŽÝ¶în€ŒŽyqM‘ JíÆo67â¢>Ï8ô°3ÿÎeÓGÿ8uŸAVzÖÕ%‡,Ùg§0ßpÏ]÷ÝyïÝ÷ß^øá‰/Þøã‘'ÍvÀ–o¹ùRŽöy ¢_vz”O/ûñ¶/¯ûó¾O/üõÆo¯ü÷Î/ýùÖ¯¯ýûÞÏ/þýæßñzìïÇ?»÷g¡~ûç¿A}ëu'rÝ¿ HÀµ5‵K ¥-ú… lˆc`³³¾ ŒV¼T ö?¤ÐHè¨à¼Jh?\yk`"¤™×Á=Á0v¸þÚ ³@•^‚ž{`³¤gC„P†=#"(”­uÑÐ"í;¡‰À: Q‰¥Ú!¯˜H::õhXLâ± Œª±ˆWŒ¢ §DHåðÊZc ¥(%"qM$Ü‹ÞÆN‡W‚{£w¶‚Œ{L€’(’Å&*â‰ÔV#QhH5¤/-Š\dq(ÄfY².Ìäa8YCf…riVô&I|J~ª\eù¼AJxD®<$-UæÊê=M—¸,d/mÉÇ`Nr˜Äü‹,•ãK땎{†RNFTñ0sdf ZyÍ›‘L#2›#*4 œƒ»ãÑÅTmn„dþæîʽЎªÚœXzÅÎÎòjQëG¯øw‹”Ä#c;ÆL#M{T¾¤‰³y>žÆÊ 2ºÅQ›­Â¹ ‰vmJ’R‹GzaåSn…èäFÚP—F3Y;A5:µOÎ*Áò£1'¦Q²õs§íT¤v4÷“M¢3•a¬ÕXQ{ºSMe\ä ÊÐ<ŽñF"¹)NeZŠÔœÉ@ÍÇ6Ú™§Så¦6ÁwNô© íâ[]ÇB¢zªr—Ô4d_“<Á–°…5ìa›XÅ.–±ml1ؽJR²¤¬2yÉWÌúu•í¢f!ëÙS´w fþi¥ ZÒnV— -k'ûWØZV¶¯µíiÀ#ŽS™Åk­r;Àànq·šÜ [_éÌ© W®{k-q?Ïb!÷–Ê=u“K¯qv…Ñ­ë¡ [&ä*´Ý$A'ô¦ôŽxC¨xÅ&.nÒ´3Mm™;^®…×¼}ÛY?ûÛãb·ºKŒªo¿ë^¢ö÷š Íï»Ö«ÅÊ·–L«HÕ Ó˜ø­â´ï­Yáó‚÷§Þl¡dËÐË»R|UR"Užûr0pµchTµWcG–lÓÎMï˜r´˜±¡fË™ê]PŒ Ô·“V¥†RêšÄ)õŒm´a¿!J¬Ö ‹íÈiU&-iÞøl…_‘{Ø}¦›Ú$wë¤Ø§²ªÐ&-ïåuÚÖðš¯íªëî©¥ènÛEÓRQŒDÙËõ6Vò‚¯Îh¥ã86çDþ·RSÜÒÃ8—éêN^ŽØ’5¦‹à¡y—œŸ{›’%·–è?«OÔÞc2¹ƒ$»>w8ð}EzÖp½œtÖ±šïüZÇ.éMwúÓ¡u©OêK¿mÒí¬ç¬ÛÒè‚FºÖ±v°ëx6mÙ¯Nv9«]µbGûÖ×þv·Ç½MQÕ•±ÌæHçYïf¤”ßé…wlï8ÇGÇ+üî.ø¾ÓÒ5•˜f7'Xñ†ãìø¬^y@¨d0Œ t9 Y¥’Ÿ|éMßÃ{ÞðL#}é Úøx">,‡|ï •¿zÐÖü ë½>úÛ]îVü¹êÑ&ûΚ]ô0®äµ‘=þńǻøÕïòó+ùéGœøt<öÏó<€]÷¡&G=ü-_lw-Ü©üò3?óïG¢ˆÝßý¶çùi·þþÿÏþøoþüÏûêÎOà°Äæ.m÷*íåïô åꬹ@eššJ]M|`m-fŽï§Í2!ÕÈOÃJ„ýJ Ø:°™p› з/à$®WN3pA.ndtHär誊Sàæ ˆÂ¸M×L0™6oŸÞkã„­pv¦ù!¼.P1HÖ¬ªûiÖd$†Dáo(f¢ óDÉçļ.*m6¥jlÒí *WîÝ ŽÛÔÐ ËÍÚ$å ÅþšÖDòÜ0!Ì0»<ÞxðÝZªý6€ßŠê%ØÐÝx*ëdI â&Š£1¬¶‹MÎû-ïtÞ¦ÂØ‚L¦B‘;Å/6Ér¦é‰MíZ‚Ðâ¶kÅÊp°‰«2h moÐånQÕ,ŽH¾Êß”0YŠ1«|0ÐÂ3± ©‡þ*pßÌ[/mkŒÃüBv. ½±“º½Æñì Pÿ°ìªîá1åqé±íñ{§pûþÚ‘ ÐÙq ûqîöñ ÿ! 2 2!r!¹Q ÷‡`ÂÏ….’ðO»"Žxï·:”B2ò6òûï#þ¬ið‘ ÏH%Wò%9O˾è¯&£/þޝù2§VðNûrO„1ø¤iIp2Ó)(iA÷FR¡°Oý"E*UD)ïÏ*#Å([ )²½žrr°R¹´r&õÑ)_¯(¿².Æ’*+R(™2&Í’-l-Qry€2-5-,»«gv²þ 2ùÎÒùúòE²sÛr)õ’%–H$*ëÒvî20A’2±Úäò~&33ÑÊ2ãk+Q"²+'¬$r"ð/óÇü~ð4GÔ¶Oïýe d$*oñàj÷S%ðiÑÑ¡6õâ6“ÚOã@ðDcóÓ’“þ6ùÅ6]Ä÷Ž0w³åX¹è »"ØxfÖÒéàNÓ » …° Á3 õç”b'vqrÖ“<‘pÉ £-píCm5‘sJÚêpÛ ‘1Qâþ‡ eBË$'sñU´ïÛ@Í!oîd?¡asŽÄ@³ÀJq@ECëmW‘ G1åÌEï0 ï¡§&)cO‘“F®âBp£jÔûPc†ê¤Þ nОâ8‰MB#Í+ºªF¼“Ö–´¥±×^Ôy6îJs” ‰ÑK?>[´BKDùíq¶dLq沉·Þ”4¯çÒñK•”ºÐ”Pþ­DCó¬Nâ(a´!US3µ‘(³uQµQõQ!5Rƒ§, uN5I2" 5351ESSåtzXS8+UT/µ5’S]TSSUSõ5;u5³&MÓM¯“'‹ /• ðluœàô-›²ï<órsð~ÕW÷,û(éåŒ -íNÃhïs‘.”3û¦X«ì…ø´O§rZÏGÜ”ÕüU,¡ñóz/¡WÉIP¹¯3ÇuÄ0s6{]CS¡µX-ï}ÜSQ0§"óS]Á,8³'…f1yk_5%Õ\‰•`¶hxÁZ×õåõ2éu[”$µM»L;ÿuW{“Íþ€ˆ]¹•ªuXNG/,U–n•_+_Iñœöðe{gƒê]mbí5¢°*dɱavW˵9¿+fÖ¬QW%SƒdÓ&Ï•fÕ#4:-õ¶hƒh[öјkM•R]µTŸgT”UcÕPßa_5i‘UÓë8ã ö‘µ˜A©VЧÊ7«7#Ÿ¹!­‰q®ŒÙ9Xc™)¼°Æf‘—-w«wÔJær¡ø «ñ8ó@´w‘¬ —¿H¿lj é9}5ާ‚·ÙP5ìp1£(‘CMWA×Öÿ‰ · ß‘”p?\Ê{º´ÔpÑCJó“À޼G3AÛ gDA?J¢ÕíaŽA÷Û\ÞþºÏàœÞJ\É ±…kv·¼TÔxϼw·Mi¥ímsÿ-—w»ÍŽaÏǹyÒ¨™T*ñ¨—Zr÷Çíy‘ ár¼;ýGýÊvâÈ…¹™£¼}¯Wíû“÷7óJ§‘™o½z½±ÙÖ㜰5ܰïºÃÛz؉½ØýØ‘}êòØ-v0üuÛü“/ÜÃ3œÁ™}ÂQYÛ}Û;|Ù¿ý°7ü×Ã=ØÝÛÜ}8×—9–{Ï?“Їܲ“Å™ÞѼ]·sk[ÝùÝy]Ñ9NÑJ ܲɻµuœKWûÕ–?ý›» ÞOo(â‰Î…S(Ñã]DxvµþÕ[×Yàé<ït¹G…Ç×ÜjY˜½Í»¼3¾ÆM幋A¾‚[žæ)Þ:“ŠÞ3Ûâ)ûá¢äexçmâWÖ_>so~j‘ç@Ž~Ú[8E‰›Ûí9¹£]ºíÔéê!YÜ‘wÞ[±è©úoÅ~ì«ÜÏ=ƒÿÝÔ¥^Ú·]¹E¼ÙWçÙ‡ÝÉÞîSï¹Yî»Ùç9\»e<ïMžäû=ðË÷GណÖÄ]üïi¼¾ò°¦“ó_2£[:™Üˆdñ¿`nÝмIE¾LmÛ…4˜Cÿô¡ý¹§åòýÖ•“ÉÚÁøTõ¢BÙ‚öõ©YÍQ÷Ò{¿þ×)mJoÜJ÷mŸBMQ‘·al; Ÿ_ß“-ù½?ÕžÈA]¦‘M%LÎâ# ãL&‹ =ýqE©ê¨¶çå,Ö­¿ÇIí}³ŒÜÚ >¦.F0Œ’‰Z§¹xså:Š#™|%jiÓŠ¢§ËóÓ7.Û9ßw»/(ô<†Æ#À¡\2›Î'4*R«Ö+6«Ýr»Þ/8,“Ëæ3:­^³Ûî7<./"ë½9>¯ßóûb;`Žß a¡á¡Z â b£ã#$äâäK¤å%ff"%gˆæ'h¨¨Tg)Ç(jªj¤i«Ä*l¬lžë€Jéì.ooY-Âm«/q˱qppí1s3s²í²ó4µ,t†tµö6è5n6w¸¸£·ø8z:_ù¹ºû»»+<}ý&´ù¼ý>?˜üp¿€¯ü35ð Â'ׄLè0a²[ 9=¬8Ð0‹ùal·ñ#ºŽú@’ )²aÉ”Ü:å©ò¥6–'“À¬ÙŒÓDo6w”¯eË @¿ % ˆ'Ò^Z˜û‰ëgSlQ&­kiЩLD ŠÄ*XU>±E³¥ÁëPªa×v›Ù‰-\Mn߯­Ëj.%»z÷òí «;pd-hcs_0.1/get-audio-dialog-help.pd0000644000076500007650000000135011213554662015662 0ustar hanshans#N canvas 65 159 611 344 10; #X msg 34 111 bang; #X obj 73 174 pddp/print; #X obj 53 179 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 34 203 prepend set; #X obj 34 278 send pd; #X msg 34 249; #X obj 34 142 get-audio-dialog; #X text 246 249 <-- this message will be saved as part of your patch. click it or [loadbang] it to configure the Audio settings. Make sure it is attached to a [send pd] so that Pd gets the message.; #X text 153 93 Open the Audio Settings and click OK to get the data \, then click bang to use them in the patch; #X text 9 23 get the Audio settings to save as part of the patch.; #X connect 0 0 6 0; #X connect 3 0 5 0; #X connect 5 0 4 0; #X connect 6 0 1 0; #X connect 6 0 2 0; #X connect 6 0 3 0; pd-hcs_0.1/uname.c0000644000076500007650000000732111442735515012553 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* object for getting uname info */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006,2010 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ /* sadly, there is no uname in Windows, Cygwin has it tho */ #ifndef _WIN32 #include #include /* sadly, there is no uname in Windows, Cygwin has it tho */ #ifdef _WIN32 # include # include #else # include #endif static char *version = "1.4"; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *uname_class; typedef struct _uname { t_object x_obj; } t_uname; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void uname_output(t_uname* x) { DEBUG(post("uname_output");); #ifdef _WIN32 // TODO fake uname for Windows // http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx #else struct utsname utsname_struct; t_atom uname_data[5]; if ( uname(&utsname_struct) > -1 ) { SETSYMBOL(uname_data, gensym(utsname_struct.sysname)); SETSYMBOL(uname_data + 1, gensym(utsname_struct.nodename)); SETSYMBOL(uname_data + 2, gensym(utsname_struct.release)); SETSYMBOL(uname_data + 3, gensym(utsname_struct.version)); SETSYMBOL(uname_data + 4, gensym(utsname_struct.machine)); outlet_anything(x->x_obj.ob_outlet, atom_gensym(uname_data), 4, uname_data + 1); } #endif /* _WIN32 */ } static void *uname_new(t_symbol *s) { DEBUG(post("uname_new");); t_uname *x = (t_uname *)pd_new(uname_class); outlet_new(&x->x_obj, &s_symbol); return (x); } void uname_setup(void) { DEBUG(post("uname_setup");); uname_class = class_new(gensym("uname"), (t_newmethod)uname_new, 0, sizeof(t_uname), 0, 0); /* add inlet datatype methods */ class_addbang(uname_class,(t_method) uname_output); } #endif /* NOT _WIN32 */ pd-hcs_0.1/version-help.pd0000644000076500007650000000115410755130521014230 0ustar hanshans#N canvas 313 142 458 316 10; #X obj 364 11 import hcs; #X msg 49 57 bang; #X text 40 12 Get the version of the currently running Pd.; #X obj 49 119 version; #X floatatom 49 168 5 0 0 3 major - -; #X floatatom 111 168 5 0 0 3 minor - -; #X floatatom 173 170 5 0 0 3 bugfix - -; #X symbolatom 235 243 0 0 0 3 test - -; #X obj 49 144 unpack float float float symbol symbol symbol; #X symbolatom 297 203 0 0 0 3 date - -; #X symbolatom 359 169 0 0 0 3 time - -; #X connect 1 0 3 0; #X connect 3 0 8 0; #X connect 8 0 4 0; #X connect 8 1 5 0; #X connect 8 2 6 0; #X connect 8 3 7 0; #X connect 8 4 9 0; #X connect 8 5 10 0; pd-hcs_0.1/noquit.pd0000644000076500007650000000237011213554662013143 0ustar hanshans#N canvas 377 277 497 454 10; #X obj 85 49 inlet; #X obj 86 75 route bang float; #X text 38 12 this disables/enables the menu_quit proc in the GUI to prevent quitting; #X obj 132 98 select 0; #X obj 191 145 bang; #X obj 332 121 print ERROR: no method for; #X obj 276 173 send pd; #X msg 237 142 verifyquit; #X msg 115 221 set semicolon [format %c 59]; #X obj 124 390 receive #noquit; #X obj 124 421 outlet; #X msg 16 200 proc menu_quit "" [list pd "#noquit bang $semicolon"] ; #X obj 16 175 trigger bang bang; #X msg 191 339 rename old_menu_quit menu_quit; #X obj 191 297 trigger bang bang; #X msg 131 241 rename menu_quit old_menu_quit; #X msg 290 318 rename menu_quit ""; #X obj 191 98 route reset quit quitnow; #X msg 312 142 quit; #X obj 124 363 hcs/sys_gui; #X connect 0 0 1 0; #X connect 1 0 12 0; #X connect 1 1 3 0; #X connect 1 2 17 0; #X connect 3 0 4 0; #X connect 3 1 12 0; #X connect 4 0 14 0; #X connect 7 0 6 0; #X connect 8 0 19 0; #X connect 9 0 10 0; #X connect 11 0 19 0; #X connect 12 0 11 0; #X connect 12 1 8 0; #X connect 12 1 15 0; #X connect 13 0 19 0; #X connect 14 0 13 0; #X connect 14 1 16 0; #X connect 15 0 19 0; #X connect 16 0 19 0; #X connect 17 0 4 0; #X connect 17 1 7 0; #X connect 17 2 18 0; #X connect 17 3 5 0; #X connect 18 0 6 0; pd-hcs_0.1/ce_path-help.pd0000644000076500007650000000117211213554662014154 0ustar hanshans#N canvas 121 22 423 338 10; #X declare -lib cyclone -lib mapping -lib zexy; #X msg 21 52 bang; #X symbolatom 32 170 0 0 0 0 - - -; #X obj 21 246 print; #X text 80 75 start at the top of the list again; #X msg 33 76 rewind; #X obj 21 129 ce_path; #X obj 61 150 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 81 148 done; #X text 68 51 get next item in list of canvas-local paths; #X text 29 269 Sending bangs to [ce_path] makes it output the loaded paths one at a time.; #X obj 226 10 import cyclone mapping zexy; #X connect 0 0 5 0; #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 5 0 2 0; #X connect 5 1 6 0; pd-hcs_0.1/debug-help.pd0000644000076500007650000000022411373645062013636 0ustar hanshans#N canvas 234 231 450 300 10; #X obj 148 137 debug testing; #X text 31 46 a simple object to control the flow of print messages \, and label them.; pd-hcs_0.1/sys_gui-help.pd0000644000076500007650000000735010755130521014231 0ustar hanshans#N canvas 449 123 590 584 10; #X obj 78 223 sys_gui; #X msg 27 61 menu_doc_browser; #X text 136 59 open the help browser; #X msg 51 93 set text_color #f0f; #X text 180 93 set variables; #X msg 81 120 bang; #X obj 304 115 colorpanel; #X obj 303 90 bng 17 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 333 89 choose a color; #X text 135 225 DANGER! You can mess up Pd big time with this!! :D ; #X text -24 17 This objects give you the ability to send raw Tcl directly to the Pd GUI process just like C objects do.; #N canvas 0 22 454 304 generate 0; #X obj 101 15 inlet; #X obj 103 275 outlet; #X obj 103 58 unpack float float float; #X obj 103 82 * 255; #X obj 103 105 int; #X obj 103 128 makefilename %x; #X obj 203 82 * 255; #X obj 203 105 int; #X obj 203 128 makefilename %x; #X obj 303 82 * 255; #X obj 303 105 int; #X obj 303 128 makefilename %x; #X obj 103 163 pack symbol symbol symbol; #X obj 103 187 zexy/makesymbol #%s%s%s; #X msg 103 212 set set obj_box_fill \$1; #X obj 103 238 trigger bang anything; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 6 0; #X connect 2 2 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 12 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 12 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 2; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 15 0 1 0; #X connect 15 1 1 0; #X restore 304 141 pd generate web color; #X msg 303 165 set obj_box_fill #a3cfb5; #X obj 38 302 pddp/pddplink http://pure-data.cvs.sourceforge.net/pure-data/pd/src ; #X text 24 257 You can find things to mess with by looking thru the Pd code \, look for things that have "sys_gui" and "sys_vgui". These are Tcl/Tk commands from the pd to the Pg GUI process.; #X obj 170 528 sys_gui; #X obj 317 425 loadbang; #X obj 317 447 canvas_name; #X msg 179 433 black; #X msg 136 433 green; #X obj 33 392 colorpanel; #N canvas 685 90 416 325 generate 0; #X obj 81 23 inlet; #X obj 82 262 outlet; #X obj 83 66 unpack float float float; #X obj 83 90 * 255; #X obj 83 113 int; #X obj 83 136 makefilename %x; #X obj 183 90 * 255; #X obj 183 113 int; #X obj 183 136 makefilename %x; #X obj 283 90 * 255; #X obj 283 113 int; #X obj 283 136 makefilename %x; #X obj 83 171 pack symbol symbol symbol; #X obj 83 195 zexy/makesymbol #%s%s%s; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 6 0; #X connect 2 2 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 12 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 12 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 2; #X connect 12 0 13 0; #X connect 13 0 1 0; #X restore 33 413 pd generate web color; #X obj 33 348 bng 35 250 50 0 empty empty empty 17 7 0 10 -204786 -1 -1; #X text -29 325 change the highlight color:; #X msg 170 498 \$3 configure -highlightcolor \$1 -highlightthickness \$2; #X obj 253 370 hsl 128 15 0 127 0 1 empty empty empty -2 -8 0 10 -262144 -1 -1 500 1; #X obj 250 398 int; #X floatatom 282 398 5 0 0 0 - - -; #N canvas 1009 401 454 304 pak 0; #X obj 25 16 inlet; #X obj 167 15 inlet; #X obj 305 16 inlet; #X obj 122 241 outlet; #X obj 83 150 pack symbol 0 symbol; #X obj 78 69 trigger bang float; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 2 0 4 2; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 5 1 4 1; #X restore 170 469 pd pak ------------------; #X obj 179 410 loadbang; #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 5 0 0 0; #X connect 6 0 11 0; #X connect 7 0 6 0; #X connect 11 0 12 0; #X connect 12 0 0 0; #X connect 16 0 17 0; #X connect 17 0 28 2; #X connect 18 0 28 0; #X connect 19 0 28 0; #X connect 20 0 21 0; #X connect 21 0 28 0; #X connect 22 0 20 0; #X connect 24 0 15 0; #X connect 25 0 26 0; #X connect 25 0 27 0; #X connect 26 0 28 1; #X connect 28 0 24 0; #X connect 29 0 18 0; pd-hcs_0.1/pi.pd0000644000076500007650000000051611213554662012234 0ustar hanshans#N canvas 460 247 298 274 10; #X obj 36 56 inlet; #X obj 82 185 outlet; #X obj 82 98 bang; #X obj 122 56 loadbang; #X text 15 17 bang to get the value of pi; #X msg 82 120 1; #X obj 82 142 atan; #X obj 82 164 * 4; #X connect 0 0 2 0; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 1 0; pd-hcs_0.1/ISOdate-help.pd0000644000076500007650000000031311001230514014013 0ustar hanshans#N canvas 212 52 426 266 10; #X msg 139 82 bang; #X symbolatom 138 156 0 0 0 0 - - -; #X text 49 29 output the current date in ISO format; #X obj 139 114 ISOdate; #X connect 0 0 3 0; #X connect 3 0 1 0; pd-hcs_0.1/window_name-help.pd0000644000076500007650000001377211213554662015071 0ustar hanshans#N canvas 78 51 576 362 10; #X obj 124 207 sys_gui; #X symbolatom 239 101 0 0 0 0 - - -; #X obj 223 32 loadbang; #X obj 124 148 pack float symbol; #X obj 59 88 hsl 128 15 0.1 1 1 1 empty empty window_alpha -2 -8 0 10 -204800 -1 -1 12700 1; #X floatatom 56 123 5 0 0 0 - - -; #X msg 124 177 wm attributes \$2 -alpha \$1; #X text 210 274 for more options:; #X obj 241 292 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/wm.htm ; #X text 113 234 alpha does not work with X11 :(; #X obj 223 69 window_name; #X obj 375 248 sys_gui; #X text 13 37 change alpha of this window:; #N canvas 83 292 729 228 Mac 0; #X obj 25 163 sys_gui; #X obj 124 74 window_name; #X obj 25 102 pack float symbol; #X msg 25 133 wm attributes \$2 -transparent \$1; #X obj 124 49 loadbang; #X obj 25 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1 ; #X text 43 13 turn off window shadow; #X obj 265 163 sys_gui; #X obj 364 74 window_name; #X obj 265 102 pack float symbol; #X obj 364 49 loadbang; #X obj 265 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1; #X msg 265 133 wm attributes \$2 -fullscreen \$1; #X text 263 13 make this window fullscreen; #X obj 495 163 sys_gui; #X obj 594 74 window_name; #X obj 495 102 pack float symbol; #X obj 594 49 loadbang; #X obj 495 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1; #X text 479 15 make this window on top of all others; #X msg 495 133 wm attributes \$2 -topmost \$1; #X connect 1 0 2 1; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 1 0; #X connect 5 0 2 0; #X connect 8 0 9 1; #X connect 9 0 12 0; #X connect 10 0 8 0; #X connect 11 0 9 0; #X connect 12 0 7 0; #X connect 15 0 16 1; #X connect 16 0 20 0; #X connect 17 0 15 0; #X connect 18 0 16 0; #X connect 20 0 14 0; #X restore 60 277 pd Mac OS X tricks; #N canvas 67 329 729 228 Windows 0; #X obj 25 163 sys_gui; #X obj 124 74 window_name; #X obj 25 102 pack float symbol; #X obj 124 49 loadbang; #X obj 25 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1 ; #X obj 265 163 sys_gui; #X obj 364 74 window_name; #X obj 265 102 pack float symbol; #X obj 364 49 loadbang; #X obj 265 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1; #X obj 495 163 sys_gui; #X obj 594 74 window_name; #X obj 495 102 pack float symbol; #X obj 594 49 loadbang; #X obj 495 60 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 0 1; #X text 479 15 make this window on top of all others; #X msg 495 133 wm attributes \$2 -topmost \$1; #X msg 265 133 wm attributes \$2 -toolwindow \$1; #X text 263 13 make this window a "toolwindow"; #X text 23 13 make this a "disabled" window; #X msg 25 133 wm attributes \$2 -disabled \$1; #X connect 1 0 2 1; #X connect 2 0 20 0; #X connect 3 0 1 0; #X connect 4 0 2 0; #X connect 6 0 7 1; #X connect 7 0 17 0; #X connect 8 0 6 0; #X connect 9 0 7 0; #X connect 11 0 12 1; #X connect 12 0 16 0; #X connect 13 0 11 0; #X connect 14 0 12 0; #X connect 16 0 10 0; #X connect 17 0 5 0; #X connect 20 0 0 0; #X restore 60 297 pd Windows tricks; #N canvas 809 137 450 300 get 0; #X symbolatom 42 235 0 0 0 0 - - -; #X obj 42 191 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X symbolatom 126 235 0 0 0 0 - - -; #X obj 126 191 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 0 22 450 300 subname 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 107 137 window_name; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 126 214 pd subname; #X symbolatom 209 235 0 0 0 0 - - -; #X obj 209 191 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 496 269 450 300 get 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 109 137 window_name 1; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 209 214 pd get parent; #X symbolatom 73 128 0 0 0 0 - - -; #X obj 73 84 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 47 36 You can get the canvas name of other patches that this one is embedded in by setting the argument to the level:; #X text 78 147 ^-- this is the same as the top level of this help patch ; #X symbolatom 299 235 0 0 0 0 - - -; #X obj 299 191 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 496 269 450 300 get 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 109 137 window_name 2; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 299 214 pd get parent of parent; #X obj 73 107 window_name 1; #X obj 42 214 window_name; #X connect 1 0 16 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 6 0 7 0; #X connect 7 0 5 0; #X connect 9 0 15 0; #X connect 13 0 14 0; #X connect 14 0 12 0; #X connect 15 0 8 0; #X connect 16 0 0 0; #X restore 336 39 pd get from different levels; #N canvas 1197 96 450 300 get 0; #X symbolatom 73 259 0 0 0 0 - - -; #X obj 73 215 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X symbolatom 72 176 0 0 0 0 - - -; #X obj 72 132 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 0 22 450 300 test 0; #X symbolatom 188 150 0 0 0 0 - - -; #X obj 188 106 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 188 129 window_name; #X connect 1 0 2 0; #X connect 2 0 0 0; #X restore 221 155 pd test; #X obj 220 77 namecanvas myname; #X symbolatom 73 99 0 0 0 0 - - -; #X obj 73 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 53 14 You can also use the canvas receive symbol to get the canvas_name:; #X obj 72 155 window_name pd-test; #X obj 73 78 window_name myname; #X obj 73 238 window_name pd-window_name-help.pd; #X connect 1 0 11 0; #X connect 3 0 9 0; #X connect 7 0 10 0; #X connect 9 0 2 0; #X connect 10 0 6 0; #X connect 11 0 0 0; #X restore 336 64 pd get by canvas receive symbol; #X text 341 114 turn on/off resizing of this window:; #X obj 474 177 window_name; #X obj 375 197 pack float symbol; #X obj 474 157 loadbang; #X obj 375 155 tgl 30 0 empty empty empty 17 7 0 10 -204786 -1 -1 1 1; #X msg 375 222 wm resizable \$2 \$1 \$1; #X connect 2 0 10 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 4 0 5 0; #X connect 6 0 0 0; #X connect 10 0 3 1; #X connect 10 0 1 0; #X connect 18 0 19 1; #X connect 19 0 22 0; #X connect 20 0 18 0; #X connect 21 0 19 0; #X connect 22 0 11 0; pd-hcs_0.1/gid2group_name-help.pd0000644000076500007650000000152411213554662015454 0ustar hanshans#N canvas 185 212 485 324 10; #X msg 43 118 bang; #X obj 59 210 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 300 129 bang; #X obj 184 216 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 187 238 ^-- bang if not found; #X text 12 14 convert a UID to a username; #X symbolatom 84 212 0 0 0 0 - - -; #X msg 172 132 1; #X symbolatom 301 212 0 0 0 0 - - -; #X obj 89 63 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X floatatom 87 93 5 0 0 0 - - -; #X obj 85 160 gid2group_name; #X obj 417 193 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 301 171 gid2group_name 0; #X connect 0 0 11 0; #X connect 2 0 13 0; #X connect 7 0 11 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 1 0; #X connect 11 0 6 0; #X connect 11 1 3 0; #X connect 13 0 8 0; #X connect 13 1 12 0; pd-hcs_0.1/ifeel.h0000644000076500007650000000024611464025103012523 0ustar hanshans#define USB_IFEEL_BUZZ_IOCTL _IOW('U', 1, struct ifeel_command) struct ifeel_command { unsigned int strength; unsigned int delay; unsigned int count; }; pd-hcs_0.1/folder_list-help.pd0000644000076500007650000000331710770521453015061 0ustar hanshans#N canvas 536 89 539 485 10; #X msg 19 73 bang; #X msg 27 355 bang; #X obj 64 300 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 11 420 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 176 255 symbol /usr/*; #X text 54 73 list current directory; #X text 160 237 set pattern without no output; #X obj 27 386 folder_list; #X obj 83 277 folder_list /*; #X obj 83 298 print; #X text 8 49 left/hot inlet gives immediate output using stored path ; #X text 19 325 For UNIX people \, [folder_list] behaves just like "ls -d1A"; #X obj 28 419 print; #X msg 91 146 symbol ~/*.*; #X text 187 197 relative paths work; #X msg 102 198 symbol ../*; #X text 164 124 drive letters work on ReactOS/Windows; #X msg 77 123 symbol C:/*; #X text 190 148 all files with a dot in your home; #X msg 40 98 symbol %USERPROFILE%/*; #X text 203 99 ReactOS/Windows environment variables work; #X text 262 218 nested wildcards work on UNIX; #X msg 119 219 symbol /var/*/*.log; #X text 173 173 patterns default to path that Pd launched from; #X text 329 464 released under the GNU GPL; #X text 15 449 (C) Copyright 2006 Hans-Christoph Steiner ; #X text 8 5 Get a listing of files based on a wildcard pattern. On UNIX \, it follows glob rules \, on ReactOS/Windows it follows the cmd.exe rules.; #X text 115 380 With no argument \, it defaults to the contents of the folder of the current patch \, i.e. "/path/to/current/patch/*". ; #X msg 97 173 symbol *.pd; #X connect 0 0 8 0; #X connect 1 0 7 0; #X connect 4 0 8 1; #X connect 7 0 3 0; #X connect 7 0 12 0; #X connect 8 0 2 0; #X connect 8 0 9 0; #X connect 13 0 8 0; #X connect 15 0 8 0; #X connect 17 0 8 0; #X connect 19 0 8 0; #X connect 22 0 8 0; #X connect 28 0 8 0; pd-hcs_0.1/passwd-help.pd0000644000076500007650000000262310755130521014046 0ustar hanshans#N canvas 47 122 547 395 10; #X obj 98 40 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X floatatom 95 63 5 0 0 0 User_ID - -; #X obj 47 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 194 148 10; #X msg 112 86 bang; #X text 209 168 <-- set by argument or cold inlet; #X text 148 85 output current; #X obj 94 167 passwd; #X text 37 20 fetch passwd data based on UID or username; #X msg 271 83 symbol hans; #X symbolatom 22 318 0 0 0 3 username - -; #X symbolatom 88 317 0 0 0 3 password - -; #X floatatom 184 317 0 0 0 3 uid - -; #X floatatom 215 317 0 0 0 3 gid - -; #X symbolatom 248 317 0 0 0 3 gecos - -; #X symbolatom 335 282 0 0 0 3 home_folder - -; #X symbolatom 395 250 0 0 0 3 shell - -; #X msg 269 105 symbol trash; #X text 361 105 ignore bad usernames; #X text 363 83 use a symbolic username; #X msg 269 56 symbol daemon; #X text 188 195 bang on right inlet if no match; #X obj 138 195 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 76 224 unpack symbol symbol float float symbol symbol symbol ; #X connect 0 0 1 0; #X connect 1 0 7 0; #X connect 3 0 7 1; #X connect 4 0 7 0; #X connect 7 0 2 0; #X connect 7 0 23 0; #X connect 7 1 22 0; #X connect 9 0 7 0; #X connect 17 0 7 0; #X connect 20 0 7 0; #X connect 23 0 10 0; #X connect 23 1 11 0; #X connect 23 2 12 0; #X connect 23 3 13 0; #X connect 23 4 14 0; #X connect 23 5 15 0; #X connect 23 6 16 0; pd-hcs_0.1/embed-help.pd0000644000076500007650000000023411466067354013632 0ustar hanshans#N canvas 329 399 450 300 10; #X text 119 127 [embed]; #X text 55 50 This object is used for hiding the Pd window when making an embedded app based on Pd.; pd-hcs_0.1/split_my_msgs.pd0000644000076500007650000000340211030703002014467 0ustar hanshans#N canvas 521 28 532 592 10; #X obj 75 146 inlet; #X obj 100 476 outlet; #X obj 278 143 inlet; #X text 260 125 name to select; #X text 69 126 raw messages; #X obj 76 383 niagara 1; #X obj 100 432 spigot; #X obj 171 239 niagara 1; #X obj 76 214 t a a; #X obj 10 8 cnv 15 480 110 empty empty split_my_msgs 20 12 1 18 -233017 -66624 0; #X msg 171 380 1; #X msg 278 380 0; #X obj 171 339 symbol; #X obj 242 477 outlet; #X obj 242 433 spigot; #X obj 279 413 expr 1-$f1; #X text 100 499 my_msgs; #X text 216 496 everything else; #X obj 171 359 select localhost; #X obj 278 339 symbol \$1; #X obj 302 317 loadbang; #X text 33 34 This object is used to split a stream of messages. A unique ID is set either with a creation argument or by sending it to the right-inlet. That unique ID is then compared to the first element in each message \, and if it matches \, the rest of that message is sent to the left outlet. Otherwise \, the result is sent to the right outlet.; #X obj 277 213 route float; #X obj 277 233 makesymbol split_on_%s; #X obj 171 268 route float; #X obj 171 288 makesymbol split_on_%s; #X obj 352 279 debug SELECT_KEY; #X obj 179 533 debug MSG_SELECT; #X obj 393 528 debug MSG_HEADER; #X connect 0 0 8 0; #X connect 2 0 22 0; #X connect 5 1 6 0; #X connect 5 1 14 0; #X connect 6 0 1 0; #X connect 7 0 24 0; #X connect 7 0 28 0; #X connect 8 0 5 0; #X connect 8 1 7 0; #X connect 10 0 6 1; #X connect 10 0 15 0; #X connect 11 0 6 1; #X connect 11 0 15 0; #X connect 12 0 18 0; #X connect 14 0 13 0; #X connect 15 0 14 1; #X connect 18 0 10 0; #X connect 18 1 11 0; #X connect 19 0 18 1; #X connect 20 0 19 0; #X connect 22 0 23 0; #X connect 22 1 19 0; #X connect 23 0 19 0; #X connect 23 0 26 0; #X connect 24 0 25 0; #X connect 24 1 12 0; #X connect 25 0 12 0; #X connect 25 0 27 0; pd-hcs_0.1/setenv-help.pd0000644000076500007650000000170111061343022014036 0ustar hanshans#N canvas 199 179 526 477 10; #X obj 196 145 setenv; #X msg 196 47 bang; #X symbolatom 195 192 0 0 0 0 - - -; #X msg 59 51 bang; #X symbolatom 58 181 0 0 0 0 - - -; #X obj 59 134 setenv HOME; #X msg 229 113 symbol SHELL; #X msg 316 113 symbol PATH; #X msg 396 113 symbol HOME; #X symbolatom 55 408 0 0 0 0 - - -; #X text 49 240 to enable overwrite mode \, set the second argument to 1 (i.e. non-zero); #X obj 56 361 setenv HOME 1; #X msg 56 278 symbol /home/hans; #X msg 66 308 symbol /Users/hans; #X text 33 10 by default \, it will not overwrite existing values; #X msg 72 89 symbol /blah; #X obj 247 358 setenv SHELL 1; #X symbolatom 248 401 0 0 0 0 - - -; #X msg 246 300 this is a test; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 3 0 5 0; #X connect 5 0 4 0; #X connect 6 0 0 1; #X connect 7 0 0 1; #X connect 8 0 0 1; #X connect 11 0 9 0; #X connect 12 0 11 0; #X connect 13 0 11 0; #X connect 15 0 5 0; #X connect 16 0 17 0; #X connect 18 0 16 0; pd-hcs_0.1/get-audio-dialog.pd0000644000076500007650000000137011213554662014736 0ustar hanshans#N canvas 361 286 450 300 10; #X obj 143 88 receive pd; #X obj 143 111 route audio-dialog; #X obj 122 161 list; #X obj 122 16 inlet; #X obj 122 43 route bang; #X obj 179 63 print ERROR: no method for; #X obj 179 272 outlet; #X obj 122 185 route bang; #X obj 85 235 print WARNING: no audio-dialog data! Open the Audio Settings and click OK to get the data.; #X obj 179 209 cyclone/prepend audio-dialog; #X obj 143 132 trigger bang anything; #X text 211 180 in a singleton; #X text 159 160 <-- TODO this list should be globally available; #X connect 0 0 1 0; #X connect 1 0 10 0; #X connect 2 0 7 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 4 1 5 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 9 0 6 0; #X connect 10 0 2 0; #X connect 10 1 2 1; pd-hcs_0.1/square~-help.pd0000644000076500007650000000047011373645062014251 0ustar hanshans#N canvas 292 406 450 300 10; #X obj 126 141 square~; #X obj 129 205 dac~; #X obj 126 103 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 10700 1; #X obj 127 172 *~ 0.2; #X text 83 38 a simple square wave generator; #X connect 0 0 3 0; #X connect 2 0 0 0; #X connect 3 0 1 0; #X connect 3 0 1 1; pd-hcs_0.1/username2uid.pd0000644000076500007650000000132111213554662014222 0ustar hanshans#N canvas 496 159 353 422 10; #X obj 19 213 hcs/passwd; #X obj 18 12 inlet; #X obj 61 12 inlet; #X obj 18 322 outlet; #X obj 108 31 loadbang; #X obj 56 59 purepd/any_argument \$1; #X obj 57 93 route float; #X obj 129 114 hcs/passwd; #X obj 226 323 outlet; #X obj 129 135 list; #X obj 129 155 list split 3; #X obj 129 176 list split 2; #X obj 18 241 list; #X obj 18 261 list split 3; #X obj 18 282 list split 2; #X connect 0 0 12 0; #X connect 0 1 8 0; #X connect 1 0 0 0; #X connect 2 0 5 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 6 0 0 1; #X connect 6 1 7 0; #X connect 7 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 1 0 1; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 1 3 0; pd-hcs_0.1/tremolo~.pd0000644000076500007650000000157111213554662013505 0ustar hanshans#N canvas 68 377 518 350 10; #X obj 308 220 *~; #X obj 56 257 +~; #X obj 323 199 *~; #X obj 56 20 inlet~; #X obj 56 287 outlet~; #X obj 323 20 inlet; #X obj 143 20 inlet; #X msg 71 146 1 \$1; #X obj 71 168 -; #X obj 338 178 line~; #X msg 338 155 \$1 5; #X msg 71 189 \$1 5; #X obj 71 210 line~; #X obj 56 230 *~; #X obj 323 69 purepd/float_argument \$2 5; #X obj 323 92 osc~; #X obj 337 47 loadbang; #X obj 157 47 loadbang; #X obj 143 69 purepd/float_argument \$2 0.5; #X connect 0 0 1 1; #X connect 1 0 4 0; #X connect 2 0 0 1; #X connect 3 0 0 0; #X connect 3 0 13 0; #X connect 5 0 14 0; #X connect 6 0 18 0; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 9 0 2 1; #X connect 10 0 9 0; #X connect 11 0 12 0; #X connect 12 0 13 1; #X connect 13 0 1 0; #X connect 14 0 15 0; #X connect 15 0 2 0; #X connect 16 0 14 0; #X connect 17 0 18 0; #X connect 18 0 7 0; #X connect 18 0 10 0; pd-hcs_0.1/autoscale-help.pd0000644000076500007650000000276711061343022014527 0ustar hanshans#N canvas 48 99 462 532 10; #X floatatom 26 88 5 0 0 0 - - -; #X floatatom 26 152 0 0 0 0 - - -; #X obj 68 270 autoscale; #X obj 2 2 cnv 15 450 20 empty empty autoscale 2 11 1 18 -233017 -66577 0; #X msg 418 3 pddp; #X text 18 35 [autoscale] scales a stream of numbers based on an output range set as arguments \, and an input range which is set dynamically. ; #X text 13 193 If you use [autoscale] with no arguments \, then the output range defaults to 0-127.; #X floatatom 68 249 5 0 0 0 - - -; #X obj 71 293 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 17 453 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 234 467 released under the GNU GPL; #X floatatom 150 152 0 0 0 0 - - -; #X floatatom 297 152 0 0 0 0 - - -; #X obj 213 83 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 17 486 $Revision: 1.5 $$Date: 2006-03-17 04:50:03 $; #X text 18 499 $Author: eighthave $; #X text 25 336 The [reset( message resets the stored max and min to zero.; #X floatatom 46 360 5 0 0 0 - - -; #X obj 71 413 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X msg 96 358 reset; #X obj 26 122 autoscale 0 1; #X obj 150 122 autoscale -0.01 0.01; #X obj 297 122 autoscale -4095 4095; #X obj 68 390 autoscale; #X connect 0 0 20 0; #X connect 2 0 8 0; #X connect 7 0 2 0; #X connect 13 0 21 0; #X connect 13 0 22 0; #X connect 17 0 23 0; #X connect 19 0 23 0; #X connect 20 0 1 0; #X connect 21 0 11 0; #X connect 22 0 12 0; #X connect 23 0 18 0; pd-hcs_0.1/README.txt0000644000076500007650000000320011373645062012770 0ustar hanshans The 'hcs' library is a random grabbag of objects that are experiments that sometimes lead to full-fledged libraries. ==== TODO ==== - pddate compare object - make ISOdate and ISOtime accept pddate format - rename [folder_list] to [file/match] and make other file lib objects - make [file/match] handle lists of patterns - make [file/match] behave like [qlist] - [cursor] object - based on [MouseState] and/or [gcanvas] - inlet to control the mouse cursor icon (pointer, X, text select, etc) - mDNS objects! - add pan objects to audio basics library - create math library - standard constants like Pi, etc. - standard math functions - create networking library - socket objects - multicast DNS objects - create mapping library - move [hid] toolkit objects into mapping lib - sort thru Cyrille's ds_ objects - objects for smoothing sensor data - create i/o library - add hid, comport, platform-specific hid, libusb, midi - convert [hid] to libhid - write [directinput] - [serial] - port numbering on darwin: number /dev/cu.* sequentially - perhaps specific objects for sensorboxs like the arduino, multio, etc - create standard gui objects lib (what's the name?) - dsp - pan - amp - create support lib for creating objects in Pd - *_argument objects - rename blocksize_in_ms to block_size_in_ms - how about "foundation" or "class" or "support" ifeel.c ------------------------------------------------------------------------ - make default device be /dev/input/ifeel0 when there are no arguments - add abort command ( http://moore.cx/dan/out/ifeel/ http://inebriated-innovation.org/ifeel/ ) pd-hcs_0.1/tcl_version.pd0000644000076500007650000000045010755130521014142 0ustar hanshans#N canvas 512 371 345 212 10; #X msg 96 69 query concat [info patchlevel]; #X obj 96 103 toxy/tot .; #X obj 96 126 zexy/symbol2list .; #X obj 96 151 outlet; #X obj 96 42 bang; #X obj 96 16 inlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 4 0 0 0; #X connect 5 0 4 0; pd-hcs_0.1/ce_path.c0000644000076500007650000000604111213554662013045 0ustar hanshans/* * This object allows you to see what is currently in the canvas-local path. */ #include "m_pd.h" #include "s_stuff.h" #include "g_canvas.h" #include #include #include /* WARNING: KLUDGE! */ /* * this struct is not publically defined (its in g_canvas.c) so I need to * include this here. Its from Pd 0.41-test03 2006-11-19. */ struct _canvasenvironment { t_symbol *ce_dir; /* directory patch lives in */ int ce_argc; /* number of "$" arguments */ t_atom *ce_argv; /* array of "$" arguments */ int ce_dollarzero; /* value of "$0" */ t_namelist *ce_path; /* search path */ }; static char *version = "$Revision: 1.2 $"; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ t_class *ce_path_class; typedef struct _ce_path { t_object x_obj; t_canvas *x_canvas; t_namelist *x_current; t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_ce_path; static void ce_path_output(t_ce_path* x) { DEBUG(post("ce_path_output");); char buffer[FILENAME_MAX]; /* TODO: think about using x->x_current->nl_next so that if [ce_path] is at * the end of its list, and another element gets added to the local * namespace, [ce_path] will output the new element on the next bang. */ if(x->x_current) { strncpy(buffer, x->x_current->nl_string, FILENAME_MAX); outlet_symbol( x->x_data_outlet, gensym(buffer)); x->x_current = x->x_current->nl_next; } else outlet_bang(x->x_status_outlet); } static void ce_path_rewind(t_ce_path* x) { t_canvasenvironment *e = canvas_getenv(x->x_canvas); x->x_current = e->ce_path; } static void *ce_path_new(t_floatarg f) { t_ce_path *x = (t_ce_path *)pd_new(ce_path_class); t_glist *glist = (t_glist *)canvas_getcurrent(); t_canvas *canvas = (t_canvas *)glist_getcanvas(glist); int depth = (int)f; if(depth < 0) depth = 0; while(depth && canvas) { canvas = canvas->gl_owner; depth--; } x->x_canvas = canvas; ce_path_rewind(x); x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol); x->x_status_outlet = outlet_new(&x->x_obj, 0); return (x); } void ce_path_setup(void) { ce_path_class = class_new(gensym("ce_path"), (t_newmethod)ce_path_new, NULL, sizeof(t_ce_path), CLASS_DEFAULT, A_DEFFLOAT, 0); /* add inlet atom methods */ class_addbang(ce_path_class, (t_method) ce_path_output); /* add inlet selector methods */ class_addmethod(ce_path_class, (t_method) ce_path_rewind, gensym("rewind"), 0); post("[ce_path] %s", version); post("\tcompiled on "__DATE__" at "__TIME__ " "); post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION); } pd-hcs_0.1/float2ascii-help.pd0000644000076500007650000000042211213554662014746 0ustar hanshans#N canvas 435 248 454 304 10; #X obj 123 128 float2ascii; #X obj 127 73 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X symbolatom 122 188 10 0 0 0 - - -; #X floatatom 135 100 5 0 0 0 - - -; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 1 0 3 0; pd-hcs_0.1/embed.pd0000644000076500007650000000107611061343022012665 0ustar hanshans#N canvas 103 147 450 300 10; #X msg 282 79 menu_toggle_console; #X obj 69 37 trigger bang bang bang bang bang bang bang bang bang; #X msg 182 84 wm iconify .; #X msg 140 13 bang; #X obj 170 245 hcs/sys_gui; #X obj 35 75 hcs/window_name; #X msg 35 98 wm iconify \$1; #X msg 23 29 bang; #X obj 70 12 loadbang; #X msg 256 164 wm title . "My Custom Title"; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 1 4 2 0; #X connect 1 8 0 0; #X connect 2 0 4 0; #X connect 3 0 1 0; #X connect 5 0 6 0; #X connect 6 0 4 0; #X connect 7 0 5 0; #X connect 8 0 1 0; #X connect 9 0 4 0; pd-hcs_0.1/stat-help.pd0000644000076500007650000000621511213554662013527 0ustar hanshans#N canvas 291 47 646 526 10; #X msg 108 68 bang; #X text 150 68 run on current folder; #X symbolatom 6 470 0 0 0 3 filename - -; #X floatatom 29 365 0 0 0 3 file_mode - -; #X floatatom 175 365 0 0 0 3 User_ID - -; #X floatatom 271 365 0 0 0 3 Group_ID - -; #X floatatom 338 365 0 0 0 3 Device_ID - -; #X obj 163 175 route error; #X symbolatom 163 213 0 0 0 0 error - -; #X floatatom 419 386 0 0 0 3 File_Size - -; #X floatatom 419 353 0 0 0 3 Blocks_Allocated - -; #X floatatom 419 317 0 0 0 3 preferred_block_size - -; #X obj 17 36 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 ; #X obj 17 63 openpanel; #X text 46 31 try it on any file (it doesn't change anything \, just reads data from the file system).; #X text 117 146 <-- set filename by cold inlet or object argument; #X obj 270 405 gid2group_name; #X symbolatom 270 434 0 0 0 3 group_name - -; #X obj 163 194 symbol; #X floatatom 98 365 0 0 0 3 hard_links - -; #X symbolatom 174 434 0 0 0 3 username - -; #X obj 174 405 uid2username; #X obj 81 147 stat; #X obj 9 203 list; #X obj 9 223 list split 9; #X obj 9 285 unpack symbol float float float float float float float float; #N canvas 0 22 470 320 time 0; #X obj 136 34 inlet; #X floatatom 19 193 6 0 0 3 days - -; #X floatatom 66 193 6 0 0 3 seconds - -; #X text 26 223 last access; #X floatatom 158 192 6 0 0 3 days - -; #X floatatom 205 192 6 0 0 3 seconds - -; #X text 144 220 last modification; #X floatatom 305 194 6 0 0 3 days - -; #X floatatom 352 194 6 0 0 3 seconds - -; #X text 290 222 last status change; #X obj 49 137 unpack float float float float float float; #X connect 0 0 10 0; #X connect 10 0 1 0; #X connect 10 1 2 0; #X connect 10 2 4 0; #X connect 10 3 5 0; #X connect 10 4 7 0; #X connect 10 5 8 0; #X restore 48 253 pd time stamps; #X msg 132 118 symbol /usr/bin/gcc; #X text 139 251 <-- open this to see the timestamps; #X obj 84 175 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 121 94 symbol /tmp/this_file_doesn't_exist; #X text 249 191 <-- errors are reported in Pd space and the Pd window ; #N canvas 0 22 458 308 possible 0; #X text 47 62 access_denied; #X text 47 82 io_error; #X text 47 102 symlink_loop; #X text 47 122 name_too_long; #X text 47 142 does_not_exist; #X text 47 162 not_folder; #X text 47 182 internal_overflow; #X text 47 202 internal_fault; #X text 19 21 Here are the possible errors that [stat] will report on its right outlet:; #X text 47 222 invalid; #X text 47 242 unknown; #X restore 398 218 pd possible errors; #X text 8 3 [stat] gets information about files; #X connect 0 0 22 0; #X connect 4 0 21 0; #X connect 5 0 16 0; #X connect 7 0 18 0; #X connect 12 0 13 0; #X connect 13 0 22 0; #X connect 16 0 17 0; #X connect 18 0 8 0; #X connect 21 0 20 0; #X connect 22 0 23 0; #X connect 22 0 29 0; #X connect 22 1 7 0; #X connect 23 0 24 0; #X connect 24 0 25 0; #X connect 24 1 26 0; #X connect 25 0 2 0; #X connect 25 1 3 0; #X connect 25 2 19 0; #X connect 25 3 4 0; #X connect 25 4 5 0; #X connect 25 5 6 0; #X connect 25 6 9 0; #X connect 25 7 10 0; #X connect 25 8 11 0; #X connect 27 0 22 0; #X connect 30 0 22 0; pd-hcs_0.1/ascii2int.pd0000644000076500007650000000231611213554662013511 0ustar hanshans#N canvas 667 123 490 433 10; #X obj 206 298 +; #X obj 176 320 float; #X obj 206 160 trigger float bang; #X obj 222 259 float; #X obj 222 278 * 10; #X obj 303 286 float; #X msg 179 220 0; #X text 212 222 <-- reset for the next pot reading; #X obj 68 57 moses 48; #X obj 206 111 - 48; #X obj 119 76 moses 58; #X obj 106 140 bang; #X obj 106 160 purepd/once; #X obj 176 345 outlet; #X obj 16 36 route bang float symbol; #X obj 16 7 inlet; #X obj 327 12 inlet; #X text 286 12 reset; #X obj 327 34 trigger bang bang; #X obj 16 270 bang; #X text 244 404 released under the GNU GPL; #X text 27 390 (C) Copyright 2006 Hans-Christoph Steiner ; #X text 25 366 TODO: make it support negative numbers; #X connect 0 0 1 1; #X connect 0 0 5 0; #X connect 1 0 13 0; #X connect 2 0 0 0; #X connect 2 1 3 0; #X connect 3 0 4 0; #X connect 4 0 0 1; #X connect 5 0 3 1; #X connect 6 0 3 1; #X connect 8 0 11 0; #X connect 8 1 10 0; #X connect 9 0 2 0; #X connect 9 0 12 1; #X connect 10 0 9 0; #X connect 10 1 11 0; #X connect 11 0 12 0; #X connect 12 0 6 0; #X connect 12 0 1 0; #X connect 14 0 19 0; #X connect 14 1 8 0; #X connect 15 0 14 0; #X connect 16 0 18 0; #X connect 18 0 11 0; #X connect 18 1 12 1; #X connect 19 0 1 0; pd-hcs_0.1/helppath-help.pd0000644000076500007650000000146110755130521014351 0ustar hanshans#N canvas 375 22 466 316 10; #X obj 40 130 helppath; #X msg 37 99 bang; #X obj 54 176 print; #X symbolatom 29 213 0 0 0 0 - - -; #X obj 101 151 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X msg 79 102 reset; #X text 19 22 This object returns each path in the global classpath one at a time with each bang. [reset( refreshs the classpath data and starts again at the top of the list \, like [textfile] or [qlist]'s [reset(.; #X text 124 153 <-- banged when the end of the list is reached; #X text 234 294 released under the GNU GPL; #X text 18 281 (C) Copyright 2006 Hans-Christoph Steiner ; #X obj 31 238 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X connect 0 0 2 0; #X connect 0 0 3 0; #X connect 0 1 4 0; #X connect 1 0 0 0; #X connect 3 0 10 0; #X connect 5 0 0 0; pd-hcs_0.1/uid2username.pd0000644000076500007650000000063311213554662014227 0ustar hanshans#N canvas 217 216 510 229 10; #X obj 18 85 hcs/passwd; #X obj 18 12 inlet; #X obj 19 183 outlet; #X obj 66 12 inlet; #X obj 118 31 loadbang; #X obj 66 59 purepd/float_argument \$1; #X obj 82 183 outlet; #X obj 18 118 list; #X obj 18 147 list split 1; #X connect 0 0 7 0; #X connect 0 1 6 0; #X connect 1 0 0 0; #X connect 3 0 5 0; #X connect 4 0 5 0; #X connect 5 0 0 1; #X connect 7 0 8 0; #X connect 8 0 2 0; pd-hcs_0.1/uid2username-help.pd0000644000076500007650000000136411213554662015157 0ustar hanshans#N canvas 185 212 477 316 10; #X msg 14 148 bang; #X obj 30 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 271 159 bang; #X obj 142 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 145 262 ^-- bang if not found; #X text 12 14 convert a UID to a username; #X symbolatom 55 242 0 0 0 0 - - -; #X msg 143 162 1; #X symbolatom 272 242 0 0 0 0 - - -; #X obj 60 93 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 300 1; #X floatatom 58 123 5 0 0 0 - - -; #X obj 56 190 uid2username; #X obj 272 201 uid2username 0; #X connect 0 0 11 0; #X connect 2 0 12 0; #X connect 7 0 11 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 1 0; #X connect 11 0 6 0; #X connect 11 1 3 0; #X connect 12 0 8 0; pd-hcs_0.1/gid2group_name.pd0000644000076500007650000000063211213554662014525 0ustar hanshans#N canvas 217 216 514 233 10; #X obj 18 12 inlet; #X obj 19 183 outlet; #X obj 66 12 inlet; #X obj 118 31 loadbang; #X obj 66 59 purepd/float_argument \$1; #X obj 82 183 outlet; #X obj 18 118 list; #X obj 18 147 list split 1; #X obj 18 85 hcs/group; #X connect 0 0 8 0; #X connect 2 0 4 0; #X connect 3 0 4 0; #X connect 4 0 8 1; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 8 0 6 0; #X connect 8 1 5 0; pd-hcs_0.1/hostname-help.pd0000644000076500007650000000037210755130521014362 0ustar hanshans#N canvas 1004 669 454 304 10; #X obj 124 139 hostname; #X msg 124 94 bang; #X symbolatom 124 174 0 0 0 0 - - -; #X text 14 19 get the hostname of the machine. Currently it probably doesn't work on Windows...; #X connect 0 0 2 0; #X connect 1 0 0 0; pd-hcs_0.1/tkconsole.pd0000644000076500007650000000064611213554662013631 0ustar hanshans#N canvas 641 54 450 300 10; #X obj 184 52 route float; #X obj 184 76 select 0; #X obj 184 23 inlet; #X msg 185 166 console \$1; #X obj 229 97 bang; #X obj 185 209 hcs/sys_gui; #X msg 229 120 show; #X msg 185 120 hide; #X obj 185 143 symbol; #X connect 0 0 1 0; #X connect 1 0 7 0; #X connect 1 1 4 0; #X connect 2 0 0 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 3 0; pd-hcs_0.1/ifeel-help.pd0000644000076500007650000000350111061343022013616 0ustar hanshans#N canvas 208 93 480 482 10; #X obj 187 324 ifeel /dev/input/ifeel0; #X obj 242 224 hsl 128 20 0 255 0 0 empty empty interval_(0-255) 6 10 1 10 -225271 -1 -1 0 0; #X obj 294 253 hsl 128 20 0 255 0 0 empty empty count_(0-255) 6 10 1 10 -261681 -1 -1 0 0; #X obj 346 282 hsl 128 20 0 1 0 0 empty empty strength_(0-1) 6 10 1 10 -261689 -1 -1 0 0; #X obj 182 46 bng 25 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X obj 226 46 bng 25 250 50 0 empty empty empty 0 -6 0 8 -258699 -1 -1; #X msg 226 76 stop; #X msg 182 76 start; #X obj 343 305 nbx 5 14 -1e+37 1e+37 0 0 pack_bang_env empty empty 0 -6 0 10 -233017 -1 -1 0 256; #X obj 291 276 nbx 3 14 -1e+37 1e+37 0 0 pack_bang_env empty empty 0 -6 0 10 -233017 -1 -1 0 256; #X obj 239 247 nbx 3 14 -1e+37 1e+37 0 0 pack_bang_env empty empty 0 -6 0 10 -233017 -1 -1 0 256; #X obj 3 4 cnv 15 470 30 empty empty [ifeel] 4 12 1 16 -228992 -66577 0; #X text 73 10 control the pulse in an iFeel mouse; #X text 37 359 If you feed data to the ifeel mouse too quickly \, it has a tendency to crash the whole machine. I suspect a bug in the kernel module ifeel.o.; #X text 13 449 by Hans-Christoph Steiner ; #X obj 324 416 pddp/pddplink ../all_about_haptics.pd -text all_about_haptics; #X text 201 417 For more info:; #X msg 251 168 strength 0.56; #X msg 234 124 interval 73; #X msg 243 147 count 14; #X msg 26 271 command 50 10 1; #X text 19 223 interval count strength; #X text 1 205 Or give a single command:; #X msg 26 249 command 25 255 1; #X msg 26 293 command 0 0 0; #X connect 1 0 10 0; #X connect 2 0 9 0; #X connect 3 0 8 0; #X connect 4 0 7 0; #X connect 5 0 6 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 3; #X connect 9 0 0 2; #X connect 10 0 0 1; #X connect 17 0 0 0; #X connect 18 0 0 0; #X connect 19 0 0 0; #X connect 20 0 0 0; #X connect 23 0 0 0; #X connect 24 0 0 0; pd-hcs_0.1/file_type.pd0000644000076500007650000000207110755130521013574 0ustar hanshans#N canvas 15 102 585 375 10; #X obj 28 8 inlet; #X obj 29 34 stat; #X obj 29 65 list; #X obj 29 85 list split 2; #X obj 29 105 list split 1; #X msg 10 235 fifo; #X obj 197 312 symbol; #X obj 197 333 outlet; #X msg 47 235 character; #X msg 121 235 folder; #X msg 175 235 block; #X msg 226 235 file; #X msg 268 235 symlink; #X msg 329 235 socket; #X msg 384 235 whiteout; #X obj 442 325 outlet; #X text 433 342 bang if no match; #X obj 69 140 & 61440; #X obj 35 178 route 4096 8192 16384 24576 32768 40960 49152 57344; #X obj 394 205 print [file_type]_ERROR; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 1 1 15 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 1 17 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 8 0 6 0; #X connect 9 0 6 0; #X connect 10 0 6 0; #X connect 11 0 6 0; #X connect 12 0 6 0; #X connect 13 0 6 0; #X connect 14 0 6 0; #X connect 17 0 18 0; #X connect 18 0 5 0; #X connect 18 1 8 0; #X connect 18 2 9 0; #X connect 18 3 10 0; #X connect 18 4 11 0; #X connect 18 5 12 0; #X connect 18 6 13 0; #X connect 18 7 14 0; #X connect 18 8 19 0; pd-hcs_0.1/debug.pd0000644000076500007650000000054510755130521012706 0ustar hanshans#N canvas 167 523 278 181 10; #X obj 74 0 inlet; #X obj 1 4 tgl 15 0 empty ATORAT_DEBUG empty 14 8 1 8 -261440 -1 -1 0 1; #X obj 74 53 spigot; #X obj 74 113 print \$1; #X text 8 150 (C) Copyright 2004 Hans-Christoph Steiner; #X text 112 166 released under the GNU GPL; #X connect 0 0 2 0; #X connect 1 0 2 1; #X connect 2 0 3 0; #X coords 0 0 1 1 130 18 1; pd-hcs_0.1/hcs-meta.pd0000644000076500007650000000054411463552662013333 0ustar hanshans#N canvas 10 10 200 200 10; #N canvas 20 20 420 300 META 0; #X text 10 10 META this is a prototype of a libdir meta file; #X text 10 30 NAME hcs; #X text 10 50 AUTHOR Hans-Christoph Steiner ; #X text 10 70 DESCRIPTION random grab bag of object prototypes; #X text 10 90 LICENSE GNU GPL; #X text 10 110 VERSION 0.1; #X restore 10 10 pd META; pd-hcs_0.1/sys_gui.c0000644000076500007650000000360711464025172013126 0ustar hanshans#include #include #include #include "g_canvas.h" #define DEBUG(x) static t_class *sys_gui_class; typedef struct _sys_gui { t_object x_obj; char *send_buffer; } t_sys_gui; static void sys_gui_bang(t_sys_gui *x) { sys_gui(x->send_buffer); } static void sys_gui_anything(t_sys_gui *x, t_symbol *s, int argc, t_atom *argv) { DEBUG(post("sys_gui_anything");); int i = 0; char buf[MAXPDSTRING]; snprintf(x->send_buffer, MAXPDSTRING, "%s ", s->s_name); for(i=0;isend_buffer, buf, MAXPDSTRING - strlen(x->send_buffer)); strncat(x->send_buffer, " ", MAXPDSTRING - strlen(x->send_buffer)); } strncat(x->send_buffer, " ;\n", 3); sys_gui(x->send_buffer); } static void sys_gui_list(t_sys_gui *x, t_symbol *s, int argc, t_atom *argv) { DEBUG(post("sys_gui_list");); int i = 0; char buf[MAXPDSTRING]; for(i=0;isend_buffer, buf, MAXPDSTRING - strlen(x->send_buffer)); strncat(x->send_buffer, " ", MAXPDSTRING - strlen(x->send_buffer)); } strncat(x->send_buffer, " ;\n", 3); sys_gui(x->send_buffer); } static void sys_gui_free(t_sys_gui *x) { freebytes(x->send_buffer,MAXPDSTRING); } static void *sys_gui_new(t_symbol *s) { t_sys_gui *x = (t_sys_gui *)pd_new(sys_gui_class); outlet_new(&x->x_obj, &s_anything); x->send_buffer = (char *)getbytes(MAXPDSTRING); return(x); } void sys_gui_setup(void) { sys_gui_class = class_new(gensym("sys_gui"), (t_newmethod)sys_gui_new, (t_method)sys_gui_free, sizeof(t_sys_gui), 0, 0); class_addanything(sys_gui_class, (t_method)sys_gui_anything); class_addbang(sys_gui_class, (t_method)sys_gui_bang); class_addlist(sys_gui_class, (t_method)sys_gui_list); } pd-hcs_0.1/folder_list.c0000644000076500007650000002050611372640273013752 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* object for getting file listings using wildcard patterns */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #else #include #include #endif #include #include static char *version = "$Revision: 1.12 $"; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *folder_list_class; typedef struct _folder_list { t_object x_obj; t_symbol* x_pattern; t_canvas* x_canvas; } t_folder_list; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ // TODO: make FindFirstFile display when its just a dir static void normalize_path(t_folder_list* x, char *normalized, const char *original) { char buf[FILENAME_MAX]; t_symbol *cwd = canvas_getdir(x->x_canvas); #ifdef _WIN32 sys_unbashfilename(original, buf); #else strncpy(buf, original, FILENAME_MAX); #endif if(sys_isabsolutepath(buf)) { strncpy(normalized, buf, FILENAME_MAX); return; } strncpy(normalized, cwd->s_name, FILENAME_MAX); if(normalized[(strlen(normalized)-1)] != '/') { strncat(normalized, "/", 1); } if(buf[0] == '.') { if(buf[1] == '/') { strncat(normalized, buf + 2, FILENAME_MAX - strlen(normalized)); } else if(buf[1] == '.' && buf[2] == '/') { strncat(normalized, buf, FILENAME_MAX - strlen(normalized)); } } else if(buf[0] != '/') { strncat(normalized, buf, FILENAME_MAX - strlen(normalized)); } else { strncpy(normalized, buf, FILENAME_MAX); } } static void folder_list_output(t_folder_list* x) { DEBUG(post("folder_list_output");); char normalized_path[FILENAME_MAX] = ""; normalize_path(x, normalized_path, x->x_pattern->s_name); #ifdef _WIN32 WIN32_FIND_DATA findData; HANDLE hFind; DWORD errorNumber; LPVOID lpErrorMessage; char fullPathNameBuffer[FILENAME_MAX] = ""; char unbashBuffer[FILENAME_MAX] = ""; char outputBuffer[FILENAME_MAX] = ""; char *pathBuffer; // arg, looks perfect, but only in Windows Vista // GetFinalPathNameByHandle(hFind,fullPathNameBuffer,FILENAME_MAX,FILE_NAME_NORMALIZED); GetFullPathName(normalized_path, FILENAME_MAX, fullPathNameBuffer, NULL); sys_unbashfilename(fullPathNameBuffer,unbashBuffer); hFind = FindFirstFile(fullPathNameBuffer, &findData); if (hFind == INVALID_HANDLE_VALUE) { errorNumber = GetLastError(); switch (errorNumber) { case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: pd_error(x,"[folder_list] nothing found for \"%s\"",x->x_pattern->s_name); break; default: FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorNumber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpErrorMessage, 0, NULL ); pd_error(x,"[folder_list] %s", (char *)lpErrorMessage); } return; } char* unbashBuffer_position = strrchr(unbashBuffer, '/'); if(unbashBuffer_position) { pathBuffer = getbytes(FILENAME_MAX+1); strncpy(pathBuffer, unbashBuffer, unbashBuffer_position - unbashBuffer); } do { // skip "." and ".." if( strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, "..") ) { strncpy(outputBuffer, pathBuffer, FILENAME_MAX); strcat(outputBuffer,"/"); strcat(outputBuffer,findData.cFileName); outlet_symbol( x->x_obj.ob_outlet, gensym(outputBuffer) ); } } while (FindNextFile(hFind, &findData) != 0); FindClose(hFind); #else unsigned int i; glob_t glob_buffer; DEBUG(post("globbing %s",normalized_path);); switch( glob( normalized_path, GLOB_TILDE, NULL, &glob_buffer ) ) { case GLOB_NOSPACE: pd_error(x,"[folder_list] out of memory for \"%s\"",normalized_path); break; # ifdef GLOB_ABORTED case GLOB_ABORTED: pd_error(x,"[folder_list] aborted \"%s\"",normalized_path); break; # endif # ifdef GLOB_NOMATCH case GLOB_NOMATCH: pd_error(x,"[folder_list] nothing found for \"%s\"",normalized_path); break; # endif } for(i = 0; i < glob_buffer.gl_pathc; i++) outlet_symbol( x->x_obj.ob_outlet, gensym(glob_buffer.gl_pathv[i]) ); globfree( &(glob_buffer) ); #endif } static void folder_list_set(t_folder_list* x, t_symbol *s) { DEBUG(post("folder_list_set");); #ifdef _WIN32 char *patternBuffer; char envVarBuffer[FILENAME_MAX]; if( (s->s_name[0] == '~') && (s->s_name[1] == '/')) { patternBuffer = getbytes(FILENAME_MAX); strcpy(patternBuffer,"%USERPROFILE%"); strncat(patternBuffer, s->s_name + 1, FILENAME_MAX - 1); post("set: %s", patternBuffer); } else { patternBuffer = s->s_name; } ExpandEnvironmentStrings(patternBuffer, envVarBuffer, FILENAME_MAX - 2); x->x_pattern = gensym(envVarBuffer); #else // UNIX // TODO translate env vars to a full path x->x_pattern = s; #endif /* _WIN32 */ } static void folder_list_symbol(t_folder_list *x, t_symbol *s) { folder_list_set(x,s); folder_list_output(x); } static void *folder_list_new(t_symbol *s) { DEBUG(post("folder_list_new");); t_folder_list *x = (t_folder_list *)pd_new(folder_list_class); t_symbol *currentdir; char buffer[MAXPDSTRING]; x->x_canvas = canvas_getcurrent(); symbolinlet_new(&x->x_obj, &x->x_pattern); outlet_new(&x->x_obj, &s_symbol); /* set to the value from the object argument, if that exists */ if (s != &s_) { x->x_pattern = s; } else { currentdir = canvas_getcurrentdir(); strncpy(buffer,currentdir->s_name,MAXPDSTRING); strncat(buffer,"/*",MAXPDSTRING); x->x_pattern = gensym(buffer); post("setting pattern to default: %s",x->x_pattern->s_name); } return (x); } void folder_list_setup(void) { DEBUG(post("folder_list_setup");); folder_list_class = class_new(gensym("folder_list"), (t_newmethod)folder_list_new, 0, sizeof(t_folder_list), 0, A_DEFSYMBOL, 0); /* add inlet datatype methods */ class_addbang(folder_list_class,(t_method) folder_list_output); class_addsymbol(folder_list_class,(t_method) folder_list_symbol); /* add inlet message methods */ class_addmethod(folder_list_class,(t_method) folder_list_set,gensym("set"), A_DEFSYMBOL, 0); } pd-hcs_0.1/canvas_name-help.pd0000644000076500007650000001255311213554662015031 0ustar hanshans#N canvas 73 22 480 392 10; #X obj 136 290 sys_gui; #X symbolatom 254 206 0 0 0 0 - - -; #X obj 241 145 loadbang; #X msg 136 260 \$2 configure -background \$1; #X obj 136 231 pack symbol symbol; #X obj 86 64 colorpanel; #X obj 67 356 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/canvas.htm ; #X text 34 330 for more options:; #N canvas 685 90 416 325 generate 0; #X obj 81 23 inlet; #X obj 82 262 outlet; #X obj 83 66 unpack float float float; #X obj 83 90 * 255; #X obj 83 113 int; #X obj 83 136 makefilename %x; #X obj 183 90 * 255; #X obj 183 113 int; #X obj 183 136 makefilename %x; #X obj 283 90 * 255; #X obj 283 113 int; #X obj 283 136 makefilename %x; #X obj 83 171 pack symbol symbol symbol; #X obj 83 195 zexy/makesymbol #%s%s%s; #X connect 0 0 2 0; #X connect 2 0 3 0; #X connect 2 1 6 0; #X connect 2 2 9 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 12 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 12 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 2; #X connect 12 0 13 0; #X connect 13 0 1 0; #X restore 86 85 pd generate web color; #X obj 86 20 bng 35 250 50 0 empty empty empty 17 7 0 10 -204786 -1 -1; #X symbolatom 106 113 10 0 0 0 - - -; #X obj 198 293 print; #X obj 241 182 canvas_name; #X msg 138 143 grey; #X msg 148 162 white; #X msg 158 183 pink; #X msg 162 205 black; #N canvas 373 75 457 313 get 0; #X symbolatom 42 225 0 0 0 0 - - -; #X obj 42 204 canvas_name; #X obj 42 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X symbolatom 126 225 0 0 0 0 - - -; #X obj 126 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 0 22 450 300 subname 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 107 137 canvas_name; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 126 204 pd subname; #X symbolatom 209 225 0 0 0 0 - - -; #X obj 209 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 496 269 450 300 get 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 109 137 canvas_name 1; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 209 204 pd get parent; #X symbolatom 73 118 0 0 0 0 - - -; #X obj 73 74 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 47 26 You can get the canvas name of other patches that this one is embedded in by setting the argument to the level:; #X obj 73 97 canvas_name 1; #X text 78 137 ^-- this is the same as the top level of this help patch ; #X symbolatom 299 225 0 0 0 0 - - -; #X obj 299 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 496 269 450 300 get 0; #X obj 117 21 inlet; #X obj 119 265 outlet; #X obj 109 137 canvas_name 2; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 299 204 pd get parent of parent; #N canvas 169 157 481 329 get 0; #X symbolatom 114 120 0 0 0 0 - - -; #X obj 101 96 canvas_name 1; #X symbolatom 119 205 0 0 0 0 - - -; #X obj 84 66 loadbang; #X obj 106 181 canvas_name 0; #X symbolatom 43 204 0 0 0 0 - - -; #X obj 30 180 canvas_name; #N canvas 0 22 450 300 add 0; #X symbolatom 175 224 0 0 0 0 - - -; #X obj 162 200 canvas_name 1; #X symbolatom 264 224 0 0 0 0 - - -; #X obj 251 200 canvas_name 2; #X symbolatom 85 224 0 0 0 0 - - -; #X obj 175 101 loadbang; #X obj 72 200 canvas_name 0; #X text 59 28 Now 0 is this subpatch \, 1 is the "pd get from parent" subpatch that this subpatch is in \, and 2 is the "canvas_name-help.pd" patch.; #X connect 1 0 0 0; #X connect 3 0 2 0; #X connect 5 0 1 0; #X connect 5 0 3 0; #X connect 5 0 6 0; #X connect 6 0 4 0; #X restore 164 267 pd add another level; #X text 31 14 Following the interface of [getdir] and others \, you can get the canvas name from parent patches by using a float to represent how many levels up you want to get:; #X text 36 237 To see it in action with a 2nd level \, check this subpatch: ; #X text 189 204 <-- these two are the same since Pd inits to 0; #X text 187 119 <-- this gets the canvas name from the parent; #X connect 1 0 0 0; #X connect 3 0 1 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 4 0 2 0; #X connect 6 0 5 0; #X restore 183 267 pd get from parent; #X text 43 268 some more examples:; #X connect 1 0 0 0; #X connect 2 0 1 0; #X connect 4 0 5 0; #X connect 5 0 3 0; #X connect 7 0 8 0; #X connect 8 0 6 0; #X connect 10 0 12 0; #X connect 12 0 9 0; #X connect 15 0 16 0; #X connect 16 0 14 0; #X restore 265 51 pd get from different levels; #N canvas 0 22 450 300 get 0; #X symbolatom 73 259 0 0 0 0 - - -; #X obj 73 215 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X symbolatom 72 176 0 0 0 0 - - -; #X obj 72 132 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 72 155 canvas_name pd-test; #X obj 73 238 canvas_name pd-canvas_name-help.pd; #N canvas 0 22 450 300 test 0; #X restore 221 155 pd test; #X obj 220 77 namecanvas myname; #X symbolatom 73 99 0 0 0 0 - - -; #X obj 73 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 73 78 canvas_name myname; #X text 53 14 You can also use the canvas receive symbol to get the canvas_name:; #X connect 1 0 5 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 5 0 0 0; #X connect 9 0 10 0; #X connect 10 0 8 0; #X restore 265 76 pd get by canvas receive symbol; #X connect 2 0 12 0; #X connect 3 0 0 0; #X connect 3 0 11 0; #X connect 4 0 3 0; #X connect 5 0 8 0; #X connect 8 0 10 0; #X connect 8 0 4 0; #X connect 9 0 5 0; #X connect 12 0 1 0; #X connect 12 0 4 1; #X connect 13 0 4 0; #X connect 14 0 4 0; #X connect 15 0 4 0; #X connect 16 0 4 0; pd-hcs_0.1/split_my_msgs-help.pd0000644000076500007650000000223310755130521015433 0ustar hanshans#N canvas 154 160 505 405 10; #X obj 10 8 cnv 15 480 110 empty empty split_my_msgs 20 12 1 18 -233017 -66624 0; #X symbolatom 60 291 25 0 0 0 - - -; #X msg 218 200 bar; #X msg 84 138 foo 12 ag 24 ga; #X obj 61 271 list2symbol; #X symbolatom 244 291 25 0 0 0 - - -; #X obj 245 271 list2symbol; #X msg 92 156 bar 30 eo 20 fa; #X msg 99 174 234 as asdf asdf; #X text 36 34 This object is used to split a stream of messages. A unique ID is set either with a creation argument or by sending it to the right-inlet. That unique ID is then compared to the first element in each message \, and if it matches \, the rest of that message is sent to the left outlet. Otherwise \, the result is sent to the right outlet.; #X msg 250 200 234; #X text 23 327 There are a number of issues due to oddness in [select]: only symbols and ints will work for selectors on the right inlet \, floats probably won't work properly. Only a symbol can be used for a creation argument; #X obj 115 229 split_my_msgs foo; #X connect 2 0 12 1; #X connect 3 0 12 0; #X connect 4 0 1 0; #X connect 6 0 5 0; #X connect 7 0 12 0; #X connect 8 0 12 0; #X connect 10 0 12 1; #X connect 12 0 4 0; #X connect 12 1 6 0; pd-hcs_0.1/unsetenv.c0000644000076500007650000000677411213554662013326 0ustar hanshans/* unsets an environment variable */ /* */ /* Copyright (c) 2008 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include "m_pd.h" #include "s_stuff.h" #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *unsetenv_class; typedef struct _unsetenv { t_object x_obj; t_symbol* x_variable_name; t_outlet* x_data_outlet; } t_unsetenv; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void unsetenv_bang(t_unsetenv* x) { DEBUG(post("unsetenv_bang");); #ifdef _WIN32 if(x->x_variable_name != &s_) { char buf[MAXPDSTRING]; strncpy(buf, x->x_variable_name->s_name, MAXPDSTRING - 1); strcat(buf, "="); putenv(buf); } #else if(x->x_variable_name != &s_) unsetenv(x->x_variable_name->s_name); #endif } static void unsetenv_symbol(t_unsetenv* x, t_symbol *s) { DEBUG(post("unsetenv_bang");); x->x_variable_name = s; } static void *unsetenv_new(t_symbol* s) { DEBUG(post("unsetenv_new");); t_unsetenv *x = (t_unsetenv *)pd_new(unsetenv_class); symbolinlet_new(&x->x_obj, &x->x_variable_name); x->x_variable_name = s; return (x); } void unsetenv_setup(void) { DEBUG(post("unsetenv_setup");); unsetenv_class = class_new(gensym("unsetenv"), (t_newmethod)unsetenv_new, 0, sizeof(t_unsetenv), 0, A_DEFSYMBOL, 0); /* add inlet datatype methods */ class_addbang(unsetenv_class, (t_method)unsetenv_bang); class_addsymbol(unsetenv_class, (t_method)unsetenv_symbol); } pd-hcs_0.1/classpath-help.pd0000644000076500007650000000113511213554662014532 0ustar hanshans#N canvas 77 22 466 316 10; #X obj 40 130 classpath; #X msg 37 99 bang; #X obj 54 176 print; #X symbolatom 29 213 0 0 0 0 - - -; #X obj 101 151 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 19 22 This object returns each path in the global classpath one at a time with each bang. [reset( refreshs the classpath data and starts again at the top of the list \, like [textfile] or [qlist]'s [reset(.; #X text 124 153 <-- banged when the end of the list is reached; #X msg 79 102 rewind; #X connect 0 0 2 0; #X connect 0 0 3 0; #X connect 0 1 4 0; #X connect 1 0 0 0; #X connect 7 0 0 0; pd-hcs_0.1/float2ascii.pd0000644000076500007650000000125411213554662014024 0ustar hanshans#N canvas 295 58 491 429 10; #X obj 160 25 inlet; #X obj 160 47 int; #X obj 203 192 select 123 125; #X obj 160 70 moses 0; #X obj 295 233 outlet; #X obj 295 212 makefilename %c; #X msg 126 273 ASCII character \$1 is not allowed in Pd!!; #X msg 125 243 123; #X msg 155 243 125; #X obj 42 334 purepd/purepd_error float2ascii; #X obj 203 95 moses 128; #X msg 7 161 \$1 outside of ASCII range (0-127); #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 2 0 7 0; #X connect 2 1 8 0; #X connect 2 2 5 0; #X connect 3 0 11 0; #X connect 3 1 10 0; #X connect 5 0 4 0; #X connect 6 0 9 0; #X connect 7 0 6 0; #X connect 8 0 6 0; #X connect 10 0 2 0; #X connect 10 1 11 0; #X connect 11 0 9 0; pd-hcs_0.1/sql_query-help.pd0000644000076500007650000000260710755130521014573 0ustar hanshans#N canvas 238 82 613 618 10; #X obj 362 244 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 4800 1; #X floatatom 420 276 5 0 0 0 - - -; #X text 395 223 age; #N canvas 402 387 450 300 sql 0; #X obj 73 37 inlet; #X obj 259 37 inlet; #X obj 63 251 outlet; #X obj 270 267 outlet; #X obj 255 78 print COLD; #X obj 61 82 print HOT; #X connect 0 0 5 0; #X connect 1 0 4 0; #X restore 267 428 pd sql; #X obj 223 495 print RESULTS; #X obj 349 496 print STATUS; #X obj 325 452 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 347 453 bang when done; #X msg 120 232 Chinua; #X msg 80 233 Mary; #X msg 172 231 symbol Ang; #X obj 119 322 sql_query insert into table (name \, age) values (? \, ?); #X obj 118 105 sql_query this is a test? more ? ? ? ?; #X msg 39 235 bang; #X msg 177 268 234; #X msg 480 275 symbol twenty; #X msg 116 76 fred; #X msg 174 77 one; #X msg 234 78 2; #X msg 287 78 3; #X msg 345 78 4; #X obj 117 155 pddp/print; #X obj 344 131 pddp/print; #X connect 0 0 11 1; #X connect 1 0 11 1; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 3 1 6 0; #X connect 8 0 11 0; #X connect 9 0 11 0; #X connect 10 0 11 0; #X connect 11 0 3 0; #X connect 11 1 3 1; #X connect 12 0 21 0; #X connect 12 1 22 0; #X connect 13 0 11 0; #X connect 14 0 11 0; #X connect 15 0 11 1; #X connect 16 0 12 0; #X connect 17 0 12 1; #X connect 18 0 12 2; #X connect 19 0 12 3; #X connect 20 0 12 4; pd-hcs_0.1/pointer_position-help.pd0000644000076500007650000000062010755130521016144 0ustar hanshans#N canvas 21 446 462 312 10; #X obj 163 146 pointer_position; #X text 24 38 Get the current (x \, y) location of the pointer in this window.; #X text 25 9 [pointer_position]; #X obj 163 78 tgl 15 1 empty empty empty 0 -6 0 10 -262144 -1 -1 1 1; #X msg 177 103 bang; #X text 191 78 enable/disable all motion events; #X text 215 103 show only next motion event; #X connect 3 0 0 0; #X connect 4 0 0 0; pd-hcs_0.1/pointer_position.pd0000644000076500007650000000311310755130521015216 0ustar hanshans#N canvas 641 119 499 478 10; #X obj 99 201 cnv 15 50 18 empty \$0-Y 169) 3 11 0 16 -233017 -1 0 ; #X obj 51 201 cnv 15 50 18 empty \$0-X (212 3 11 0 16 -233017 -1 0 ; #X msg 325 357 label \$1; #X obj 325 381 send \$0-Y; #X obj 325 333 zexy/makesymbol %s); #X obj 229 296 unpack float float float; #X msg 195 357 label \$1; #X obj 195 333 zexy/makesymbol (%s; #X obj 195 381 send \$0-X; #X obj 124 6 inlet; #X obj 124 104 select 0; #X obj 124 31 route float bang; #X obj 229 221 cyclone/gate 2; #N canvas 0 22 454 304 capture 0; #X obj 216 104 loadbang; #X obj 250 191 route motion; #X obj 188 169 toxy/tot .parent; #X msg 188 148 capture \$1; #X msg 188 127 1; #X msg 124 127 0; #X obj 102 46 inlet; #X obj 197 46 inlet; #X obj 250 227 outlet; #X obj 197 67 bang; #X obj 102 70 bang; #X connect 0 0 4 0; #X connect 1 0 8 0; #X connect 2 2 1 0; #X connect 3 0 2 0; #X connect 4 0 3 0; #X connect 5 0 3 0; #X connect 6 0 10 0; #X connect 7 0 9 0; #X connect 9 0 4 0; #X connect 10 0 5 0; #X restore 165 159 pd capture motion; #X obj 124 83 trigger float bang; #X msg 229 104 1; #X obj 264 83 trigger bang bang; #X msg 363 103 2; #X connect 2 0 3 0; #X connect 4 0 2 0; #X connect 5 0 7 0; #X connect 5 1 4 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 9 0 11 0; #X connect 10 0 13 0; #X connect 10 1 13 1; #X connect 11 0 14 0; #X connect 11 1 16 0; #X connect 12 0 5 0; #X connect 12 1 13 0; #X connect 12 1 5 0; #X connect 13 0 12 1; #X connect 14 0 10 0; #X connect 14 1 15 0; #X connect 15 0 12 0; #X connect 16 0 13 1; #X connect 16 1 17 0; #X connect 17 0 12 0; #X coords 0 -1 1 1 100 20 1 50 200; pd-hcs_0.1/username2uid-help.pd0000644000076500007650000000164011213554662015154 0ustar hanshans#N canvas 185 212 477 316 10; #X msg 57 49 symbol root; #X msg 76 81 symbol hans; #X obj 56 190 username2uid; #X floatatom 56 240 5 0 0 0 - - -; #X text 12 14 convert a username to a UID.; #X msg 14 148 bang; #X msg 143 162 symbol daemon; #X obj 30 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 94 109 symbol lp; #X msg 100 135 symbol trash; #X floatatom 272 231 5 0 0 0 - - -; #X msg 271 159 bang; #X text 192 136 ignore bad usernames; #X obj 142 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 145 262 ^-- bang if not found; #X obj 409 228 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 272 201 username2uid daemon; #X connect 0 0 2 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 0 7 0; #X connect 2 1 13 0; #X connect 5 0 2 0; #X connect 6 0 2 1; #X connect 8 0 2 0; #X connect 9 0 2 0; #X connect 11 0 16 0; #X connect 16 0 10 0; #X connect 16 1 15 0; pd-hcs_0.1/LICENSE.txt0000644000076500007650000010451311373645062013126 0ustar hanshans GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pd-hcs_0.1/colorpanel-help.pd0000644000076500007650000000153310755130521014702 0ustar hanshans#N canvas 274 159 494 344 10; #X obj 99 139 colorpanel; #X msg 99 56 bang; #X obj 112 198 pddp/print; #X obj 98 226 unpack float float float; #X obj 30 278 nbx 8 20 -1e+37 1e+37 0 0 empty empty red 0 28 0 14 -261234 -1 -1 0.937255 256; #X obj 150 278 nbx 8 20 -1e+37 1e+37 0 0 empty empty green 0 28 0 14 -204786 -1 -1 0.819608 256; #X obj 270 278 nbx 8 20 -1e+37 1e+37 0 0 empty empty blue 0 28 0 14 -203904 -1 -1 0.329412 256; #X text 35 16 pop up a color picker and output the red \, green \, blue values as a list of three floats ranging from 0 to 1; #X text 129 177 the list:; #X text 202 78 or open the window with an initial color; #X msg 108 78 symbol #beefee; #X msg 160 107 0.5 0.5 0.5; #X connect 0 0 2 0; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 3 2 6 0; #X connect 10 0 0 0; #X connect 11 0 0 0; pd-hcs_0.1/debounce-help.pd0000644000076500007650000000250411061343022014320 0ustar hanshans#N canvas 429 170 470 540 10; #X obj 2 2 cnv 15 450 20 empty empty debounce 2 11 1 18 -233017 -66577 0; #X msg 418 3 pddp; #X text 234 467 released under the GNU GPL; #X text 17 486 $Revision: 1.2 $$Date: 2006-03-17 04:50:03 $; #X text 18 499 $Author: eighthave $; #X text 17 453 (C) Copyright 2005 Hans-Christoph Steiner ; #X obj 122 78 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X obj 123 102 t b b; #X obj 123 142 delay; #X obj 63 121 bang; #X obj 122 202 tgl 35 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X floatatom 166 203 5 0 0 0 - - -; #X obj 122 271 tgl 35 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 123 166 random 2; #X msg 85 78 stop; #X obj 244 211 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 240 277 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 26 387 Right now \, it handles "floats" and "bangs". Everything else is converted to a "bang".; #X obj 152 122 random 1000; #X obj 237 247 debounce 900; #X obj 122 246 debounce 900; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 1 18 0; #X connect 8 0 9 0; #X connect 8 0 13 0; #X connect 8 0 15 0; #X connect 9 0 7 0; #X connect 10 0 20 0; #X connect 13 0 10 0; #X connect 13 0 11 0; #X connect 14 0 8 0; #X connect 15 0 19 0; #X connect 18 0 8 1; #X connect 19 0 16 0; #X connect 20 0 12 0; pd-hcs_0.1/tkconsole-help.pd0000644000076500007650000000056211213554662014554 0ustar hanshans#N canvas 625 186 450 300 10; #X obj 183 165 tkconsole; #X obj 183 142 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X text 24 18 The Tcl/Tk Wish Shell \, which Pd's GUI is built on top of \, provides an interactive console. In this console you can run Tcl code on the live GUI. This object makes it easy to show and hide the Tk console.; #X connect 1 0 0 0; pd-hcs_0.1/make-audio-dialog.pd0000644000076500007650000000102711213554662015073 0ustar hanshans#N canvas 618 605 450 300 10; #X obj 91 23 inlet; #X msg 338 141 set; #X obj 103 246 outlet; #X msg 274 146 addsemi; #X msg 216 150 add2 pd; #X obj 23 147 cyclone/prepend add2; #X obj 99 64 route audio-dialog; #X msg 72 173 add2 audio-dialog; #X obj 98 111 trigger anything bang bang bang bang; #X connect 0 0 6 0; #X connect 1 0 2 0; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 8 0; #X connect 7 0 2 0; #X connect 8 0 5 0; #X connect 8 1 7 0; #X connect 8 2 4 0; #X connect 8 3 3 0; #X connect 8 4 1 0; pd-hcs_0.1/square~.pd0000644000076500007650000000056410755130521013317 0ustar hanshans#N canvas 40 249 351 357 10; #X obj 73 281 outlet~; #X obj 96 8 inlet; #X obj 73 195 *~ 2; #X obj 73 222 -~ 1; #X obj 73 155 pwm~; #X msg 65 86 0.5; #X obj 97 86 purepd/float_argument \$1; #X obj 169 8 loadbang; #X connect 1 0 6 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 2 0; #X connect 5 0 4 0; #X connect 6 0 4 1; #X connect 7 0 6 0; #X connect 7 0 5 0; pd-hcs_0.1/ISOtime.pd0000644000076500007650000000174310755130521013132 0ustar hanshans#N canvas 479 189 470 318 10; #X obj 93 31 inlet; #X obj 93 58 bang; #X obj 93 229 outlet; #N canvas 0 22 462 312 addzero 0; #X obj 186 38 inlet; #X obj 191 255 outlet; #X obj 188 102 moses 10; #X obj 244 187 zexy/makesymbol %s; #X obj 65 187 zexy/makesymbol 0%s; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 4 0 1 0; #X restore 136 135 pd addzero; #N canvas 0 22 462 312 addzero 0; #X obj 186 38 inlet; #X obj 191 255 outlet; #X obj 188 102 moses 10; #X obj 244 187 zexy/makesymbol %s; #X obj 65 187 zexy/makesymbol 0%s; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 3 0; #X connect 3 0 1 0; #X connect 4 0 1 0; #X restore 216 135 pd addzero; #X obj 93 84 zexy/time -----------; #X obj 93 175 pack float symbol symbol; #X obj 93 202 zexy/makesymbol %s:%s:%s; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 3 0 6 1; #X connect 4 0 6 2; #X connect 5 0 6 0; #X connect 5 1 3 0; #X connect 5 2 4 0; #X connect 6 0 7 0; #X connect 7 0 2 0; pd-hcs_0.1/keyboard_layout.c0000644000076500007650000000756711061343022014640 0ustar hanshans/* Copyright 2006 Fredrik Olofsson * Copyright 2007 Free Software Foundation * ported to Pd by Hans-Christoph Steiner from f0.keyboard_layout.c */ #include "m_pd.h" #ifdef __APPLE__ #include #endif static t_class *keyboard_layout_class; typedef struct _keyboard_layout { t_object x_obj; t_outlet* x_data_outlet; t_outlet* x_status_outlet; } t_keyboard_layout; #ifdef __APPLE__ //---------------------------------------------------------------------------------------------- void keyboard_layout_bang(t_keyboard_layout *x) { //OSStatus err; KeyboardLayoutRef currentLayoutRef; const void *keyboardName; char cKeyboardName[100]; KLGetCurrentKeyboardLayout(¤tLayoutRef); KLGetKeyboardLayoutProperty(currentLayoutRef, kKLName, (const void **)&keyboardName); CFStringGetCString((CFStringRef)keyboardName, cKeyboardName, 100, kCFStringEncodingASCII); outlet_symbol(x->x_data_outlet, gensym(cKeyboardName)); } void keyboard_layout_menu(t_keyboard_layout *x) { //OSStatus err; KeyboardLayoutRef currentLayoutRef; const void *keyboardName; char cKeyboardName[100]; CFIndex countOfLayouts; CFIndex i; t_atom name; // TODO this should probably output [menu clear( so other messages work too outlet_anything(x->x_status_outlet, gensym("clear"), 0, NULL); KLGetKeyboardLayoutCount(&countOfLayouts); for(i= 0; ix_status_outlet, gensym("append"), 1, &name); } } void keyboard_layout_anything(t_keyboard_layout *x, t_symbol *s, short argc, t_atom *argv) { //OSStatus err; KeyboardLayoutRef currentLayoutRef; const void *keyboardName; char cKeyboardName[100]; keyboardName= CFStringCreateWithCString(NULL, s->s_name, kCFStringEncodingASCII); KLGetKeyboardLayoutWithName(keyboardName, ¤tLayoutRef); KLGetKeyboardLayoutProperty(currentLayoutRef, kKLName, (const void **)&keyboardName); CFStringGetCString((CFStringRef)keyboardName, cKeyboardName, 100, kCFStringEncodingASCII); KLSetCurrentKeyboardLayout(currentLayoutRef); //outlet_anything(x->t_out, s, 0, NULL); keyboard_layout_bang(x); } void *keyboard_layout_new(void) { t_keyboard_layout *x = (t_keyboard_layout *)pd_new(keyboard_layout_class); x->x_data_outlet = outlet_new(&x->x_obj, &s_float); x->x_status_outlet = outlet_new(&x->x_obj, &s_symbol); return (x); } //---------------------------------------------------------------------------------------------- void keyboard_layout_setup(void) { keyboard_layout_class = class_new(gensym("keyboard_layout"), (t_newmethod)keyboard_layout_new, NULL, sizeof(t_keyboard_layout), 0, A_GIMME, 0); class_addbang(keyboard_layout_class, (t_method)keyboard_layout_bang); class_addanything(keyboard_layout_class, (t_method)keyboard_layout_anything); class_addmethod(keyboard_layout_class, (t_method)keyboard_layout_menu, gensym("menu"), 0); post("f0.keyboard_layout v1.1-ub; distributed under GNU GPL license"); } #else /* GNU/Linux and Windows */ void keyboard_layout_new(void) { post("f0.keyboard_layout v1.1-ub; distributed under GNU GPL license"); post("ERROR: this objectclass is currently only for Mac OS X"); } void keyboard_layout_setup(void) { keyboard_layout_class = class_new(gensym("text"), (t_method)keyboard_layout_new, NULL, sizeof(t_keyboard_layout), 0, 0); } #endif /* __APPLE__ */ pd-hcs_0.1/screensize-help.pd0000644000076500007650000000041511213554662014722 0ustar hanshans#N canvas 341 296 450 300 10; #X msg 184 101 bang; #X floatatom 184 170 5 0 0 0 width - -; #X floatatom 241 170 5 0 0 1 height - -; #X text 111 47 get the current screen resolution; #X obj 184 138 screensize; #X connect 0 0 4 0; #X connect 4 0 1 0; #X connect 4 1 2 0; pd-hcs_0.1/get-midi-dialog.pd0000644000076500007650000000136611213554662014564 0ustar hanshans#N canvas 361 286 450 300 10; #X obj 143 88 receive pd; #X obj 122 161 list; #X obj 122 16 inlet; #X obj 122 43 route bang; #X obj 179 63 print ERROR: no method for; #X obj 179 272 outlet; #X obj 122 185 route bang; #X obj 143 132 trigger bang anything; #X text 211 180 in a singleton; #X text 159 160 <-- TODO this list should be globally available; #X obj 143 111 route midi-dialog; #X obj 179 209 cyclone/prepend midi-dialog; #X obj 85 235 print WARNING: no midi-dialog data! Open the MIDI Settings and click OK to get the data.; #X connect 0 0 10 0; #X connect 1 0 6 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 3 1 4 0; #X connect 6 0 12 0; #X connect 6 1 11 0; #X connect 7 0 1 0; #X connect 7 1 1 1; #X connect 10 0 7 0; #X connect 11 0 5 0; pd-hcs_0.1/Makefile0000644000076500007650000002615711466076237012757 0ustar hanshans## Pd library template version 1.0.3 # For instructions on how to use this template, see: # http://puredata.info/docs/developer/MakefileTemplate LIBRARY_NAME = hcs # add your .c source files, one object per file, to the SOURCES # variable, help files will be included automatically SOURCES = canvas_name.c ce_path.c classpath.c colorpanel.c cursor.c folder_list.c group.c helppath.c keyboard_layout.c passwd.c screensize.c setenv.c split_path.c sql_query.c stat.c sys_gui.c uname.c unsetenv.c version.c window_name.c # For objects that only build on certain platforms, add those to the SOURCES # line for the right platforms. SOURCES_linux = ifeel.c # list all pd objects (i.e. myobject.pd) files here, and their helpfiles will # be included automatically PDOBJECTS = ISOdate.pd ISOtime.pd ascii2int.pd autoscale.pd blocksize_in_ms.pd debounce.pd debug.pd embed.pd file_type.pd float2ascii.pd get-audio-dialog.pd get-midi-dialog.pd gid2group_name.pd group_name2gid.pd hostname.pd make-audio-dialog.pd mouse_region.pd noquit.pd pi.pd pointer_position.pd pwm.pd pwm~.pd split_my_msgs.pd square~.pd tcl_version.pd tkconsole.pd tremolo~.pd uid2username.pd username2uid.pd # example patches and related files, in the 'examples' subfolder EXAMPLES = changing_the_colors.pd move_pd_window.pd cursor.gif # manuals and related files, in the 'manual' subfolder MANUAL = # if you want to include any other files in the source and binary tarballs, # list them here. This can be anything from header files, test patches, # documentation, etc. README.txt and LICENSE.txt are required and therefore # automatically included EXTRA_DIST = README-ifeel.txt ifeel.h #------------------------------------------------------------------------------# # # things you might need to edit if you are using other C libraries # #------------------------------------------------------------------------------# CFLAGS = -DPD -I"$(PD_INCLUDE)" -Wall -W -g LDFLAGS = LIBS = #------------------------------------------------------------------------------# # # you shouldn't need to edit anything below here, if we did it right :) # #------------------------------------------------------------------------------# # get library version from meta file LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd) CFLAGS += -DVERSION='"$(LIBRARY_VERSION)"' PD_INCLUDE = $(PD_PATH)/include # where to install the library, overridden below depending on platform prefix = /usr/local libdir = $(prefix)/lib pkglibdir = $(libdir)/pd-externals objectsdir = $(pkglibdir) INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -m 644 INSTALL_DATA = $(INSTALL) -p -m 644 INSTALL_DIR = $(INSTALL) -p -m 755 -d ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \ $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows) DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION) ORIGDIR=pd-$(LIBRARY_NAME)_$(LIBRARY_VERSION) UNAME := $(shell uname -s) ifeq ($(UNAME),Darwin) CPU := $(shell uname -p) ifeq ($(CPU),arm) # iPhone/iPod Touch SOURCES += $(SOURCES_iphoneos) EXTENSION = pd_darwin OS = iphoneos PD_PATH = /Applications/Pd-extended.app/Contents/Resources IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin CC=$(IPHONE_BASE)/gcc CPP=$(IPHONE_BASE)/cpp CXX=$(IPHONE_BASE)/g++ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6 OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS) LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT) LIBS += -lc STRIP = strip -x DISTBINDIR=$(DISTDIR)-$(OS) else # Mac OS X SOURCES += $(SOURCES_macosx) EXTENSION = pd_darwin OS = macosx PD_PATH = /Applications/Pd-extended.app/Contents/Resources OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast # build universal 32-bit on 10.4 and 32/64 on newer ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8) FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4 else FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4 SOURCES += $(SOURCES_iphoneos) endif CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib # if the 'pd' binary exists, check the linking against it to aid with stripping LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd) LIBS += -lc STRIP = strip -x DISTBINDIR=$(DISTDIR)-$(OS) # install into ~/Library/Pd on Mac OS X since /usr/local isn't used much pkglibdir=$(HOME)/Library/Pd endif endif ifeq ($(UNAME),Linux) CPU := $(shell uname -m) SOURCES += $(SOURCES_linux) EXTENSION = pd_linux OS = linux PD_PATH = /usr OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer CFLAGS += -fPIC LDFLAGS += -Wl,--export-dynamic -shared -fPIC LIBS += -lc STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m) endif ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) CPU := $(shell uname -m) SOURCES += $(SOURCES_cygwin) EXTENSION = dll OS = cygwin PD_PATH = $(cygpath $(PROGRAMFILES))/pd OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer CFLAGS += LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" LIBS += -lc -lpd STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS) endif ifeq (MINGW,$(findstring MINGW,$(UNAME))) CPU := $(shell uname -m) SOURCES += $(SOURCES_windows) EXTENSION = dll OS = windows PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer CFLAGS += -mms-bitfields LDFLAGS += -s -shared -Wl,--enable-auto-import LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS) endif # in case somebody manually set the HELPPATCHES above HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.pd=-help.pd) CFLAGS += $(OPT_CFLAGS) .PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags $(LIBRARY_NAME) all: $(SOURCES:.c=.$(EXTENSION)) %.o: %.c $(CC) $(CFLAGS) -o "$*.o" -c "$*.c" %.$(EXTENSION): %.o $(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) chmod a-x "$*.$(EXTENSION)" # this links everything into a single binary file $(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS) chmod a-x $(LIBRARY_NAME).$(EXTENSION) install: libdir_install # The meta and help files are explicitly installed to make sure they are # actually there. Those files are not optional, then need to be there. libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc install-examples install-manual $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) test -z "$(strip $(SOURCES))" || (\ $(INSTALL_PROGRAM) $(SOURCES:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \ $(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(SOURCES:.c=.$(EXTENSION)))) test -z "$(strip $(PDOBJECTS))" || \ $(INSTALL_DATA) $(PDOBJECTS) \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) # install library linked as single binary single_install: $(LIBRARY_NAME) install-doc install-exec $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_PROGRAM) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION) install-doc: $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \ $(INSTALL_DATA) $(HELPPATCHES) \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_DATA) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt $(INSTALL_DATA) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt install-examples: test -z "$(strip $(EXAMPLES))" || \ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples && \ for file in $(EXAMPLES); do \ $(INSTALL_DATA) examples/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples; \ done install-manual: test -z "$(strip $(MANUAL))" || \ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual && \ for file in $(MANUAL); do \ $(INSTALL_DATA) manual/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual; \ done clean: -rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o) -rm -f -- $(SOURCES:.c=.$(EXTENSION)) -rm -f -- $(LIBRARY_NAME).o -rm -f -- $(LIBRARY_NAME).$(EXTENSION) distclean: clean -rm -f -- $(DISTBINDIR).tar.gz -rm -rf -- $(DISTBINDIR) -rm -f -- $(DISTDIR).tar.gz -rm -rf -- $(DISTDIR) -rm -f -- $(ORIGDIR).tar.gz -rm -rf -- $(ORIGDIR) $(DISTBINDIR): $(INSTALL_DIR) $(DISTBINDIR) libdir: all $(DISTBINDIR) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR) $(INSTALL_DATA) $(SOURCES) $(DISTBINDIR) $(INSTALL_DATA) $(HELPPATCHES) $(DISTBINDIR) test -z "$(strip $(EXTRA_DIST))" || \ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTBINDIR) # tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR) $(DISTDIR): $(INSTALL_DIR) $(DISTDIR) $(ORIGDIR): $(INSTALL_DIR) $(ORIGDIR) dist: $(DISTDIR) $(INSTALL_DATA) Makefile $(DISTDIR) $(INSTALL_DATA) README.txt $(DISTDIR) $(INSTALL_DATA) LICENSE.txt $(DISTDIR) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTDIR) test -z "$(strip $(ALLSOURCES))" || \ $(INSTALL_DATA) $(ALLSOURCES) $(DISTDIR) test -z "$(strip $(PDOBJECTS))" || \ $(INSTALL_DATA) $(PDOBJECTS) $(DISTDIR) test -z "$(strip $(HELPPATCHES))" || \ $(INSTALL_DATA) $(HELPPATCHES) $(DISTDIR) test -z "$(strip $(EXTRA_DIST))" || \ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTDIR) test -z "$(strip $(EXAMPLES))" || \ $(INSTALL_DIR) $(DISTDIR)/examples && \ for file in $(EXAMPLES); do \ $(INSTALL_DATA) examples/$$file $(DISTDIR)/examples; \ done test -z "$(strip $(MANUAL))" || \ $(INSTALL_DIR) $(DISTDIR)/manual && \ for file in $(MANUAL); do \ $(INSTALL_DATA) manual/$$file $(DISTDIR)/manual; \ done tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR) # make a Debian source package dpkg-source: debclean make distclean dist mv $(DISTDIR) $(ORIGDIR) tar --exclude-vcs -czpf ../$(ORIGDIR).orig.tar.gz $(ORIGDIR) rm -f -- $(DISTDIR).tar.gz rm -rf -- $(DISTDIR) $(ORIGDIR) cd .. && dpkg-source -b $(LIBRARY_NAME) etags: etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h showsetup: @echo "CFLAGS: $(CFLAGS)" @echo "LDFLAGS: $(LDFLAGS)" @echo "LIBS: $(LIBS)" @echo "PD_INCLUDE: $(PD_INCLUDE)" @echo "PD_PATH: $(PD_PATH)" @echo "objectsdir: $(objectsdir)" @echo "LIBRARY_NAME: $(LIBRARY_NAME)" @echo "LIBRARY_VERSION: $(LIBRARY_VERSION)" @echo "SOURCES: $(SOURCES)" @echo "PDOBJECTS: $(PDOBJECTS)" @echo "ALLSOURCES: $(ALLSOURCES)" @echo "UNAME: $(UNAME)" @echo "CPU: $(CPU)" @echo "pkglibdir: $(pkglibdir)" @echo "DISTDIR: $(DISTDIR)" @echo "ORIGDIR: $(ORIGDIR)" pd-hcs_0.1/group-help.pd0000644000076500007650000000232710755130521013702 0ustar hanshans#N canvas 296 212 555 357 10; #X obj 98 40 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X floatatom 95 63 5 0 0 0 User_ID - -; #X obj 47 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 112 86 bang; #X text 209 168 <-- set by argument or cold inlet; #X text 148 85 output current; #X symbolatom 94 305 0 0 0 3 group_name - -; #X floatatom 222 305 0 0 0 3 gid - -; #X msg 269 105 symbol trash; #X text 365 76 use a symbolic group name; #X msg 269 56 symbol daemon; #X text 188 195 bang on right inlet if no match; #X obj 138 195 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 94 167 group; #X obj 94 200 list; #X msg 271 83 symbol wheel; #X msg 194 148 20; #X obj 133 245 print group_members; #X text 37 20 fetch passwd data based on UID or group name; #X text 361 105 ignore bad group names; #X obj 94 283 unpack symbol float; #X obj 94 220 list split 2; #X connect 0 0 1 0; #X connect 1 0 13 0; #X connect 3 0 13 0; #X connect 8 0 13 0; #X connect 10 0 13 0; #X connect 13 0 2 0; #X connect 13 0 14 0; #X connect 13 1 12 0; #X connect 14 0 21 0; #X connect 15 0 13 0; #X connect 16 0 13 1; #X connect 20 0 6 0; #X connect 20 1 7 0; #X connect 21 0 20 0; #X connect 21 1 17 0; pd-hcs_0.1/ISOtime-help.pd0000644000076500007650000000031210755130521014047 0ustar hanshans#N canvas 98 95 426 266 10; #X msg 139 82 bang; #X symbolatom 138 156 0 0 0 0 - - -; #X obj 139 114 ISOtime; #X text 49 29 output the current time in ISO format; #X connect 0 0 2 0; #X connect 2 0 1 0; pd-hcs_0.1/blocksize_in_ms-help.pd0000644000076500007650000000111111061343022015677 0ustar hanshans#N canvas 256 153 461 330 10; #X obj 5 2 cnv 15 450 20 empty empty blocksize_in_ms 2 11 1 18 -233017 -66577 0; #X msg 422 3 pddp; #X text 27 270 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 244 284 released under the GNU GPL; #X obj 152 157 blocksize_in_ms; #X msg 152 115 bang; #X text 197 117 bang to recalculate; #X floatatom 152 210 7 0 0 1 ms - -; #X text 18 36 Output the current blocksize in ms rather than samples. This is currently set at a fixed blocksize of 64 \, but it will change dynamically in the future.; #X connect 4 0 7 0; #X connect 5 0 4 0; pd-hcs_0.1/colorpanel.c0000644000076500007650000000601210755130521013570 0ustar hanshans#include #include #include #include #define DEBUG(x) static t_class *colorpanel_class; typedef struct _colorpanel { t_object x_obj; t_symbol *x_s; char current_color[MAXPDSTRING]; } t_colorpanel; static void colorpanel_bang(t_colorpanel *x) { sys_vgui("pd [concat %s callback [tk_chooseColor -initialcolor %s] \\;]\n", x->x_s->s_name, x->current_color); } static void colorpanel_symbol(t_colorpanel *x, t_symbol *s) { DEBUG(post("setting initial color: %s", s->s_name);); strncpy(x->current_color, s->s_name, MAXPDSTRING); colorpanel_bang(x); } static void colorpanel_list(t_colorpanel *x, t_symbol *s, int argc, t_atom *argv) { t_symbol *tmp_symbol = s; /* <-- this gets rid of the unused variable warning */ int i; unsigned int tmp_int; char color_buffer[3]; char color_string[MAXPDSTRING]; strncpy(color_string,"#",MAXPDSTRING); if(argc > 2) post("[colorpanel] warning more than three elements in list"); for(i=0; i<3; i++) { tmp_symbol = atom_getsymbolarg(i, argc, argv); if(tmp_symbol == &s_) { tmp_int = (unsigned int)(atom_getfloatarg(i, argc , argv) * 255); snprintf(color_buffer, 3, "%02x", (tmp_int > 255 ? 255 : tmp_int)); strncat(color_string, color_buffer, 3); } else { pd_error(x,"[colorpanel] symbol atom in color list"); } } memcpy(x->current_color, color_string, 7); DEBUG(post("setting initial color: %s", x->current_color);); colorpanel_bang(x); } static void colorpanel_callback(t_colorpanel *x, t_symbol *color) { t_atom output_atoms[3]; unsigned int red, green, blue; if(color != &s_) { strncpy(x->current_color, color->s_name, MAXPDSTRING); sscanf(x->current_color, "#%02x%02x%02x", &red, &green, &blue); SETFLOAT(output_atoms, (t_float) red / 255); SETFLOAT(output_atoms + 1, (t_float) green / 255); SETFLOAT(output_atoms + 2, (t_float) blue / 255); outlet_list(x->x_obj.ob_outlet, &s_list, 3, output_atoms); } } static void colorpanel_free(t_colorpanel *x) { pd_unbind(&x->x_obj.ob_pd, x->x_s); } static void *colorpanel_new( void) { char buf[MAXPDSTRING]; t_colorpanel *x = (t_colorpanel *)pd_new(colorpanel_class); sprintf(buf, "#%lx", (t_int)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_list); strcpy(x->current_color,"#ffffff"); return(x); } void colorpanel_setup(void) { colorpanel_class = class_new(gensym("colorpanel"), (t_newmethod)colorpanel_new, (t_method)colorpanel_free, sizeof(t_colorpanel), 0, 0); class_addbang(colorpanel_class, (t_method)colorpanel_bang); class_addsymbol(colorpanel_class, (t_method)colorpanel_symbol); class_addlist(colorpanel_class, (t_method)colorpanel_list); class_addmethod(colorpanel_class, (t_method)colorpanel_callback, gensym("callback"), A_DEFSYMBOL, 0); } pd-hcs_0.1/file_type-help.pd0000644000076500007650000000147210755130521014526 0ustar hanshans#N canvas 434 28 454 304 10; #X obj 180 210 file_type; #X obj 181 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X obj 181 59 openpanel; #X msg 203 118 symbol /usr/bin/gcc; #X obj 239 235 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 258 236 bang if no match; #X msg 206 142 symbol /dev/tty; #X obj 181 96 symbol; #X msg 141 76 bang; #X symbolatom 179 262 0 0 0 0 file_type - -; #X obj 207 185 folder_list; #X msg 207 166 symbol /tmp/ssh-*/agent.*; #X msg 83 148 symbol /usr; #X msg 25 129 symbol /tmp; #X text 16 10 find the file type of a file; #X connect 0 0 9 0; #X connect 0 1 4 0; #X connect 1 0 2 0; #X connect 2 0 7 0; #X connect 3 0 0 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 7 0; #X connect 10 0 0 0; #X connect 11 0 10 0; #X connect 12 0 0 0; #X connect 13 0 0 0; pd-hcs_0.1/group_name2gid.pd0000644000076500007650000000131711213554662014526 0ustar hanshans#N canvas 496 159 389 458 10; #X obj 18 12 inlet; #X obj 61 12 inlet; #X obj 18 322 outlet; #X obj 108 31 loadbang; #X obj 56 59 purepd/any_argument \$1; #X obj 57 93 route float; #X obj 226 323 outlet; #X obj 129 135 list; #X obj 18 241 list; #X obj 19 213 hcs/group; #X obj 129 114 hcs/group; #X obj 129 155 list split 2; #X obj 129 176 list split 1; #X obj 18 261 list split 2; #X obj 18 282 list split 1; #X connect 0 0 9 0; #X connect 1 0 4 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 9 1; #X connect 5 1 10 0; #X connect 7 0 11 0; #X connect 8 0 13 0; #X connect 9 0 8 0; #X connect 9 1 6 0; #X connect 10 0 7 0; #X connect 11 0 12 0; #X connect 12 1 9 1; #X connect 13 0 14 0; #X connect 14 1 2 0; pd-hcs_0.1/sql_query.c0000644000076500007650000001341111213554662013465 0ustar hanshans/* * object for generating SQL queries with SQL ? placeholders * Written by Hans-Christoph Steiner * * Copyright (c) 2007 Free Software Foundation * * 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 3 * of the License, or (at your option) any later version. * * See file LICENSE for further informations on licensing terms. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif #include #define DEBUG(x) //#define DEBUG(x) x #define PLACEHOLDER '?' /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *sql_query_class; static t_class *proxy_inlet_class; typedef struct _proxy_inlet { t_pd pd; void *owner; unsigned int id; } t_proxy_inlet; typedef struct _sql_query { t_object x_obj; t_binbuf* x_query_binbuf; // binbuf for converting args to string t_proxy_inlet* inlets; // pointer to array of _proxy_inlets t_atom* atoms; // pointer to array of atoms unsigned int placeholder_count;// number of items in above arrays t_outlet* x_data_outlet; // for list of data to plug into query t_outlet* x_query_outlet; // for SQL query } t_sql_query; /*------------------------------------------------------------------------------ * FUNCTION PROTOTYPES */ static void sql_query_set_atom(t_sql_query *x, int atom_num, t_symbol *s, int argc, t_atom *a); /*------------------------------------------------------------------------------ * PROXY INLET FUNCTIONS */ static void proxy_inlet_new(t_proxy_inlet *p, t_object *owner, unsigned int id) { DEBUG(post("proxy_inlet_new");); p->pd = proxy_inlet_class; p->owner = owner; p->id = id; inlet_new(owner, &p->pd, 0, 0); } static void proxy_inlet_anything(t_proxy_inlet *p, t_symbol *s, int argc, t_atom *argv) { DEBUG(post("proxy_inlet_anything");); sql_query_set_atom(p->owner, p->id, s, argc, argv); } static void proxy_inlet_setup(void) { post("proxy_inlet_setup"); proxy_inlet_class = (t_class *)class_new(gensym("#__PROXY_INLET__"), 0, 0, sizeof(t_proxy_inlet), 0, A_GIMME, 0); class_addanything(proxy_inlet_class, (t_method)proxy_inlet_anything); } /*------------------------------------------------------------------------------ * STANDARD CLASS FUNCTIONS */ static void sql_query_set_atom(t_sql_query *x, int atom_num, t_symbol *s, int argc, t_atom *a) { DEBUG(post("sql_query_set_atom");); if( (s == &s_symbol) || (s == &s_list) || (s == &s_float) ) x->atoms[atom_num] = *a; else SETSYMBOL(&x->atoms[atom_num], s); } static void sql_query_output(t_sql_query *x) { DEBUG(post("sql_query_output");); int natom = binbuf_getnatom(x->x_query_binbuf); t_atom *vec = binbuf_getvec(x->x_query_binbuf); outlet_anything(x->x_query_outlet, vec[0].a_w.w_symbol, natom - 1, vec + 1); outlet_list(x->x_data_outlet, &s_list, x->placeholder_count, x->atoms); } static void sql_query_anything(t_sql_query *x, t_symbol *s, int argc, t_atom *argv) { sql_query_set_atom(x, 0, s, argc, argv); sql_query_output(x); } static void sql_query_free(t_sql_query *x) { binbuf_free(x->x_query_binbuf); } static void *sql_query_new(t_symbol *s, int argc, t_atom *argv) { DEBUG(post("sql_query_new");); unsigned int i; int bufsize; char *buf; char *current = NULL; t_sql_query *x = (t_sql_query *)pd_new(sql_query_class); x->x_query_binbuf = binbuf_new(); binbuf_add(x->x_query_binbuf, argc, argv); binbuf_gettext(x->x_query_binbuf, &buf, &bufsize); buf[bufsize] = 0; x->placeholder_count = 0; current = strchr(buf, PLACEHOLDER); while (current != NULL) { x->placeholder_count++; current = strchr(current + 1, PLACEHOLDER); } x->inlets = getbytes(x->placeholder_count * sizeof(t_proxy_inlet)); for(i = 1; i < x->placeholder_count; ++i) proxy_inlet_new(&x->inlets[i], (t_object *)x, i); x->atoms = getbytes(x->placeholder_count * sizeof(t_atom)); for(i = 0; i < x->placeholder_count; ++i) SETSYMBOL(&x->atoms[i], &s_); x->x_data_outlet = outlet_new(&x->x_obj, 0); x->x_query_outlet = outlet_new(&x->x_obj, 0); return (x); } void sql_query_setup(void) { sql_query_class = class_new(gensym("sql_query"), (t_newmethod)sql_query_new, (t_method)sql_query_free, sizeof(t_sql_query), 0, A_GIMME, 0); /* add inlet datatype methods */ class_addbang(sql_query_class, (t_method) sql_query_output); class_addanything(sql_query_class, (t_method) sql_query_anything); /* set up proxy inlet class */ proxy_inlet_setup(); } pd-hcs_0.1/group.c0000644000076500007650000001631311213554662012601 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* converts a GID number to a user name symbol */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #ifndef _WIN32 // this doesn't work on Windows (yet?) #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #include #else #include #include #include #endif #include static char *version = "$Revision: 1.3 $"; t_int group_instance_count; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *group_class; typedef struct _group { t_object x_obj; t_float x_gid; /* output */ t_atom *output; // holder for a list of atoms to be outputted t_int output_count; // number of atoms in in x->output t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_group; /*------------------------------------------------------------------------------ * SUPPORT FUNCTIONS */ /* add one new atom to the list to be outputted */ static void add_atom_to_output(t_group *x, t_atom *new_atom) { t_atom *new_atom_list; new_atom_list = (t_atom *)getbytes((x->output_count + 1) * sizeof(t_atom)); memcpy(new_atom_list, x->output, x->output_count * sizeof(t_atom)); freebytes(x->output, x->output_count * sizeof(t_atom)); x->output = new_atom_list; memcpy(x->output + x->output_count, new_atom, sizeof(t_atom)); ++(x->output_count); } static void add_symbol_to_output(t_group *x, t_symbol *s) { t_atom *temp_atom = getbytes(sizeof(t_atom)); SETSYMBOL(temp_atom, s); add_atom_to_output(x,temp_atom); freebytes(temp_atom,sizeof(t_atom)); } static void add_float_to_output(t_group *x, t_float f) { t_atom *temp_atom = getbytes(sizeof(t_atom)); SETFLOAT(temp_atom, f); add_atom_to_output(x,temp_atom); freebytes(temp_atom,sizeof(t_atom)); } static void reset_output(t_group *x) { if(x->output) { freebytes(x->output, x->output_count * sizeof(t_atom)); x->output = NULL; x->output_count = 0; } } /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void group_output(t_group *x) { DEBUG(post("group_output");); struct group *group_pointer; char **members; #ifdef _WIN32 /* TODO: implement for Windows! */ #else if( x->x_gid < 0 ) { post("[group]: ignoring bad username or GID less than zero"); outlet_bang(x->x_status_outlet); } else { group_pointer = getgrgid((gid_t)x->x_gid); if( group_pointer != NULL ) { reset_output(x); /* group passwd just seems to be always blank, so omit it */ /* add_symbol_to_output(x, gensym(group_pointer->gr_passwd)); */ add_float_to_output(x, group_pointer->gr_gid); members = group_pointer->gr_mem; while(*members) { add_symbol_to_output(x, gensym( *(members) )); members++; } outlet_anything(x->x_data_outlet, gensym(group_pointer->gr_name), x->output_count, x->output); } else { outlet_bang(x->x_status_outlet); } } #endif /* _WIN32 */ } static t_float get_gid_from_arguments(int argc, t_atom *argv) { t_symbol *first_argument; t_float gid = -1; struct group *group_pointer; if(argc == 0) return(0); if(argc != 1) post("[group]: too many arguments (%d), ignoring all but the first", argc); first_argument = atom_getsymbolarg(0,argc,argv); if(first_argument == &s_) { // single float arg means GID # gid = atom_getfloatarg(0,argc,argv); if( gid < 0 ) { error("[group]: GID less than zero not allowed (%d)", gid); return(-1); } } else { // single symbol arg means username group_pointer = getgrnam(first_argument->s_name); if( group_pointer != NULL ) return((t_float) group_pointer->gr_gid); else return(-1); } return(-1); } static void group_set(t_group *x, t_symbol *s, int argc, t_atom *argv) { /* get rid of the unused variable warning with the if() statement */ if( strcmp(s->s_name, "set") == 0 ) x->x_gid = get_gid_from_arguments(argc, argv); } static void group_float(t_group *x, t_float f) { x->x_gid = f; group_output(x); } static void group_symbol(t_group *x, t_symbol *s) { t_atom argv[1]; SETSYMBOL(argv, s); group_set(x, gensym("set"), 1, argv); group_output(x); } static void *group_new(t_symbol *s, int argc, t_atom *argv) { DEBUG(post("group_new");); t_group *x = (t_group *)pd_new(group_class); if(!group_instance_count) { post("[group] %s",version); post("\twritten by Hans-Christoph Steiner "); post("\tcompiled on "__DATE__" at "__TIME__ " "); } group_instance_count++; floatinlet_new(&x->x_obj, &x->x_gid); x->x_data_outlet = outlet_new(&x->x_obj, 0); x->x_status_outlet = outlet_new(&x->x_obj, 0); group_set(x, gensym("set"), argc, argv); return (x); } void group_free(void) { #ifdef _WIN32 #else endgrent(); #endif /* _WIN32 */ } void group_setup(void) { DEBUG(post("group_setup");); group_class = class_new(gensym("group"), (t_newmethod)group_new, 0, sizeof(t_group), 0, A_GIMME, 0); /* add inlet datatype methods */ class_addbang(group_class, (t_method) group_output); class_addfloat(group_class, (t_method) group_float); class_addsymbol(group_class, (t_method) group_symbol); /* add inlet message methods */ class_addmethod(group_class, (t_method) group_set, gensym("set"), A_GIMME, 0); } #endif /* NOT _WIN32 */ pd-hcs_0.1/split_path-help.pd0000644000076500007650000000161710755130521014716 0ustar hanshans#N canvas 0 22 479 355 10; #X obj 111 221 split_path; #X symbolatom 111 281 0 0 0 3 path - -; #X symbolatom 175 245 0 0 0 3 filename - -; #X msg 31 20 symbol just-a-file.pd; #X obj 95 241 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 159 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 139 102 symbol relative-path/; #X text 302 102 <-- note trailing /; #X msg 152 156 symbol /path/to/too/many//////slashes; #X text 213 303 ^-- always ends without a /; #X msg 76 46 symbol /path/to/just-a-file.pd; #X msg 118 78 symbol no-trailing-slash; #X msg 146 131 symbol ../another/relative/path/to/file.pd; #X msg 154 179 symbol /path/with/trailing/slash/; #X connect 0 0 1 0; #X connect 0 0 4 0; #X connect 0 1 2 0; #X connect 0 1 5 0; #X connect 3 0 0 0; #X connect 6 0 0 0; #X connect 8 0 0 0; #X connect 10 0 0 0; #X connect 11 0 0 0; #X connect 12 0 0 0; #X connect 13 0 0 0; pd-hcs_0.1/blocksize_in_ms.pd0000644000076500007650000000102410755130521014763 0ustar hanshans#N canvas 0 22 458 308 10; #X obj 178 262 outlet; #X obj 164 31 inlet; #X obj 164 56 bang; #X text 209 31 bang to recalculate; #X obj 164 124 samplerate~; #X obj 178 192 /; #X msg 164 170 64; #X obj 164 151 t b f; #X text 30 170 default block size:; #X text 8 25 [blocksize_in_ms]; #X obj 178 229 * 1000; #X text 35 278 TODO: make blocksize read from actual Pd setting; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 4 0 7 0; #X connect 5 0 10 0; #X connect 6 0 5 0; #X connect 7 0 6 0; #X connect 7 1 5 1; #X connect 10 0 0 0; pd-hcs_0.1/get-midi-dialog-help.pd0000644000076500007650000000134511213554662015507 0ustar hanshans#N canvas 101 310 611 344 10; #X msg 34 111 bang; #X obj 73 174 pddp/print; #X obj 53 179 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 9 23 get the MIDI settings to save as part of the patch.; #X text 153 93 Open the MIDI Settings and click OK to get the data \, then click bang to use them in the patch; #X obj 34 142 get-midi-dialog; #X obj 34 203 prepend set; #X obj 34 278 send pd; #X text 246 249 <-- this message will be saved as part of your patch. click it or [loadbang] it to configure the MIDI settings. Make sure it is attached to a [send pd] so that Pd gets the message.; #X msg 34 249; #X connect 0 0 5 0; #X connect 5 0 1 0; #X connect 5 0 2 0; #X connect 5 0 6 0; #X connect 6 0 9 0; #X connect 9 0 7 0; pd-hcs_0.1/keyboard_layout-help.pd0000644000076500007650000000123710755130521015742 0ustar hanshans#N canvas 146 36 576 362 10; #X obj 116 144 keyboard_layout; #X msg 118 32 bang; #X msg 146 63 menu; #X obj 242 244 flatspace/popup 124 25 #ffffff _; #X msg 141 209 options; #X obj 203 163 route clear; #X symbolatom 116 277 0 0 0 0 - - -; #X text 185 64 see all options in the popup menu; #X obj 308 111 symbol; #X text 250 283 select a new input method with the popup menu; #X obj 202 185 bang; #X msg 197 208 name language; #X connect 0 0 6 0; #X connect 0 1 5 0; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 1 8 0; #X connect 4 0 3 0; #X connect 5 0 10 0; #X connect 5 1 3 0; #X connect 8 0 0 0; #X connect 10 0 4 0; #X connect 10 0 11 0; #X connect 11 0 3 0; pd-hcs_0.1/tremolo~-help.pd0000644000076500007650000000100311213554662014421 0ustar hanshans#N canvas 150 177 450 300 10; #X obj 146 25 osc~ 270; #X obj 139 232 dac~; #X obj 309 24 pddp/dsp; #X obj 189 75 hsl 128 17 0 1 0 0 empty empty amount 6 9 0 10 -262144 -1 -1 8500 1; #X floatatom 197 94 5 0 0 0 - - -; #X obj 230 122 hsl 128 17 0.01 10 1 0 empty empty frequency 6 9 0 10 -262144 -1 -1 7200 1; #X floatatom 238 141 5 0 0 0 - - -; #X obj 146 151 tremolo~ 0.5 7; #X connect 0 0 7 0; #X connect 3 0 4 0; #X connect 3 0 7 1; #X connect 5 0 6 0; #X connect 5 0 7 2; #X connect 7 0 1 0; #X connect 7 0 1 1; pd-hcs_0.1/version.c0000644000076500007650000000665611442735515013145 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* object for getting the version of Pd-extended */ /* (it gets the version at compile time, so it will show the version of Pd */ /* that is was compiled against) */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006, 2010 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include static char *version = "1.3"; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *version_class; typedef struct _version { t_object x_obj; } t_version; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void version_output(t_version* x) { DEBUG(post("version_output");); int major, minor, bugfix; t_atom version_data[6]; sys_getversion(&major, &minor, &bugfix); SETFLOAT(version_data, (t_float) major); SETFLOAT(version_data + 1, (t_float) minor); SETFLOAT(version_data + 2, (t_float) bugfix); SETSYMBOL(version_data + 3, gensym(PD_TEST_VERSION)); SETSYMBOL(version_data + 4, gensym(__DATE__)); SETSYMBOL(version_data + 5, gensym(__TIME__)); outlet_list(x->x_obj.ob_outlet, &s_list, 6, version_data); } static void *version_new(t_symbol *s) { DEBUG(post("version_new");); t_version *x = (t_version *)pd_new(version_class); outlet_new(&x->x_obj, &s_list); return (x); } void version_setup(void) { DEBUG(post("version_setup");); version_class = class_new(gensym("version"), (t_newmethod)version_new, 0, sizeof(t_version), 0, 0); /* add inlet datatype methods */ class_addbang(version_class,(t_method) version_output); } pd-hcs_0.1/README-ifeel.txt0000644000076500007650000000077710755130521014062 0ustar hanshans You need the iFeel linux kernel module from http://sourceforge.net/projects/tactile in order to use this external. The iFeel mouse uses periodic pulses to create the various haptic effects. ------------------------------------------------------------------------------ control type raw range pd range ------------------------------------------------------------------------------ strength of pulse 1-255 0 - 1 delay between pulses 1-255 0 - infinite milliseconds number of pulses 1-255 0 - infinite pd-hcs_0.1/pwm-help.pd0000644000076500007650000000270710755130521013353 0ustar hanshans#N canvas 172 95 530 434 10; #X text 140 148 the argument sets the frequency; #X obj 88 102 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1 ; #X obj 142 96 hsl 128 15 0 1 0 0 empty empty amount -2 -6 1 12 -261681 -1 -1 11100 1; #X floatatom 149 118 5 0 0 0 - - -; #X text 14 20 this object does Pulse Width Modulation at the message rate:; #X text 3 101 turn on/off; #X obj 77 397 pddp/pddplink http://en.wikipedia.org/wiki/Pulse-width_modulation ; #X text 17 376 for more info:; #N canvas 0 0 450 300 graph1 0; #X array \$0-pwm 200 float 0; #X coords 0 1.2 199 -0.2 200 140 1; #X restore 284 202 graph; #N canvas 727 94 454 304 display 0; #X obj 115 35 inlet; #X obj 117 265 tabwrite \$0-pwm; #X obj 238 127 float; #X obj 281 127 + 1; #X obj 275 157 arraysize \$0-pwm; #X obj 250 31 inlet; #X obj 356 110 bang; #X obj 258 181 mod; #X obj 116 103 spigot; #X obj 118 239 float; #X obj 194 204 trigger bang float; #X obj 237 105 metro 3; #X connect 0 0 8 0; #X connect 2 0 7 0; #X connect 3 0 2 1; #X connect 4 0 7 1; #X connect 5 0 6 0; #X connect 5 0 8 1; #X connect 5 0 11 0; #X connect 6 0 4 0; #X connect 7 0 3 0; #X connect 7 0 10 0; #X connect 8 0 9 1; #X connect 9 0 1 0; #X connect 10 0 9 0; #X connect 10 1 1 1; #X connect 11 0 2 0; #X restore 95 310 pd display guts; #X obj 195 283 tgl 15 0 empty empty display 0 -6 0 8 -225271 -1 -1 1 1; #X obj 96 147 pwm 10; #X connect 1 0 11 0; #X connect 2 0 3 0; #X connect 2 0 11 1; #X connect 10 0 9 1; #X connect 11 0 9 0; pd-hcs_0.1/group_name2gid-help.pd0000644000076500007650000000167611213554662015464 0ustar hanshans#N canvas 185 212 481 320 10; #X floatatom 56 240 5 0 0 0 - - -; #X msg 14 148 bang; #X msg 143 162 symbol daemon; #X obj 30 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 94 109 symbol lp; #X msg 100 135 symbol trash; #X floatatom 272 231 5 0 0 0 - - -; #X msg 271 159 bang; #X obj 142 240 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 145 262 ^-- bang if not found; #X obj 421 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 57 49 symbol wheel; #X msg 76 81 symbol staff; #X text 12 14 convert a group name to a GID.; #X obj 272 201 group_name2gid staff; #X obj 56 190 group_name2gid; #X msg 361 166 symbol postfix; #X connect 1 0 15 0; #X connect 2 0 15 1; #X connect 4 0 15 0; #X connect 5 0 15 0; #X connect 7 0 14 0; #X connect 11 0 15 0; #X connect 12 0 15 0; #X connect 14 0 6 0; #X connect 14 1 10 0; #X connect 15 0 0 0; #X connect 15 0 3 0; #X connect 15 1 8 0; #X connect 16 0 14 1; pd-hcs_0.1/pwm.pd0000644000076500007650000000303310755130521012416 0ustar hanshans#N canvas 240 53 501 567 10; #X msg 208 411 0; #X msg 157 412 1; #X text 281 361 duty cycle; #X obj 6 30 inlet; #X obj 256 31 inlet; #X text 46 30 start/stop; #X obj 226 384 delay; #X obj 157 146 select 1; #X obj 208 168 bang; #X obj 7 332 spigot; #X obj 7 290 bang; #X obj 328 254 /; #X msg 290 222 1000; #X obj 290 130 loadbang; #X obj 7 310 delay 100; #X obj 256 361 *; #X obj 256 88 max 0; #X obj 256 66 min 1; #X text 27 8 argument = pwm rate in Hz; #X obj 290 177 abs; #X obj 184 493 outlet; #X text 228 533 released under the GNU GPL; #X text 14 517 (C) Copyright 2006 Hans-Christoph Steiner ; #X text 299 32 pulse width (0-1); #X obj 290 154 purepd/float_argument \$1 30; #X obj 290 201 trigger bang float; #X obj 184 441 float; #X obj 328 293 send \$0-ms; #X obj 272 336 receive \$0-ms; #X obj 65 289 receive \$0-ms; #X obj 6 104 trigger float float; #X obj 157 232 purepd/once; #X connect 0 0 26 0; #X connect 1 0 10 0; #X connect 1 0 26 0; #X connect 3 0 30 0; #X connect 4 0 17 0; #X connect 6 0 0 0; #X connect 7 0 31 0; #X connect 7 1 8 0; #X connect 8 0 0 0; #X connect 8 0 31 1; #X connect 9 0 6 0; #X connect 9 0 1 0; #X connect 10 0 14 0; #X connect 11 0 27 0; #X connect 12 0 11 0; #X connect 13 0 24 0; #X connect 14 0 9 0; #X connect 15 0 6 1; #X connect 16 0 15 0; #X connect 17 0 16 0; #X connect 19 0 25 0; #X connect 24 0 19 0; #X connect 25 0 12 0; #X connect 25 1 11 1; #X connect 26 0 20 0; #X connect 28 0 15 1; #X connect 29 0 14 1; #X connect 30 0 7 0; #X connect 30 1 9 1; #X connect 31 0 1 0; #X connect 31 0 6 0; pd-hcs_0.1/noquit-help.pd0000644000076500007650000000141411213554662014067 0ustar hanshans#N canvas 257 41 431 325 10; #X obj 64 222 noquit; #X obj 64 107 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 81 131 bang; #X msg 97 155 reset; #X msg 108 178 quit; #X obj 9 7 cnv 15 400 30 empty empty noquit 20 16 0 14 -261682 -66577 0; #X obj 64 250 bng 35 250 50 0 empty empty bang_on_quit 38 17 0 12 -261234 -1 -1; #X msg 108 198 quitnow; #X text 159 177 quit in the normal way; #X text 88 106 override/reset quitting; #X text 118 132 override quitting; #X text 139 153 re-enable normal quit function; #X text 159 197 quit now without any confirmation at all; #X text 34 58 override quitting Pd for installations \, performances \, etc.; #X connect 0 0 6 0; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 7 0 0 0; pd-hcs_0.1/stat.c0000644000076500007650000002235411213554662012422 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* object for getting file type (dir, link, exe, etc) using a filename */ /* Written by Hans-Christoph Steiner */ /* */ /* Copyright (c) 2006 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif #include #include #include #include static char *version = "$Revision: 1.5 $"; t_int stat_instance_count; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *stat_class; #ifdef _WIN32 typedef struct _stat_win { #else typedef struct _stat { #endif /* _WIN32 */ t_object x_obj; t_symbol *x_filename; /* output */ t_atom *output; // holder for a list of atoms to be outputted t_int output_count; // number of atoms in in x->output t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_stat; /*------------------------------------------------------------------------------ * SUPPORT FUNCTIONS */ /* add one new atom to the list to be outputted */ static void add_atom_to_output(t_stat *x, t_atom *new_atom) { t_atom *new_atom_list; new_atom_list = (t_atom *)getbytes((x->output_count + 1) * sizeof(t_atom)); memcpy(new_atom_list, x->output, x->output_count * sizeof(t_atom)); freebytes(x->output, x->output_count * sizeof(t_atom)); x->output = new_atom_list; memcpy(x->output + x->output_count, new_atom, sizeof(t_atom)); ++(x->output_count); } /* static void add_symbol_to_output(t_stat *x, t_symbol *s) { t_atom *temp_atom = getbytes(sizeof(t_atom)); SETSYMBOL(temp_atom, s); add_atom_to_output(x,temp_atom); freebytes(temp_atom,sizeof(t_atom)); } */ static void add_float_to_output(t_stat *x, t_float f) { t_atom *temp_atom = getbytes(sizeof(t_atom)); SETFLOAT(temp_atom, f); add_atom_to_output(x,temp_atom); freebytes(temp_atom,sizeof(t_atom)); } static void reset_output(t_stat *x) { if(x->output) { freebytes(x->output, x->output_count * sizeof(t_atom)); x->output = NULL; x->output_count = 0; } } /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void stat_output_error(t_stat *x) { DEBUG(post("stat_output_error");); t_atom output_atoms[2]; switch(errno) { case EACCES: error("[stat]: access denied: %s", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("access_denied")); break; case EIO: error("[stat]: An error occured while reading %s", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("io_error")); break; #ifndef _WIN32 case ELOOP: error("[stat]: A loop exists in symbolic links in %s", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("symlink_loop")); break; #endif case ENAMETOOLONG: error("[stat]: The filename %s is too long", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("name_too_long")); break; case ENOENT: error("[stat]: %s does not exist", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("does_not_exist")); break; case ENOTDIR: error("[stat]: A component of %s is not a existing folder", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("not_folder")); break; #ifndef _WIN32 case EOVERFLOW: error("[stat]: %s caused overflow in stat struct", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("internal_overflow")); break; #endif case EFAULT: error("[stat]: fault in stat struct (%s)", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("internal_fault")); break; case EINVAL: error("[stat]: invalid argument to stat() (%s)", x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("invalid")); break; default: error("[stat]: unknown error %d: %s", errno, x->x_filename->s_name); SETSYMBOL(output_atoms, gensym("unknown")); } SETSYMBOL(output_atoms + 1, x->x_filename); outlet_anything(x->x_status_outlet, gensym("error"), 2, output_atoms); } static void stat_output(t_stat* x) { DEBUG(post("stat_output");); #ifdef _WIN32 struct _stat stat_buffer; #else struct stat stat_buffer; #endif int result; #ifdef _WIN32 result = _stat(x->x_filename->s_name, &stat_buffer); #else result = stat(x->x_filename->s_name, &stat_buffer); #endif /* _WIN32 */ if(result != 0) { stat_output_error(x); } else { reset_output(x); add_float_to_output(x, (t_float) stat_buffer.st_mode); add_float_to_output(x, (t_float) stat_buffer.st_nlink); add_float_to_output(x, (t_float) stat_buffer.st_uid); add_float_to_output(x, (t_float) stat_buffer.st_gid); add_float_to_output(x, (t_float) stat_buffer.st_rdev); add_float_to_output(x, (t_float) stat_buffer.st_size); #ifdef _WIN32 add_float_to_output(x, (t_float) 0); add_float_to_output(x, (t_float) 0); #else add_float_to_output(x, (t_float) stat_buffer.st_blocks); add_float_to_output(x, (t_float) stat_buffer.st_blksize); #endif /* 86400 seconds == 24 hours == 1 day */ #if defined(_POSIX_C_SOURCE) || defined(_WIN32) add_float_to_output(x, (t_float) (stat_buffer.st_atime / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_atime % 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_mtime / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_mtime % 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_ctime / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_ctime % 86400)); #else add_float_to_output(x, (t_float) (stat_buffer.st_atimespec.tv_sec / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_atimespec.tv_sec % 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_mtimespec.tv_sec / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_mtimespec.tv_sec % 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_ctimespec.tv_sec / 86400)); add_float_to_output(x, (t_float) (stat_buffer.st_ctimespec.tv_sec % 86400)); #endif /* _POSIX_C_SOURCE */ outlet_anything(x->x_data_outlet,x->x_filename, x->output_count,x->output); } } static void stat_set(t_stat* x, t_symbol *s) { DEBUG(post("stat_set");); #ifdef _WIN32 char string_buffer[MAX_PATH]; ExpandEnvironmentStrings(s->s_name, string_buffer, MAX_PATH); x->x_filename = gensym(string_buffer); #else x->x_filename = s; #endif } static void stat_symbol(t_stat *x, t_symbol *s) { stat_set(x,s); stat_output(x); } static void *stat_new(t_symbol *s) { DEBUG(post("stat_new");); t_stat *x = (t_stat *)pd_new(stat_class); if(!stat_instance_count) { post("[stat] %s",version); post("\twritten by Hans-Christoph Steiner "); post("\tcompiled on "__DATE__" at "__TIME__ " "); } stat_instance_count++; symbolinlet_new(&x->x_obj, &x->x_filename); x->x_data_outlet = outlet_new(&x->x_obj, 0); x->x_status_outlet = outlet_new(&x->x_obj, 0); /* set to the value from the object argument, if that exists */ if (s != &s_) { x->x_filename = s; } else { x->x_filename = canvas_getcurrentdir(); post("setting pattern to default: %s",x->x_filename->s_name); } return (x); } void stat_setup(void) { DEBUG(post("stat_setup");); stat_class = class_new(gensym("stat"), (t_newmethod)stat_new, 0, sizeof(t_stat), 0, A_DEFSYM, 0); /* add inlet datatype methods */ class_addbang(stat_class,(t_method) stat_output); class_addsymbol(stat_class,(t_method) stat_symbol); /* add inlet message methods */ class_addmethod(stat_class,(t_method) stat_set,gensym("set"), A_DEFSYM, 0); } pd-hcs_0.1/make-audio-dialog-help.pd0000644000076500007650000000073211213554662016023 0ustar hanshans#N canvas 699 277 450 300 10; #X msg 59 115 bang; #X obj 59 147 get-audio-dialog; #X msg 59 203 \; pd audio-dialog 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 0 44100 50 0; #X obj 59 176 make-audio-dialog; #X text 40 23 [make-audio-dialog] takes the audio-dialog message from [get-audio-dialog] and generates a clickable message box that will set the audio settings. This message box is also suitable for use with a [loadbang]; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 3 0 2 0; pd-hcs_0.1/debounce.pd0000644000076500007650000000124310755130521013400 0ustar hanshans#N canvas 132 316 478 432 10; #X obj 38 43 inlet; #X obj 252 108 f \$1; #X obj 252 85 loadbang; #X obj 226 33 inlet; #X obj 251 132 select 0; #X text 274 34 delay between state change; #X obj 62 381 outlet; #X obj 61 325 f; #X text 298 152 set default; #X obj 246 189 send \$0-delay; #X obj 157 271 delay; #X obj 187 248 receive \$0-delay; #X text 80 31 float input; #X text 120 378 debounced float output; #X msg 250 152 10; #X obj 100 103 change; #X connect 0 0 7 1; #X connect 0 0 15 0; #X connect 1 0 4 0; #X connect 2 0 1 0; #X connect 3 0 9 0; #X connect 4 0 14 0; #X connect 4 1 9 0; #X connect 7 0 6 0; #X connect 10 0 7 0; #X connect 11 0 10 1; #X connect 14 0 9 0; pd-hcs_0.1/hostname.pd0000644000076500007650000000032010755130521013425 0ustar hanshans#N canvas 0 22 454 304 10; #X obj 91 29 inlet; #X obj 92 108 uname; #X obj 92 131 unpack symbol symbol symbol symbol symbol; #X obj 162 209 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 1 3 0; pd-hcs_0.1/canvas_name.c0000644000076500007650000000347011464025222013711 0ustar hanshans#include #include #include #include "g_canvas.h" #define DEBUG(x) static t_class *canvas_name_class; static t_canvas *canvas; typedef struct _canvas_name { t_object x_obj; t_atom x_atom; t_symbol *x_canvas_name; t_symbol *x_remote_name; } t_canvas_name; static void canvas_name_bang(t_canvas_name *x) { if (x->x_atom.a_type == A_SYMBOL) { canvas=(t_canvas *)pd_findbyclass(x->x_remote_name, canvas_class); char buf[MAXPDSTRING]; snprintf(buf, MAXPDSTRING, ".x%lx.c", (long unsigned int)canvas); x->x_canvas_name = gensym(buf); } outlet_symbol(x->x_obj.ob_outlet,x->x_canvas_name); } static void *canvas_name_new(t_symbol *s, int argc, t_atom *argv) { t_atom a; if (argc == 0) { argc = 1; SETFLOAT(&a, 0); argv = &a; } t_canvas_name *x = (t_canvas_name *)pd_new(canvas_name_class); x->x_atom = *argv; if (argv->a_type == A_FLOAT) { // thx to IOhannes's iemguts: t_glist *glist=(t_glist *)canvas_getcurrent(); canvas=(t_canvas *)glist_getcanvas(glist); int depth=(int)atom_getint(&x->x_atom); if(depth<0)depth=0; while(depth && canvas) { canvas=canvas->gl_owner; depth--; } char buf[MAXPDSTRING]; snprintf(buf, MAXPDSTRING, ".x%lx.c", (long unsigned int)canvas); x->x_canvas_name = gensym(buf); } else { x->x_remote_name = (t_symbol *)atom_getsymbol(&x->x_atom); } outlet_new(&x->x_obj, &s_symbol); return(x); } void canvas_name_setup(void) { canvas_name_class = class_new(gensym("canvas_name"), (t_newmethod)canvas_name_new, NULL, sizeof(t_canvas_name), 0, A_GIMME, 0); class_addbang(canvas_name_class, (t_method)canvas_name_bang); } pd-hcs_0.1/cursor-help.pd0000644000076500007650000000531311466064376014077 0ustar hanshans#N canvas 72 22 659 523 10; #X obj 388 293 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ; #X text 273 276 Here's a complete list of the available cursors:; #X msg 441 124 dot; #X msg 518 124 gumby; #X msg 561 124 gobbler; #X msg 370 124 coffee_mug; #X msg 471 124 pirate; #X msg 42 44 runmode_nothing; #N canvas 0 22 462 312 make 0; #X obj 95 9 inlet; #X obj 114 258 outlet; #X obj 116 168 pack symbol symbol; #X obj 221 147 symbol; #X obj 94 51 symbol; #X obj 227 16 inlet; #X msg 116 192 set \$1 \$2; #X obj 115 220 trigger bang anything; #X connect 0 0 4 0; #X connect 2 0 6 0; #X connect 3 0 2 1; #X connect 4 0 2 0; #X connect 5 0 3 0; #X connect 6 0 7 0; #X connect 7 0 1 0; #X connect 7 1 1 0; #X restore 169 205 pd make message; #X msg 59 63 runmode_clickme; #X msg 75 82 runmode_thicken; #X msg 92 101 runmode_addpoint; #X msg 110 120 editmode_nothing; #X obj 169 266 cursor; #X text 342 238 <-- this is the actual message to send; #X text 15 18 set your mouse cursors for this patch:; #X text 279 309 Here are some pictures of the cursors:; #X obj 387 325 pddp/pddplink http://www.lehigh.edu/~sol0/ptk/cursors.gif ; #X msg 126 139 editmode_connect; #X msg 143 158 editmode_disconnect; #X msg 169 239 runmode_clickme gumby; #X text 290 55 first pick a cursor:; #X text 189 80 <-- then choose your cursor mode; #X obj 46 390 cursor; #X msg 55 367 bang; #X obj 46 448 route x y; #X floatatom 33 472 5 0 0 0 x - -; #X floatatom 71 472 5 0 0 1 y - -; #X obj 46 342 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X floatatom 135 488 5 0 0 1 mousewheel - -; #X obj 46 414 route motion mousewheel button; #X text 65 339 turn on to get mouse motion and buttons; #X obj 164 440 route 1 2 3; #X obj 164 460 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 185 460 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 206 460 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X text 227 459 <-- mouse buttons; #X text 86 366 or bang to get the current mouse position; #N canvas 583 22 481 747 image 0; #X obj 240 373 moonlib/image examples/cursor.gif; #X restore 509 309 pd image of all cursors; #X msg 328 124 clock; #X msg 288 124 arrow; #X connect 2 0 8 1; #X connect 3 0 8 1; #X connect 4 0 8 1; #X connect 5 0 8 1; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 8 0 20 0; #X connect 9 0 8 0; #X connect 10 0 8 0; #X connect 11 0 8 0; #X connect 12 0 8 0; #X connect 18 0 8 0; #X connect 19 0 8 0; #X connect 20 0 13 0; #X connect 23 0 30 0; #X connect 24 0 23 0; #X connect 25 0 26 0; #X connect 25 1 27 0; #X connect 28 0 23 0; #X connect 30 0 25 0; #X connect 30 1 29 0; #X connect 30 2 32 0; #X connect 32 0 33 0; #X connect 32 1 34 0; #X connect 32 2 35 0; #X connect 39 0 8 1; #X connect 40 0 8 1; pd-hcs_0.1/classpath.c0000644000076500007650000001125711213554662013431 0ustar hanshans/* --------------------------------------------------------------------------*/ /* */ /* This object outputs the global search path for finding objects using a */ /* similar interface as [textfile] and [qlist]. */ /* */ /* Copyright (c) 2006 Hans-Christoph Steiner */ /* */ /* 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 3 */ /* of the License, or (at your option) any later version. */ /* */ /* See file LICENSE for further informations on licensing terms. */ /* */ /* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* --------------------------------------------------------------------------*/ #include "m_pd.h" #include "s_stuff.h" #include /* #ifdef _WIN32 #define _WIN32_WINNT 0x0400 #include #include #else #include #endif */ static char *version = "$Revision: 1.3 $"; t_int classpath_instance_count; #define DEBUG(x) //#define DEBUG(x) x /*------------------------------------------------------------------------------ * CLASS DEF */ static t_class *classpath_class; typedef struct _classpath { t_object x_obj; t_namelist *x_top; t_namelist *x_current; t_outlet *x_data_outlet; t_outlet *x_status_outlet; } t_classpath; /*------------------------------------------------------------------------------ * IMPLEMENTATION */ static void classpath_output(t_classpath* x) { DEBUG(post("classpath_output");); /* TODO: think about using x->x_current->nl_next so that if [classlist] is at * the end of its list, and another element gets added to the global * classpath, [classpath] will output the new element on the next bang. */ if(x->x_current) { outlet_symbol( x->x_data_outlet, gensym(x->x_current->nl_string) ); x->x_current = x->x_current->nl_next; } else outlet_bang(x->x_status_outlet); } static void classpath_rewind(t_classpath* x) { DEBUG(post("classpath_output");); char buffer[MAXPDSTRING]; strncpy(buffer, sys_libdir->s_name, MAXPDSTRING - 6); strcat(buffer, "/extra"); x->x_top = namelist_append(NULL, buffer, 0); x->x_top->nl_next = sys_searchpath; x->x_current = x->x_top; } static void classpath_add(t_classpath* x, t_symbol *s) { DEBUG(post("classpath_add");); } static void *classpath_new() { DEBUG(post("classpath_new");); t_classpath *x = (t_classpath *)pd_new(classpath_class); if(!classpath_instance_count) { post("[classpath] %s",version); post("\twritten by Hans-Christoph Steiner "); post("\tcompiled on "__DATE__" at "__TIME__ " "); post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION); } classpath_instance_count++; x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol); x->x_status_outlet = outlet_new(&x->x_obj, 0); classpath_rewind(x); return (x); } void classpath_free() { // TODO: look into freeing the namelist } void classpath_setup(void) { DEBUG(post("classpath_setup");); classpath_class = class_new(gensym("classpath"), (t_newmethod)classpath_new, 0, sizeof(t_classpath), 0, 0); /* add inlet datatype methods */ class_addbang(classpath_class,(t_method) classpath_output); /* add inlet message methods */ class_addmethod(classpath_class,(t_method) classpath_rewind, gensym("rewind"), 0); class_addmethod(classpath_class,(t_method) classpath_add,gensym("add"), A_DEFSYMBOL, 0); }