[PD-dev] sendOSC bug - cannot send numeric symbols
Frank Barknecht
fbar at footils.org
Tue Mar 7 22:55:40 CET 2006
Hallo,
Claude Heiland-Allen hat gesagt: // Claude Heiland-Allen wrote:
> But, I'm using [pack s s s], and as the attached patch shows the real
> type of each atom in the list is preserved as it should be, it's only
> when it reaches sendOSC that the 'reinterpretation' occurs.
>
> Anyway, I rewrote the receiving program to accept numbers instead of
> strings, because I had that option, but this won't always be possible,
> so my conclusion is that sendOSC is broken.
Okay, I now checked the source code, and indeed, when typetags are on,
numeric values are converted inside to be INT or FLOAT. The check is here:
typedArg ParseToken(char *token) {
char *p = token;
typedArg returnVal;
/* It might be an int, a float, or a string */
if (*p == '-') p++;
if (isdigit(*p) || *p == '.') {
while (isdigit(*p)) p++;
if (*p == '\0') {
returnVal.type = INT_osc;
returnVal.datum.i = atoi(token);
return returnVal;
}
if (*p == '.') {
p++;
while (isdigit(*p)) p++;
if (*p == '\0') {
returnVal.type = FLOAT_osc;
returnVal.datum.f = atof(token);
return returnVal;
}
}
}
returnVal.type = STRING_osc;
returnVal.datum.s = token;
return returnVal;
}
Every element in the "send"-list will get passed through ParseToken(),
and the isdigit()-checks will of course match the numeric values and
set the types to INT_osc ("i") or FLOAT_osc ("f").
Well, I don't know what to do about this.
Ciao
--
Frank Barknecht _ ______footils.org_ __goto10.org__
More information about the Pd-dev
mailing list