Hi Frank, all,
Frank Barknecht wrote:
Hallo, Claude Heiland-Allen hat gesagt: // Claude Heiland-Allen wrote:
I'm trying to send the symbol output of [makefilename %d] using sendOSC, but it gets sent as a number instead of as a string. If I use [makefilename x%d] it is sent as a string, but I don't want that x there.
How are you sending? You cannot conserve "symbol 2" in a list- or meta-message as in
[4( | [makefilename %d] | [send /test $1( | [sendOSC]
as that would be sending the equivalent of [send /test 4( and your "symbol" is gone before it reaches the [sendOSC]. You could of course send: [send /test symbol 4( though you wouldn't need [makefilename] for that (and it still wouldn't be a string for most apps...)
I can quite imagine that $args in "messsagebox $1" get 'reinterpreted', by which I mean converted to a string and then back into whatever type Pd thinks that string should be (this is necessary for constructs like "messagebox $1-blah".
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.
Claude
#N canvas 210 109 569 503 10; #X obj 78 83 makefilename %d; #X floatatom 78 55 5 0 0 0 - - -; #X obj 13 111 pack s s s; #X obj 13 172 route list; #X msg 45 31 symbol blah; #X msg 13 9 symbol send; #X obj 13 133 t a a a; #X obj 133 202 unpack s s s; #X obj 131 228 unpack s s s; #X obj 35 231 route send; #X obj 13 196 t a a a; #X obj 38 274 route blah; #X obj 132 275 unpack s s; #X obj 130 296 unpack s; #X obj 38 252 t a a; #X obj 242 242 print p1; #X obj 238 265 print p2; #X obj 237 313 print p3; #X obj 235 342 print p4; #X obj 13 432 print out; #X obj 241 199 print in; #X text 135 370 ^^^ changing any of these [unpack ... s] to [unpack ... f] results in a type conversion error , so it is still a "real symbol" stored in a list at these points...; #X text 130 426 <<< this would be where [sendOSC] would be , which ignores the "real symbol" and sends it as a number instead.; #X connect 0 0 2 2; #X connect 1 0 0 0; #X connect 2 0 6 0; #X connect 3 0 10 0; #X connect 4 0 2 1; #X connect 5 0 2 0; #X connect 6 0 3 0; #X connect 6 1 7 0; #X connect 6 2 20 0; #X connect 7 2 15 0; #X connect 8 2 16 0; #X connect 9 0 14 0; #X connect 10 0 19 0; #X connect 10 1 9 0; #X connect 10 2 8 0; #X connect 11 0 13 0; #X connect 12 1 17 0; #X connect 13 0 18 0; #X connect 14 0 11 0; #X connect 14 1 12 0;