On Monday 29 May 2006 19:11, matt ingalls wrote: > yea probably to keep things more consistent. > i did the outvalue hack before the invalue one and > came up with a different system. i'll change the magic > number to the magic character. The alternate method for implementing string values in outvalue is already there, just commented out (see below). I also made changes to remove any $ characters from the beginning of channel names specified by the orchestra, to avoid confusing hosts. > Unless i'm not thinking of something [ no coffee yet this morn ] > i think you still need some kind of separator between the channel > name and the value string as the host side does not necessarily > know about the channel name. I do not really know what you mean by the host not knowing about the channel name, but the separator in the (disabled) code below is the '\0' character at the end of the channel name. int koutval(CSOUND *csound, OUTVAL *p) { if (csound->OutputValueCallback_) { if (p->XSTRCODE & 2) { char text[2048]; #if 1 /* a hack to support strings */ /* FIXME: check for buffer overflow */ sprintf(text, "%s::%s", p->channelName, (char*) p->value); /* NOTE: with 32 bit floats, */ /* the magic number is rounded to -987654336 */ csound->OutputValueCallback_(csound, text, (MYFLT) -987654321); #else int n; /* alternate hack to support strings */ /* FIXME: check for buffer overflow */ n = sprintf(text, "$%s", p->channelName); strcpy(&(text[n + 1]), (char*) p->value); csound->OutputValueCallback_(csound, text, FL(0.0)); #endif } else csound->OutputValueCallback_(csound, p->channelName, *(p->value)); } return OK; } _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net