Dear list,
I want to get a string of words with spaces to puredata and render these words to gemwin with text3d. How can I send it from telnet and be sure all the words with spaces will arrive to netreceive? Normally if I send via OSC I loose everything after the space. Any hints are welcome.
Best,
Popesz
Am 20. März 2021 13:25:38 MEZ schrieb "Csaba Láng" langcsaba@gmail.com:
Dear list,
I want to get a string of words with spaces to puredata and render these words to gemwin with text3d. How can I send it from telnet and be sure all the words with spaces will arrive to netreceive?
send unicodepoints rather than strings, and use the [string ... ( msg of [text3d].
if your string is ASCII only, you can just use the output of [netreceive -u -b].
to use UDP, you need something like netcat. with telnet you can only use TCP/IP, so you must accumulate the raw binary message depending on your made-up protocol (eg split lines on \n).
there's also a utf-8 to unicodepoint abstraction in the Unicode library at https://git.iem.at/pd/unicode
Normally if I send via OSC I loose everything after the space.
then you are probably doing something wrong (when crreaatinthe OSC message).
mfg.hft.fsl IOhannes
Iohannes,
can you explain how I can send unicodepoints to text3d?
Best,
Popesz
On Sat, Mar 20, 2021 at 2:16 PM IOhannes m zmölnig zmoelnig@iem.at wrote:
Am 20. März 2021 13:25:38 MEZ schrieb "Csaba Láng" langcsaba@gmail.com:
Dear list,
I want to get a string of words with spaces to puredata and render these words to gemwin with text3d. How can I send it from telnet and be sure all the words with spaces will arrive to netreceive?
send unicodepoints rather than strings, and use the [string ... ( msg of [text3d].
if your string is ASCII only, you can just use the output of [netreceive -u -b].
to use UDP, you need something like netcat. with telnet you can only use TCP/IP, so you must accumulate the raw binary message depending on your made-up protocol (eg split lines on \n).
there's also a utf-8 to unicodepoint abstraction in the Unicode library at https://git.iem.at/pd/unicode
Normally if I send via OSC I loose everything after the space.
then you are probably doing something wrong (when crreaatinthe OSC message).
mfg.hft.fsl IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/22/21 2:52 PM, Csaba Láng wrote:
Iohannes,
can you explain how I can send unicodepoints to text3d?
using the [string( message (see the [text3d] help-patch)
e.g. [string 67 115 97 98 97 32 76 225 110 103(
the problem is mainly that what comes out of [netreceive -b] is not going to be unicode-points but utf-8 encodings thereof. this is where the unicode-library i mentioned earlier comes into play.
something like:
[declare -path unicode]
[netreceive -b 9999] [select 10 13] | / [append $1( | / [s $0-store] | __/ |/ [r $0-store] [list store] | [t a b] | [s $0-store] | [route bang] [utf82unicodenumber] [list prepend string] [list trim] | [text3d]
(the [s/r $0-store] is only to make the ascii-art nice; use proper connections instead)
if you can use UDP instead of TCP, you can practically omit anything between [select] and [route].
gfmadsr IOhannes
I try to make it simple without unicode, let's say.
What if I add [list $1 $2 $3 $4( to text3d where each $ is a word (max number of $ is the amount of words in the longest sentence) How can I achieve not to display 0 0 0 at the and of the list if number of words are less than max number of words in the longest sentence.
On Mon, Mar 22, 2021 at 3:25 PM IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 3/22/21 2:52 PM, Csaba Láng wrote:
Iohannes,
can you explain how I can send unicodepoints to text3d?
using the [string( message (see the [text3d] help-patch)
e.g. [string 67 115 97 98 97 32 76 225 110 103(
the problem is mainly that what comes out of [netreceive -b] is not going to be unicode-points but utf-8 encodings thereof. this is where the unicode-library i mentioned earlier comes into play.
something like:
[declare -path unicode]
[netreceive -b 9999] [select 10 13] | / [append $1( | / [s $0-store] | __/ |/ [r $0-store] [list store] | [t a b] | [s $0-store] | [route bang] [utf82unicodenumber] [list prepend string] [list trim] | [text3d]
(the [s/r $0-store] is only to make the ascii-art nice; use proper connections instead)
if you can use UDP instead of TCP, you can practically omit anything between [select] and [route].
gfmadsr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/22/21 3:47 PM, Csaba Láng wrote:
I try to make it simple without unicode, let's say.
What if I add [list $1 $2 $3 $4( to text3d where each $ is a word (max number of $ is the amount of words in the longest sentence) How can I achieve not to display 0 0 0 at the and of the list if number of words are less than max number of words in the longest sentence.
i probably misunderstood your question as "how do I correctly print text that contains multiple consecutive spaces" instead of the trivial "i want to print multiple words".
if your only problem is to create a list of variable length, then this is pretty unrelated to both [netreceive]/telnet and [text3d]
checkout the help for [list prepend] and possibly [list split] (and generally of the [list] objects).
also, i fail to see why you can't just use the patch i so beautifully painted. why does it not work for you?
gdmfs IOhannes
On Mon, Mar 22, 2021 at 3:25 PM IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 3/22/21 2:52 PM, Csaba Láng wrote:
Iohannes,
can you explain how I can send unicodepoints to text3d?
using the [string( message (see the [text3d] help-patch)
e.g. [string 67 115 97 98 97 32 76 225 110 103(
the problem is mainly that what comes out of [netreceive -b] is not going to be unicode-points but utf-8 encodings thereof. this is where the unicode-library i mentioned earlier comes into play.
something like:
[declare -path unicode]
[netreceive -b 9999] [select 10 13] | / [append $1( | / [s $0-store] | __/ |/ [r $0-store] [list store] | [t a b] | [s $0-store] | [route bang] [utf82unicodenumber] [list prepend string] [list trim] | [text3d]
(the [s/r $0-store] is only to make the ascii-art nice; use proper connections instead)
if you can use UDP instead of TCP, you can practically omit anything between [select] and [route].
gfmadsr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Iohannes, tried your way, bit tricky for my kind of knowledge, but the idea with routing just was the perfect solution. 2nd outlet of [route] did the job, it natively adds 'list' to the front of the words with sapces which was the missing part for text3d. All works perfectly and all the words with spaces are just perfectly rendered in gemwin.
Have such a lovely day as I have,
Popesz
On Mon, Mar 22, 2021 at 4:08 PM IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 3/22/21 3:47 PM, Csaba Láng wrote:
I try to make it simple without unicode, let's say.
What if I add [list $1 $2 $3 $4( to text3d where each $ is a word (max number of $ is the amount of words in the longest sentence) How can I achieve not to display 0 0 0 at the and of the list if number
of
words are less than max number of words in the longest sentence.
i probably misunderstood your question as "how do I correctly print text that contains multiple consecutive spaces" instead of the trivial "i want to print multiple words".
if your only problem is to create a list of variable length, then this is pretty unrelated to both [netreceive]/telnet and [text3d]
checkout the help for [list prepend] and possibly [list split] (and generally of the [list] objects).
also, i fail to see why you can't just use the patch i so beautifully painted. why does it not work for you?
gdmfs IOhannes
On Mon, Mar 22, 2021 at 3:25 PM IOhannes m zmoelnig zmoelnig@iem.at
wrote:
On 3/22/21 2:52 PM, Csaba Láng wrote:
Iohannes,
can you explain how I can send unicodepoints to text3d?
using the [string( message (see the [text3d] help-patch)
e.g. [string 67 115 97 98 97 32 76 225 110 103(
the problem is mainly that what comes out of [netreceive -b] is not going to be unicode-points but utf-8 encodings thereof. this is where the unicode-library i mentioned earlier comes into play.
something like:
[declare -path unicode]
[netreceive -b 9999] [select 10 13] | / [append $1( | / [s $0-store] | __/ |/ [r $0-store] [list store] | [t a b] | [s $0-store] | [route bang] [utf82unicodenumber] [list prepend string] [list trim] | [text3d]
(the [s/r $0-store] is only to make the ascii-art nice; use proper connections instead)
if you can use UDP instead of TCP, you can practically omit anything between [select] and [route].
gfmadsr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list