Re: [PD] timebang inlet
On Wed, May 12, 2010 at 7:01 PM, Hans-Christoph Steiner h...@at.or.at wrote: The number of times have to match in the [set ( msg and the object arguments. So if there are two times set in the arguments, the [set( message also needs two sets of times. Hi Hans, yes, the set arguments should match, but i don't know why the set message don't update the schedule [set 20 20 20( | [timebang 10 10 10] timebang: read in 1 times of day: 10:10:10 thanks! -- cb ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] timebang inlet
becks wrote: On Wed, May 12, 2010 at 7:01 PM, Hans-Christoph Steinerh...@at.or.at wrote: The number of times have to match in the [set ( msg and the object arguments. So if there are two times set in the arguments, the [set( message also needs two sets of times. Hi Hans, yes, the set arguments should match, but i don't know why the set message don't update the schedule [set 20 20 20( | [timebang 10 10 10] timebang: read in 1 times of day: 10:10:10 I think there is a small bug in the set function (timebang_set) so that the set message didn't actually do anything. The attached patch should solve the problem. Lorenzo thanks! --- main_old.c 2010-05-13 10:34:41.769033234 +0200 +++ main.c 2010-05-13 10:34:09.281531060 +0200 @@ -30,7 +30,7 @@ #define MAX_TIMES 256 /* maximum number of times to process */ static char *version = timebang v0.2, written by Olaf Matthes olaf.matt...@gmx.de; - + typedef struct timebang { t_object x_ob; @@ -59,7 +59,7 @@ { if(!x-x_over[i]) { - if(newtime-tm_hour == x-x_hour[i] + if(newtime-tm_hour == x-x_hour[i] newtime-tm_min == x-x_min[i] newtime-tm_sec = x-x_sec[i]) { @@ -76,17 +76,17 @@ static void timebang_set(t_timebang *x, t_symbol *s, int ac, t_atom *av) { - int i; + int i,j; if(ac == x-x_notimes * 3) { - for(i = 0; i ac; i += 3) + for(i = 0, j = 0; i ac; i += 3, j++) { - if (av[i].a_type == A_FLOAT) x-x_hour[x-x_notimes] = av[i].a_w.w_float; + if (av[i].a_type == A_FLOAT) x-x_hour[j] = av[i].a_w.w_float; else { post (timebang: first argument must be (int) hours); return; } - if (av[i+1].a_type == A_FLOAT) x-x_min[x-x_notimes] = av[i+1].a_w.w_float; + if (av[i+1].a_type == A_FLOAT) x-x_min[j] = av[i+1].a_w.w_float; else { post (timebang: second argument must be (int) minutes); return; } - if (av[i+2].a_type == A_FLOAT) x-x_sec[x-x_notimes] = av[i+2].a_w.w_float; + if (av[i+2].a_type == A_FLOAT) x-x_sec[j] = av[i+2].a_w.w_float; else { post (timebang: third argument must be (int) seconds); return; } x-x_over[i] = 0; } @@ -171,5 +171,3 @@ class_sethelpsymbol(timebang_class, gensym(maxlib/help-timebang.pd)); #endif } - - ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] timebang inlet
Lorenzo wrote: becks wrote: On Wed, May 12, 2010 at 7:01 PM, Hans-Christoph Steinerh...@at.or.at wrote: The number of times have to match in the [set ( msg and the object arguments. So if there are two times set in the arguments, the [set( message also needs two sets of times. Hi Hans, yes, the set arguments should match, but i don't know why the set message don't update the schedule [set 20 20 20( | [timebang 10 10 10] timebang: read in 1 times of day: 10:10:10 I think there is a small bug in the set function (timebang_set) so that the set message didn't actually do anything. The attached patch should solve the problem. The patch was formatted badly, it wouldn't apply and had cosmetic changes in it. I applied it manually, and it seems to work, so I committed it: http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=revrevision=13528 .hc Lorenzo thanks! ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] timebang inlet
Hi, all i want to schedule some events, so i have found [timebang] object i have trouble passing arguments in the inlet: ie: [set 20 20 20( | [timebang 10 10 10] timebang: read in 1 times of day: 10:10:10 but i want 20:20:20 [set 20 20 20( | [timebang] timebang: wrong number of parameter the help is not clear, and here are the source: http://svn.puredata.info/svnroot/pure-data/branches/MAIN/externals/maxlib/src/timebang.c thanks! -- cb ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] timebang inlet
The number of times have to match in the [set ( msg and the object arguments. So if there are two times set in the arguments, the [set( message also needs two sets of times. .hc timebang-help.pd Description: Binary data On May 12, 2010, at 5:07 AM, becks wrote: Hi, all i want to schedule some events, so i have found [timebang] object i have trouble passing arguments in the inlet: ie: [set 20 20 20( | [timebang 10 10 10] timebang: read in 1 times of day: 10:10:10 but i want 20:20:20 [set 20 20 20( | [timebang] timebang: wrong number of parameter the help is not clear, and here are the source: http://svn.puredata.info/svnroot/pure-data/branches/MAIN/externals/maxlib/src/timebang.c thanks! -- cb ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list A cellphone to me is just an opportunity to be irritated wherever you are. - Linus Torvalds ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list