Forums > MaxMSP

formatting correct string

August 9, 2007 | 10:13 pm

Hi There,

I’m experiencing a odd problem while formatting a correct string using
the sprintf object.
I’m trying compile a list of symbols that should look like this:
00:01:14:05. As a SMPTE formatted timecode.

My problem is that I end up with something that looks like this:
00:01:14:5 , so without the last zero.
If someone could point me to the problem I would appreciate it.
here’s an example:

max v2;
#N vpatcher 1689 197 2468 817;
#P window setfont "Sans Serif" 9.;
#P newex 278 118 40 196617 t b b b;
#P message 308 419 97 196617 00: 00: 19: 0 tab;
#P newex 308 387 61 196617 prepend set;
#P newex 308 363 134 196617 sprintf 00: 00: %ld: 0 tab;
#P toggle 278 67 15 0;
#P newex 278 92 63 196617 metro 1000;
#P number 308 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter 1 9;
#X flags 0 0;
#P newobj 308 144 66 196617 counter 1 9;
#P message 308 336 20 196617 03;
#P message 358 265 52 196617 separator;
#P newex 308 285 78 196617 prepend symbol;
#P message 308 307 38 196617 set $1;
#P newex 308 265 49 196617 tosymbol;
#B color 5;
#P message 308 241 50 196617 0 6;
#P newex 308 212 61 196617 prepend set;
#P newex 308 191 69 196617 sprintf 0 %ld;
#P connect 11 0 10 0;
#P connect 10 0 15 0;
#P connect 15 2 8 0;
#P connect 8 0 9 0;
#P connect 9 0 0 0;
#P connect 0 0 1 0;
#P connect 15 1 2 0;
#P connect 1 0 2 0;
#P hidden connect 6 0 3 0;
#P connect 2 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P connect 15 0 7 0;
#P connect 4 0 7 0;
#P connect 7 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 14 0;
#P pop;

Cheers,

Martijn


August 9, 2007 | 10:27 pm


August 9, 2007 | 10:49 pm


August 10, 2007 | 5:41 am


August 10, 2007 | 7:53 am


August 10, 2007 | 9:37 am


August 10, 2007 | 9:50 am


August 10, 2007 | 9:58 am


August 10, 2007 | 11:38 am


August 10, 2007 | 11:40 am


August 10, 2007 | 2:25 pm


August 10, 2007 | 3:06 pm


August 10, 2007 | 5:47 pm


Viewing 13 posts - 1 through 13 (of 13 total)